]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: backup: Configure backup store image with backing file
authorPeter Krempa <pkrempa@redhat.com>
Fri, 20 Dec 2019 08:33:40 +0000 (09:33 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 6 Jan 2020 09:15:35 +0000 (10:15 +0100)
In contrast to snapshots the backup job does not complain when the
backup job's store file has backing pre-configured. It's actually
required so that the NBD server exposes all the data properly.

Remove our fake termination and use the existing disk source as backing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_backup.c

index a039beaede653aafcbec7e5c5ec9ef25e51d4769..24a53fd85fd1b493ff6a5ee709ead92967fc8484 100644 (file)
@@ -302,7 +302,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
                              bool removeStore)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
-    g_autoptr(virStorageSource) terminator = NULL;
 
     /* set data structure */
     dd->backupdisk = backupdisk;
@@ -331,17 +330,14 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
             return -1;
     }
 
-    /* install terminator to prevent qemu form opening backing images */
-    if (!(terminator = virStorageSourceNew()))
-        return -1;
-
     if (!(dd->blockjob = qemuBlockJobDiskNewBackup(vm, dd->domdisk, dd->store,
                                                    removeStore,
                                                    dd->incrementalBitmap)))
         return -1;
 
+    /* use original disk as backing to prevent opening the backing chain */
     if (!(dd->crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(dd->store,
-                                                                           terminator,
+                                                                           dd->domdisk->src,
                                                                            priv->qemuCaps)))
         return -1;