mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-21 09:34:12 +03:00
virt-clone: only attempt --reflink for raw images
--reflink only works with raw images, since copying anything else will hit the qemu-img code path in libvirt storage driver. This can pop up more nowadays since UEFI support is using qcow2 as well. Let's only attempt --reflink for raw disk images. It's basically an optimization anyways https://bugzilla.redhat.com/show_bug.cgi?id=2256285 Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
a22ac0932e
commit
276aa4a72e
@ -127,9 +127,9 @@ storage options via -file.
|
||||
|
||||
|
||||
``--reflink``
|
||||
When --reflink is specified, perform a lightweight copy. This is much faster
|
||||
if source images and destination images are all on the same btrfs filesystem.
|
||||
If COW copy is not possible, then virt-clone fails.
|
||||
Perform a lightweight copy. This is much faster if source images and destination
|
||||
images are all on the same btrfs filesystem. This only works for raw format disk
|
||||
images, any non-raw images will not attempt to use refink
|
||||
|
||||
|
||||
``-m``, ``--mac`` MAC
|
||||
|
@ -1614,7 +1614,7 @@ c.add_invalid(_CLONE_UNMANAGED + " --auto-clone", grep="does not exist") # Auto
|
||||
|
||||
c = vclon.add_category("misc", "")
|
||||
c.add_compare("--connect %(URI-KVM-X86)s -o test-clone --auto-clone", "clone-auto1")
|
||||
c.add_compare("--connect %(URI-TEST-FULL)s -o test-clone-simple --name newvm --auto-clone", "clone-auto2")
|
||||
c.add_compare("--connect %(URI-TEST-FULL)s -o test-clone-simple --name newvm --auto-clone --reflink", "clone-auto2")
|
||||
c.add_compare("--connect %(URI-KVM-X86)s " + _CLONE_NVRAM + " --auto-clone", "clone-nvram") # hits a particular nvram code path
|
||||
c.add_compare("--connect %(URI-KVM-X86)s " + _CLONE_NVRAM + " --auto-clone --nvram /nvram/my-custom-path", "clone-nvram-path") # hits a particular nvram code path
|
||||
c.add_compare("--connect %(URI-KVM-X86)s " + _CLONE_NVRAM_NEWPOOL + " --auto-clone", "nvram-newpool") # hits a particular nvram code path
|
||||
|
@ -670,8 +670,11 @@ class StorageVolume(_StorageObject):
|
||||
cloneflags |= libvirt.VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA
|
||||
|
||||
if self.reflink:
|
||||
cloneflags |= getattr(libvirt,
|
||||
"VIR_STORAGE_VOL_CREATE_REFLINK", 1)
|
||||
if self.format != "raw":
|
||||
log.warning("skipping reflink for non-raw vol=%s", self.name)
|
||||
else:
|
||||
cloneflags |= getattr(libvirt,
|
||||
"VIR_STORAGE_VOL_CREATE_REFLINK", 1)
|
||||
|
||||
event = threading.Event()
|
||||
meter = progress.ensure_meter(meter)
|
||||
|
Loading…
Reference in New Issue
Block a user