[PATCH 03/18] qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name

Peter Krempa pkrempa at redhat.com
Fri Jul 10 14:33:24 UTC 2020


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 at redhat.com>
---
 src/qemu/qemu_block.c | 1 +
 src/qemu/qemu_block.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index bdd07d9925..34406aa743 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -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);
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index 0701fc18d1..9aab620947 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -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;
-- 
2.26.2




More information about the libvir-list mailing list