提交 93a16591 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 c938c353
...@@ -17124,7 +17124,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, ...@@ -17124,7 +17124,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
{ {
int ret = -1; int ret = -1;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virStorageSourcePtr oldsrc = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (!disk->mirror) { if (!disk->mirror) {
...@@ -17160,21 +17159,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, ...@@ -17160,21 +17159,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
* has already been labeled; but only necessary when we know for * has already been labeled; but only necessary when we know for
* sure that there is a backing chain. */ * sure that there is a backing chain. */
if (disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) { 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) if (qemuDomainDetermineDiskChain(driver, vm, disk, disk->mirror, true) < 0)
goto cleanup; goto cleanup;
if (disk->mirror->format && if (disk->mirror->format &&
disk->mirror->format != VIR_STORAGE_FILE_RAW && disk->mirror->format != VIR_STORAGE_FILE_RAW &&
(qemuDomainNamespaceSetupDisk(vm, disk->src) < 0 || (qemuDomainNamespaceSetupDisk(vm, disk->mirror) < 0 ||
qemuSetupImageChainCgroup(vm, disk->src) < 0 || qemuSetupImageChainCgroup(vm, disk->mirror) < 0 ||
qemuSecuritySetImageLabel(driver, vm, disk->src, true) < 0)) qemuSecuritySetImageLabel(driver, vm, disk->mirror, true) < 0))
goto cleanup; goto cleanup;
disk->src = oldsrc;
oldsrc = NULL;
} }
/* Attempt the pivot. Record the attempt now, to prevent duplicate /* Attempt the pivot. Record the attempt now, to prevent duplicate
...@@ -17202,9 +17195,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, ...@@ -17202,9 +17195,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
} }
cleanup: cleanup:
if (oldsrc)
disk->src = oldsrc;
virObjectUnref(cfg); virObjectUnref(cfg);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册