[libvirt] [PATCH] libxl: include a XLU_Config in _libxlDriverConfig
Jim Fehlig
jfehlig at suse.com
Fri Apr 17 20:06:05 UTC 2015
On 04/17/2015 11:44 AM, Olaf Hering wrote:
> Upcoming changes for vscsi will use libxlutil.so to prepare the
> configuration for libxl. The helpers needs a xlu struct for logging.
> Provide one and reuse the existing output as log target.
>
> Signed-off-by: Olaf Hering <olaf at aepfle.de>
> Cc: Jim Fehlig <jfehlig at suse.com>
> ---
> src/libxl/libxl_conf.c | 6 ++++++
> src/libxl/libxl_conf.h | 2 ++
> 2 files changed, 8 insertions(+)
>
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 8b76fc7..43712b3 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -1421,6 +1421,12 @@ libxlDriverConfigNew(void)
> goto error;
> }
>
> + cfg->xlu = xlu_cfg_init(cfg->logger_file, "libvirt");
> + if (!cfg->xlu) {
> + VIR_ERROR(_("cannot create xlu for libxenlight, disabling driver"));
> + goto error;
> + }
> +
> if (libxl_ctx_alloc(&cfg->ctx, LIBXL_VERSION, 0, cfg->logger)) {
> VIR_ERROR(_("cannot initialize libxenlight context, probably not "
> "running in a Xen Dom0, disabling driver"));
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 59389d1..fd2459f 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -27,6 +27,7 @@
> # define LIBXL_CONF_H
>
> # include <libxl.h>
> +# include <libxlutil.h>
I needed this too for parsing xl disk config, but until recently it was not
installed
http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=8ff079803677b82195addebc0e88f1630cb7354b
I added a check for libxlutil.h to libvirt's configure script. HAVE_LIBXLUTIL_H
will be defined if it exists. Currently it is only used in src/xenconfig/xen_xl.c.
Regards,
Jim
>
> # include "internal.h"
> # include "libvirt_internal.h"
> @@ -90,6 +91,7 @@ struct _libxlDriverConfig {
> /* log stream for driver-wide libxl ctx */
> FILE *logger_file;
> xentoollog_logger *logger;
> + XLU_Config *xlu;
> /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */
> libxl_ctx *ctx;
>
>
More information about the libvir-list
mailing list