[libvirt] [PATCH 3/5] Utilize virDomainDiskAuth for domain disk

Michal Privoznik mprivozn at redhat.com
Wed Jul 2 12:13:41 UTC 2014


On 27.06.2014 17:11, John Ferlan wrote:
> Replace the inline "auth" struct in virStorageSource with a pointer
> to a virStorageAuthDefPtr and utilize between the domain_conf, qemu_conf,
> and qemu_command sources for finding the auth data for a domain disk
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>   src/conf/domain_conf.c    | 106 +++++++---------------------------------------
>   src/libvirt_private.syms  |   1 -
>   src/qemu/qemu_command.c   |  72 +++++++++++++++++++++----------
>   src/qemu/qemu_conf.c      |  26 +++++++-----
>   src/util/virstoragefile.c |  14 +-----
>   src/util/virstoragefile.h |  10 +----
>   tests/qemuargv2xmltest.c  |   1 -
>   7 files changed, 81 insertions(+), 149 deletions(-)
>

> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 63f322a..6664547 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -45,6 +45,7 @@
>   #include "domain_conf.h"
>   #include "snapshot_conf.h"
>   #include "storage_conf.h"
> +#include "secret_conf.h"
>   #include "network/bridge_driver.h"
>   #include "virnetdevtap.h"
>   #include "base64.h"
> @@ -2469,9 +2470,7 @@ static char *
>   qemuGetSecretString(virConnectPtr conn,
>                       const char *scheme,
>                       bool encoded,
> -                    int diskSecretType,
> -                    char *username,
> -                    unsigned char *uuid, char *usage,
> +                    virStorageAuthDefPtr authdef,
>                       virSecretUsageType secretUsageType)
>   {
>       size_t secret_size;
> @@ -2480,25 +2479,26 @@ qemuGetSecretString(virConnectPtr conn,
>       char uuidStr[VIR_UUID_STRING_BUFLEN];
>
>       /* look up secret */
> -    switch (diskSecretType) {
> +    switch (authdef->secretType) {

Ahh, this answers my question in 1/5. Okay, leave the structure public.

Michal




More information about the libvir-list mailing list