]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name
authorPeter Krempa <pkrempa@redhat.com>
Fri, 19 Jun 2020 14:47:08 +0000 (16:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 17 Jul 2020 05:41:20 +0000 (07:41 +0200)
SCSI hostdevs don't have a virStorageSource associated with the backend
in certain cases. Adding a separate field to hold memory for a copy of
the nodename of the storage backend will allow reusing the blockdev
machinery also for SCSI hostdevs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_block.c
src/qemu/qemu_block.h

index 5faa6b8f1da17b341172771e35610745aafef88b..d4ff37ced64884888c8c31173091b8f365d569fa 100644 (file)
@@ -1557,6 +1557,7 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data)
     virJSONValueFree(data->encryptsecretProps);
     virJSONValueFree(data->tlsProps);
     virJSONValueFree(data->tlsKeySecretProps);
+    VIR_FREE(data->storageNodeNameCopy);
     VIR_FREE(data->tlsAlias);
     VIR_FREE(data->tlsKeySecretAlias);
     VIR_FREE(data->authsecretAlias);
index 0701fc18d12297f24f2633c635bf5523cd86b7fa..9aab6209477ae01d50df6cba802016b548dfffe3 100644 (file)
@@ -85,6 +85,7 @@ struct qemuBlockStorageSourceAttachData {
 
     virJSONValuePtr storageProps;
     const char *storageNodeName;
+    char *storageNodeNameCopy; /* in some cases we don't have the corresponding storage source */
     bool storageAttached;
 
     virJSONValuePtr storageSliceProps;