mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: Refactor storage backend attach/detach setup code to use 'storage' nodename accessors
Refactor the code settin up data structures used to attach/detach disks and SCSI hostdevs. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3bb5d48055
commit
b00ce640ec
@ -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);
|
||||
|
||||
|
@ -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)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user