[libvirt] [PATCH 02/10] qemu: driver: Remove dead code from qemuDomainSnapshotUpdateDiskSources

Peter Krempa posted 10 patches 6 years, 5 months ago
There is a newer version of this series
[libvirt] [PATCH 02/10] qemu: driver: Remove dead code from qemuDomainSnapshotUpdateDiskSources
Posted by Peter Krempa 6 years, 5 months ago
dd->src is always allocated in this function as it contains the new
source for the snapshot which is meant to replace the disk source.

The label handling code executed if that source was not present thus is
dead code. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b6fbb197b8..913b57855c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15421,13 +15421,6 @@ qemuDomainSnapshotUpdateDiskSources(virQEMUDriverPtr driver,
                                     virDomainObjPtr vm,
                                     qemuDomainSnapshotDiskDataPtr dd)
 {
-    if (!dd->src) {
-        /* Remove old metadata */
-        if (qemuSecurityMoveImageMetadata(driver, vm, dd->disk->src, NULL) < 0)
-            VIR_WARN("Unable to remove disk metadata on vm %s", vm->def->name);
-        return;
-    }
-
     /* storage driver access won'd be needed */
     if (dd->initialized)
         virStorageFileDeinit(dd->src);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 02/10] qemu: driver: Remove dead code from qemuDomainSnapshotUpdateDiskSources
Posted by Ján Tomko 6 years, 5 months ago
On Fri, Aug 16, 2019 at 03:54:36PM +0200, Peter Krempa wrote:
>dd->src is always allocated in this function as it contains the new
>source for the snapshot which is meant to replace the disk source.
>
>The label handling code executed if that source was not present thus is
>dead code. Remove it.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_driver.c | 7 -------
> 1 file changed, 7 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list