libxl: include a XLU_Config in _libxlDriverConfig
Quoted 33 lines · Olaf Hering
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 <[email protected]>Cc Jim Fehlig <[email protected]>--- src/libxl/libxl_conf.c | 6 ++++++ src/libxl/libxl_conf.h | 2 ++ 2 files changed, 8 insertions(+)src/libxl/libxl_conf.c +6
-0@@ -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" ));src/libxl/libxl_conf.h +0
-0
src/libxl/libxl_conf.h line 30
Quoted 4 lines
src/libxl/libxl_conf.h +1
-0@@ -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
Quoted 12 lines
src/libxl/libxl_conf.h +1
-0# 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;