From 93a165917169e8a56c466e8de4f86de280c0f4b9 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 23 Jan 2019 13:53:14 +0100 Subject: [PATCH] qemu: driver: Remove disk source munging in qemuDomainBlockPivot Previously there weren't any suitable functions which would allow setting up host side of a full disk chain so we've opted to replace the 'src' in a virDomainDiskDef by the new image source. That is now no longer necessary so remove the munging. Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 79f77bfa2f..007c46fd99 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17124,7 +17124,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, { int ret = -1; qemuDomainObjPrivatePtr priv = vm->privateData; - virStorageSourcePtr oldsrc = NULL; virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); if (!disk->mirror) { @@ -17160,21 +17159,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, * has already been labeled; but only necessary when we know for * sure that there is a backing chain. */ if (disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) { - oldsrc = disk->src; - disk->src = disk->mirror; - if (qemuDomainDetermineDiskChain(driver, vm, disk, disk->mirror, true) < 0) goto cleanup; if (disk->mirror->format && disk->mirror->format != VIR_STORAGE_FILE_RAW && - (qemuDomainNamespaceSetupDisk(vm, disk->src) < 0 || - qemuSetupImageChainCgroup(vm, disk->src) < 0 || - qemuSecuritySetImageLabel(driver, vm, disk->src, true) < 0)) + (qemuDomainNamespaceSetupDisk(vm, disk->mirror) < 0 || + qemuSetupImageChainCgroup(vm, disk->mirror) < 0 || + qemuSecuritySetImageLabel(driver, vm, disk->mirror, true) < 0)) goto cleanup; - - disk->src = oldsrc; - oldsrc = NULL; } /* Attempt the pivot. Record the attempt now, to prevent duplicate @@ -17202,9 +17195,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, } cleanup: - if (oldsrc) - disk->src = oldsrc; - virObjectUnref(cfg); return ret; } -- GitLab