[libvirt] [PATCH v2 06/14] qemu: Introduce privateData for _virStorageSource

Peter Krempa pkrempa at redhat.com
Thu Sep 21 14:31:20 UTC 2017


On Fri, Sep 15, 2017 at 20:30:09 -0400, John Ferlan wrote:
> Since the secret information is really _virStorageSource specific
> piece of data, let's create a privateData object for _virStorageSource
> and move the @secinfo from _qemuDomainDiskPrivate into a new
> _qemuDomainDiskSrcPrivate structure and manage it from there.

This would be easier to review if you'd split the private data addition
and the movement of the auth data to it.

> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/domain_conf.c    |  5 +++++
>  src/conf/domain_conf.h    |  1 +
>  src/qemu/qemu_command.c   |  6 ++++--
>  src/qemu/qemu_domain.c    | 54 +++++++++++++++++++++++++++++++++++++++++------
>  src/qemu/qemu_domain.h    | 17 +++++++++++----
>  src/qemu/qemu_hotplug.c   | 11 +++++++---
>  src/util/virstoragefile.c |  1 +
>  src/util/virstoragefile.h |  3 +++
>  8 files changed, 83 insertions(+), 15 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 542d14ed6..a3900488f 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1720,6 +1720,11 @@ virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt)
>          !(ret->privateData = xmlopt->privateData.diskNew()))
>          goto error;
>  
> +    if (xmlopt &&
> +        xmlopt->privateData.diskSrcNew &&
> +        !(ret->src->privateData = xmlopt->privateData.diskSrcNew()))
> +        goto error;

This certainly is not enough. The virStorageSource structure needs to
allocate it in it's helper. This will only fix the top level one and not
the nested/chained ones for the backing store.

> +
>      return ret;
>  
>   error:


Rest looks okay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170921/95ad7bdc/attachment-0001.sig>


More information about the libvir-list mailing list