[libvirt] [PATCH] storage: Need to set secrettype for direct iscsi disk volume
John Ferlan
jferlan at redhat.com
Tue Jun 9 15:34:21 UTC 2015
On 06/08/2015 07:00 PM, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1200206
>
> Commit id '1b4eaa61' added the ability to have a mode='direct' for
> an iscsi disk volume. It relied on virStorageTranslateDiskSourcePool
> in order to copy any disk source pool authentication information to
> the direct disk volume, but it neglected to also copy the 'secrettype'
> field which ends up being used in the domain volume formatting code.
> Adding a secrettype for this case will allow for proper formatting later
> and allow disk snapshotting to work properly
>
Found yet another path that won't work quite right - tweaking now and
will repost everything as a v2, so ignore this one...
John
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
> src/storage/storage_driver.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
> index ab8675d..57060ab 100644
> --- a/src/storage/storage_driver.c
> +++ b/src/storage/storage_driver.c
> @@ -3310,6 +3310,16 @@ virStorageTranslateDiskSourcePool(virConnectPtr conn,
> &pooldef->source) < 0)
> goto cleanup;
>
> + /* Source pool may not fill in the secrettype field,
> + * so we need to do so here
> + */
> + if (def->src->auth && !def->src->auth->secrettype) {
> + const char *secrettype =
> + virSecretUsageTypeToString(VIR_SECRET_USAGE_TYPE_ISCSI);
> + if (VIR_STRDUP(def->src->auth->secrettype, secrettype) < 0)
> + goto cleanup;
> + }
> +
> if (virStorageAddISCSIPoolSourceHost(def, pooldef) < 0)
> goto cleanup;
> break;
>
More information about the libvir-list
mailing list