From 0489a7c6ee3655ba126eacbf60fa81dd39b51e71 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 19 Jun 2020 16:47:08 +0200 Subject: [PATCH] qemuBlockStorageSourceAttachData: Add field for ad-hoc storage node name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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; -- 2.47.2