From: Peter Krempa Date: Fri, 19 Jun 2020 14:47:08 +0000 (+0200) Subject: qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name X-Git-Tag: v6.6.0-rc1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0489a7c6ee3655ba126eacbf60fa81dd39b51e71;p=thirdparty%2Flibvirt.git qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 5faa6b8f1d..d4ff37ced6 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;