diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fa8bf39359..9cd46e8ea7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10723,11 +10723,12 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk, static int qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainData *data, virStorageSourcePtr src, + virStorageSourcePtr backingStore, virQEMUCapsPtr qemuCaps) { VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem = NULL; - if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, src->backingStore, true))) + if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, backingStore, true))) return -1; if (qemuBuildStorageSourceAttachPrepareCommon(src, elem, qemuCaps) < 0) @@ -10759,7 +10760,9 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, return NULL; for (n = top; virStorageSourceIsBacking(n); n = n->backingStore) { - if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, n, qemuCaps) < 0) + if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, n, + n->backingStore, + qemuCaps) < 0) return NULL; } @@ -10770,6 +10773,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, /** * qemuBuildStorageSourceChainAttachPrepareBlockdevTop: * @top: storage source chain + * @backingStore: a storage source to use as backing of @top * @qemuCaps: qemu capabilities object * * Prepares qemuBlockStorageSourceChainDataPtr for attaching of @top image only @@ -10777,6 +10781,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, */ qemuBlockStorageSourceChainDataPtr qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top, + virStorageSourcePtr backingStore, virQEMUCapsPtr qemuCaps) { VIR_AUTOPTR(qemuBlockStorageSourceChainData) data = NULL; @@ -10784,7 +10789,8 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top, if (VIR_ALLOC(data) < 0) return NULL; - if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, top, qemuCaps) < 0) + if (qemuBuildStorageSourceChainAttachPrepareBlockdevOne(data, top, backingStore, + qemuCaps) < 0) return NULL; VIR_RETURN_PTR(data); diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 6f97e7bc0c..60f9843b03 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -119,6 +119,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, qemuBlockStorageSourceChainDataPtr qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top, + virStorageSourcePtr backingStore, virQEMUCapsPtr qemuCaps); char diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index aa9efc684f..39a0ee29b4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18553,6 +18553,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, } if (!(crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror, + mirror->backingStore, priv->qemuCaps))) goto endjob; }