Re: [PATCH 3/5] libxl: Move virDomainXMLOptionNew into libxlCreateXMLConf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel P. Berrange wrote:
> To allow the test suite to creat the XML option object,
> move the virDomainXMLOptionNew call into a libxlCreateXMLConf
> method.
>
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/libxl/libxl_conf.c   | 7 +++++++
>  src/libxl/libxl_conf.h   | 2 ++
>  src/libxl/libxl_domain.c | 4 ++--
>  src/libxl/libxl_driver.c | 4 +---
>  4 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index f9e3a1b..967759c 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -1336,3 +1336,10 @@ libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
>  
>      return 0;
>  }
> +
> +virDomainXMLOptionPtr libxlCreateXMLConf(void)
>   

Return type and function name on separate lines.

> +{
> +    return virDomainXMLOptionNew(&libxlDomainDefParserConfig,
> +                                 &libxlDomainXMLPrivateDataCallbacks,
> +                                 NULL);
> +}
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 2dcd0b8..7a9a7d5 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -158,6 +158,8 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
>  int
>  libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev);
>  
> +virDomainXMLOptionPtr libxlCreateXMLConf(void);
>   

Same here.

> +
>  int
>  libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
>                         virDomainDefPtr def,
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index e00a3fb..00ff14f 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -1100,6 +1100,8 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>  #endif
>      virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
>  
> +    libxl_domain_config_init(&d_config);
> +
>      if (libxlDomainObjPrivateInitCtx(vm) < 0)
>          return ret;
>  
> @@ -1149,8 +1151,6 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>          VIR_FREE(managed_save_path);
>      }
>  
> -    libxl_domain_config_init(&d_config);
> -
>      if (libxlBuildDomainConfig(driver->reservedVNCPorts, vm->def,
>                                 priv->ctx, &d_config) < 0)
>          goto endjob;
>   

Are these two hunks fixing a bug you found? :-)

Regards,
Jim

> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index df7d510..515d5c9 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -353,9 +353,7 @@ libxlStateInitialize(bool privileged,
>          goto error;
>      }
>  
> -    if (!(libxl_driver->xmlopt = virDomainXMLOptionNew(&libxlDomainDefParserConfig,
> -                                                       &libxlDomainXMLPrivateDataCallbacks,
> -                                                       NULL)))
> +    if (!(libxl_driver->xmlopt = libxlCreateXMLConf()))
>          goto error;
>  
>      /* Load running domains first. */
>   

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]