mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
qemu: migration: Pre-create QCOW2 images for non-shared storage with 0 allocation
Specify that the <allocation> parameter for the newly-created qcow2 image is 0 so that only metadata gets preallocated. Otherwise the storage driver code instructs qemu to use 'fallocate' preallocation mode and considers the image fully allocated. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
54109db826
commit
165b30e06a
@ -361,6 +361,8 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
|
||||
virBufferAddLit(&buf, "<volume>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
virBufferEscapeString(&buf, "<name>%s</name>\n", volName);
|
||||
if (disk->src->format == VIR_STORAGE_FILE_QCOW2)
|
||||
virBufferAddLit(&buf, "<allocation>0</allocation>\n");
|
||||
virBufferAsprintf(&buf, "<capacity>%llu</capacity>\n", capacity);
|
||||
virBufferAddLit(&buf, "<target>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user