mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: block: explicitly pass backing store to qemuBlockStorageSourceAttachPrepareBlockdev
Pass backing store as an argument rather than extracting it locally and fix the callers. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
eee85c2349
commit
7b47a8f814
@ -1464,6 +1464,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
|
||||
/**
|
||||
* qemuBlockStorageSourceAttachPrepareBlockdev:
|
||||
* @src: storage source to prepare data from
|
||||
* @backingStore: storage source to use as backing of @src
|
||||
* @autoreadonly: use 'auto-read-only' feature of qemu
|
||||
*
|
||||
* Creates a qemuBlockStorageSourceAttachData structure containing data to attach
|
||||
@ -1478,6 +1479,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
|
||||
*/
|
||||
qemuBlockStorageSourceAttachDataPtr
|
||||
qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
|
||||
virStorageSourcePtr backingStore,
|
||||
bool autoreadonly)
|
||||
{
|
||||
VIR_AUTOPTR(qemuBlockStorageSourceAttachData) data = NULL;
|
||||
@ -1486,7 +1488,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
|
||||
return NULL;
|
||||
|
||||
if (!(data->formatProps = qemuBlockStorageSourceGetBlockdevProps(src,
|
||||
src->backingStore)) ||
|
||||
backingStore)) ||
|
||||
!(data->storageProps = qemuBlockStorageSourceGetBackendProps(src, false,
|
||||
false,
|
||||
autoreadonly)))
|
||||
|
@ -109,6 +109,7 @@ VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceAttachData,
|
||||
|
||||
qemuBlockStorageSourceAttachDataPtr
|
||||
qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src,
|
||||
virStorageSourcePtr backingStore,
|
||||
bool autoreadonly);
|
||||
|
||||
qemuBlockStorageSourceAttachDataPtr
|
||||
|
@ -10727,7 +10727,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainD
|
||||
{
|
||||
VIR_AUTOPTR(qemuBlockStorageSourceAttachData) elem = NULL;
|
||||
|
||||
if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, true)))
|
||||
if (!(elem = qemuBlockStorageSourceAttachPrepareBlockdev(src, src->backingStore, true)))
|
||||
return -1;
|
||||
|
||||
if (qemuBuildStorageSourceAttachPrepareCommon(src, elem, qemuCaps) < 0)
|
||||
|
@ -832,7 +832,9 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver,
|
||||
|
||||
/* Migration via blockdev-mirror was supported sooner than the auto-read-only
|
||||
* feature was added to qemu */
|
||||
if (!(data = qemuBlockStorageSourceAttachPrepareBlockdev(copysrc, false)))
|
||||
if (!(data = qemuBlockStorageSourceAttachPrepareBlockdev(copysrc,
|
||||
copysrc->backingStore,
|
||||
false)))
|
||||
goto cleanup;
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(driver, vm,
|
||||
|
Loading…
Reference in New Issue
Block a user