Refactor the code settin up data structures used to attach/detach disks and SCSI hostdevs. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_block.c | 7 ++++--- src/qemu/qemu_command.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 1fc36569a9..7355cb0b5e 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1484,7 +1484,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src, backendpropsflags))) return NULL; - data->storageNodeName = src->nodestorage; + data->storageNodeName = qemuBlockStorageSourceGetStorageNodename(src); data->formatNodeName = src->nodeformat; if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) { @@ -1705,7 +1705,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource *src) data->formatNodeName = src->nodeformat; data->formatAttached = true; - data->storageNodeName = src->nodestorage; + data->storageNodeName = qemuBlockStorageSourceGetStorageNodename(src); data->storageAttached = true; /* 'raw' format doesn't need the extra 'raw' layer when slicing, thus @@ -1899,7 +1899,8 @@ qemuBlockStorageSourceDetachOneBlockdev(virDomainObj *vm, ret = qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->nodeformat); if (ret == 0) - ret = qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->nodestorage); + ret = qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), + qemuBlockStorageSourceGetStorageNodename(src)); qemuDomainObjExitMonitor(vm); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8a7b80719f..40de712c61 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5049,7 +5049,7 @@ qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev, } srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); - ret->storageNodeName = src->nodestorage; + ret->storageNodeName = qemuBlockStorageSourceGetStorageNodename(src); ret->storageAttached = true; if (srcpriv && srcpriv->secinfo) @@ -5083,8 +5083,8 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef *hostdev, return NULL; } - ret->storageNodeName = src->nodestorage; - *backendAlias = src->nodestorage; + ret->storageNodeName = qemuBlockStorageSourceGetStorageNodename(src); + *backendAlias = qemuBlockStorageSourceGetStorageNodename(src); if (!(ret->storageProps = qemuBlockStorageSourceGetBackendProps(src, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP))) -- 2.41.0