diff --git a/pkg/hostman/storageman/imagecache_rbd.go b/pkg/hostman/storageman/imagecache_rbd.go index 1dbc9b5e6e..b9662215eb 100644 --- a/pkg/hostman/storageman/imagecache_rbd.go +++ b/pkg/hostman/storageman/imagecache_rbd.go @@ -24,7 +24,6 @@ import ( "yunion.io/x/log" "yunion.io/x/onecloud/pkg/hostman/hostutils" - "yunion.io/x/onecloud/pkg/hostman/options" "yunion.io/x/onecloud/pkg/hostman/storageman/remotefile" "yunion.io/x/onecloud/pkg/mcclient/modules" "yunion.io/x/onecloud/pkg/util/procutils" @@ -75,11 +74,11 @@ func (r *SRbdImageCache) Acquire(ctx context.Context, zone, srcUrl, format strin } r.imageName = localImageCache.GetName() if !r.Load() { - log.Debugf("convert local image %s to rbd pool %s", r.imageId, r.Manager.GetPath()) + log.Infof("convert local image %s to rbd pool %s", r.imageId, r.Manager.GetPath()) err := procutils.NewRemoteCommandAsFarAsPossible(qemutils.GetQemuImg(), "convert", "-O", "raw", localImageCache.GetPath(), r.GetPath()).Run() if err != nil { - log.Errorf("failed to convert image %s", options.HostOptions.ServersPath) + log.Errorf("failed to convert image %s", err) return false } } diff --git a/pkg/hostman/storageman/imagecachemanager_rbd.go b/pkg/hostman/storageman/imagecachemanager_rbd.go index a12982db3e..751c2ba095 100644 --- a/pkg/hostman/storageman/imagecachemanager_rbd.go +++ b/pkg/hostman/storageman/imagecachemanager_rbd.go @@ -111,7 +111,7 @@ func (c *SRbdImageCacheManager) PrefetchImageCache(ctx context.Context, data int if err != nil { return nil, err } - format := "qcow2" + format, _ := body.GetString("format") srcUrl, _ := body.GetString("src_url") zone, _ := body.GetString("zone")