[libvirt] [PATCH v5 2/5] qemu: Create a common qemuGetSecretString

Ján Tomko jtomko at redhat.com
Tue Jul 23 14:18:46 UTC 2013


On 07/22/2013 10:31 PM, John Ferlan wrote:
> Make the secret fetching code common for qemuBuildRBDString() and
> qemuBuildDriveURIString() using the virDomainDiskDef.
> ---
>  src/qemu/qemu_command.c | 157 +++++++++++++++++++++++++-----------------------
>  1 file changed, 81 insertions(+), 76 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 4a49d81..5bd8e87 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -2478,47 +2531,23 @@ qemuBuildRBDString(virConnectPtr conn,
>  
>      virBufferEscape(opt, ',', ",", "rbd:%s", disk->src);
>      if (disk->auth.username) {
> +
>          virBufferEscape(opt, '\\', ":", ":id=%s", disk->auth.username);
> -        /* look up secret */
> -        switch (disk->auth.secretType) {
> -        case VIR_DOMAIN_DISK_SECRET_TYPE_UUID:
> -            sec = virSecretLookupByUUID(conn,
> -                                        disk->auth.secret.uuid);
> -            break;
> -        case VIR_DOMAIN_DISK_SECRET_TYPE_USAGE:
> -            sec = virSecretLookupByUsage(conn,
> -                                         VIR_SECRET_USAGE_TYPE_CEPH,
> -                                         disk->auth.secret.usage);
> -            break;
> -        }
> +        /* Get the secret string using the virDomainDiskDef 

trailing whitespace                                           ^

ACK

Jan




More information about the libvir-list mailing list