Anthony PERARD (3): libxl_qmp: Use GC instead of CTX as parameter for _initialize. Provide dm_vnc() as a in libxl helper. libxl: Set VNC password through QMP tools/libxl/libxl_create.c | 2 +- tools/libxl/libxl_dm.c | 32 ++++++++++++++---------- tools/libxl/libxl_internal.h | 7 ++++- tools/libxl/libxl_qmp.c | 55 ++++++++++++++++++++++++++++++----------- 4 files changed, 65 insertions(+), 31 deletions(-) -- Anthony PERARD
Anthony PERARD
2012-Feb-09 14:06 UTC
[PATCH V2 1/3] libxl_qmp: Use GC instead of CTX as parameter for _initialize.
This make things a bit easier. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- tools/libxl/libxl_create.c | 2 +- tools/libxl/libxl_internal.h | 4 ++-- tools/libxl/libxl_qmp.c | 27 ++++++++++++--------------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index f28d814..9148b26 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -594,7 +594,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config, if (dm_starting) { if (d_config->b_info.device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { - libxl__qmp_initializations(ctx, domid); + libxl__qmp_initializations(gc, domid); } ret = libxl__confirm_device_model_startup(gc, &state, dm_starting); if (ret < 0) { diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 832cf35..972c818 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -991,7 +991,7 @@ typedef struct libxl__qmp_handler libxl__qmp_handler; /* Initialise and connect to the QMP socket. * Return an handler or NULL if there is an error */ -_hidden libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, +_hidden libxl__qmp_handler *libxl__qmp_initialize(libxl__gc *gc, uint32_t domid); /* ask to QEMU the serial port information and store it in xenstore. */ _hidden int libxl__qmp_query_serial(libxl__qmp_handler *qmp); @@ -1007,7 +1007,7 @@ _hidden void libxl__qmp_close(libxl__qmp_handler *qmp); _hidden void libxl__qmp_cleanup(libxl__gc *gc, uint32_t domid); /* this helper calls qmp_initialize, query_serial and qmp_close */ -_hidden int libxl__qmp_initializations(libxl_ctx *ctx, uint32_t domid); +_hidden int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid); /* from libxl_json */ #include <yajl/yajl_gen.h> diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c index e0642e3..ab34d1d 100644 --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -289,17 +289,17 @@ static int qmp_handle_response(libxl__qmp_handler *qmp, * Handler functions */ -static libxl__qmp_handler *qmp_init_handler(libxl_ctx *ctx, uint32_t domid) +static libxl__qmp_handler *qmp_init_handler(libxl__gc *gc, uint32_t domid) { libxl__qmp_handler *qmp = NULL; qmp = calloc(1, sizeof (libxl__qmp_handler)); if (qmp == NULL) { - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, + LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR, "Failed to allocate qmp_handler"); return NULL; } - qmp->ctx = ctx; + qmp->ctx = libxl__gc_owner(gc); qmp->domid = domid; qmp->timeout = 5; @@ -621,20 +621,18 @@ static void qmp_free_handler(libxl__qmp_handler *qmp) * API */ -libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, uint32_t domid) +libxl__qmp_handler *libxl__qmp_initialize(libxl__gc *gc, uint32_t domid) { int ret = 0; libxl__qmp_handler *qmp = NULL; char *qmp_socket; - GC_INIT(ctx); - qmp = qmp_init_handler(ctx, domid); + qmp = qmp_init_handler(gc, domid); qmp_socket = libxl__sprintf(gc, "%s/qmp-libxl-%d", libxl_run_dir_path(), domid); if ((ret = qmp_open(qmp, qmp_socket, QMP_SOCKET_CONNECT_TIMEOUT)) < 0) { - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Connection error"); - GC_FREE; + LIBXL__LOG_ERRNO(qmp->ctx, LIBXL__LOG_ERROR, "Connection error"); qmp_free_handler(qmp); return NULL; } @@ -648,9 +646,8 @@ libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, uint32_t domid) } } - GC_FREE; if (!qmp->connected) { - LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to connect to QMP"); + LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR, "Failed to connect to QMP"); libxl__qmp_close(qmp); return NULL; } @@ -744,7 +741,7 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev) char *hostaddr = NULL; int rc = 0; - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); + qmp = libxl__qmp_initialize(gc, domid); if (!qmp) return -1; @@ -789,7 +786,7 @@ static int qmp_device_del(libxl__gc *gc, int domid, char *id) libxl_key_value_list args = NULL; int rc = 0; - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); + qmp = libxl__qmp_initialize(gc, domid); if (!qmp) return ERROR_FAIL; @@ -850,7 +847,7 @@ int libxl__qmp_migrate(libxl__gc *gc, int domid, int fd) libxl_key_value_list args = NULL; int rc = 0; - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); + qmp = libxl__qmp_initialize(gc, domid); if (!qmp) return ERROR_FAIL; @@ -880,12 +877,12 @@ out: return rc; } -int libxl__qmp_initializations(libxl_ctx *ctx, uint32_t domid) +int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid) { libxl__qmp_handler *qmp = NULL; int ret = 0; - qmp = libxl__qmp_initialize(ctx, domid); + qmp = libxl__qmp_initialize(gc, domid); if (!qmp) return -1; ret = libxl__qmp_query_serial(qmp); -- Anthony PERARD
Anthony PERARD
2012-Feb-09 14:06 UTC
[PATCH V2 2/3] Provide dm_vnc() as a in libxl helper.
Just to use this function in more than one file.c. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- tools/libxl/libxl_dm.c | 8 ++++---- tools/libxl/libxl_internal.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 5fec137..3422ec0 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -73,7 +73,7 @@ static const char *libxl__domain_bios(libxl__gc *gc, } } -static const libxl_vnc_info *dm_vnc(const libxl_domain_config *guest_config) +const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config) { const libxl_vnc_info *vnc = NULL; if (guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) { @@ -113,7 +113,7 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, const libxl_domain_create_info *c_info = &guest_config->c_info; const libxl_domain_build_info *b_info = &guest_config->b_info; const libxl_device_nic *vifs = guest_config->vifs; - const libxl_vnc_info *vnc = dm_vnc(guest_config); + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); const libxl_sdl_info *sdl = dm_sdl(guest_config); const int num_vifs = guest_config->num_vifs; const char *keymap = dm_keymap(guest_config); @@ -328,7 +328,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, const libxl_device_nic *vifs = guest_config->vifs; const int num_disks = guest_config->num_disks; const int num_vifs = guest_config->num_vifs; - const libxl_vnc_info *vnc = dm_vnc(guest_config); + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); const libxl_sdl_info *sdl = dm_sdl(guest_config); const char *keymap = dm_keymap(guest_config); flexarray_t *dm_args; @@ -889,7 +889,7 @@ int libxl__create_device_model(libxl__gc *gc, libxl_ctx *ctx = libxl__gc_owner(gc); const libxl_domain_create_info *c_info = &guest_config->c_info; const libxl_domain_build_info *b_info = &guest_config->b_info; - const libxl_vnc_info *vnc = dm_vnc(guest_config); + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); char *path, *logfile; int logfile_w, null; int rc; diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 972c818..957eca2 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -899,6 +899,8 @@ _hidden int libxl__wait_for_device_model(libxl__gc *gc, _hidden int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid); +_hidden const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *g_cfg); + _hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path); #define LIBXL__LOG_DEBUG XTL_DEBUG -- Anthony PERARD
This patch provide the code to set the VNC password to QEMU upstream through VNC. The password is still stored in xenstore but will not be used by QEMU upstream. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> --- tools/libxl/libxl_create.c | 2 +- tools/libxl/libxl_dm.c | 24 +++++++++++++++--------- tools/libxl/libxl_internal.h | 3 ++- tools/libxl/libxl_qmp.c | 30 +++++++++++++++++++++++++++++- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 9148b26..deccf88 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -594,7 +594,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config, if (dm_starting) { if (d_config->b_info.device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { - libxl__qmp_initializations(gc, domid); + libxl__qmp_initializations(gc, domid, d_config); } ret = libxl__confirm_device_model_startup(gc, &state, dm_starting); if (ret < 0) { diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 3422ec0..434750a 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -361,10 +361,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, if (vnc) { int display = 0; const char *listen = "127.0.0.1"; + char *vncarg = NULL; - if (vnc->passwd && vnc->passwd[0]) { - assert(!"missing code for supplying vnc password to qemu"); - } flexarray_append(dm_args, "-vnc"); if (vnc->display) { @@ -377,13 +375,19 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, } if (strchr(listen, '':'') != NULL) - flexarray_append(dm_args, - libxl__sprintf(gc, "%s%s", listen, - vnc->findunused ? ",to=99" : "")); + vncarg = libxl__sprintf(gc, "%s", listen); else - flexarray_append(dm_args, - libxl__sprintf(gc, "%s:%d%s", listen, display, - vnc->findunused ? ",to=99" : "")); + vncarg = libxl__sprintf(gc, "%s:%d", listen, display); + if (vnc->passwd && vnc->passwd[0]) { + vncarg = libxl__sprintf(gc, "%s,password", vncarg); + } + if (vnc->findunused) { + /* This option asks to QEMU to try this number of port before to + * give up. So QEMU will try ports between $display and $display + + * 99. This option needs to be the last one of the vnc options. */ + vncarg = libxl__sprintf(gc, "%s,to=99", vncarg); + } + flexarray_append(dm_args, vncarg); } if (sdl) { flexarray_append(dm_args, "-sdl"); @@ -964,6 +968,8 @@ int libxl__create_device_model(libxl__gc *gc, } if (vnc && vnc->passwd) { + /* This xenstore key will only be used by qemu-xen-traditionnal. + * The code to supply vncpasswd to qemu-xen is later. */ retry_transaction: /* Find uuid and the write the vnc password to xenstore for qemu. */ t = xs_transaction_start(ctx->xsh); diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 957eca2..bde91cd 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1009,7 +1009,8 @@ _hidden void libxl__qmp_close(libxl__qmp_handler *qmp); _hidden void libxl__qmp_cleanup(libxl__gc *gc, uint32_t domid); /* this helper calls qmp_initialize, query_serial and qmp_close */ -_hidden int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid); +_hidden int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid, + const libxl_domain_config *guest_config); /* from libxl_json */ #include <yajl/yajl_gen.h> diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c index ab34d1d..b80b027 100644 --- a/tools/libxl/libxl_qmp.c +++ b/tools/libxl/libxl_qmp.c @@ -877,8 +877,33 @@ out: return rc; } -int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid) +static int qmp_change(libxl__gc *gc, libxl__qmp_handler *qmp, + char *device, char *target, char *arg) { + flexarray_t *parameters = NULL; + libxl_key_value_list args = NULL; + int rc = 0; + + parameters = flexarray_make(6, 1); + flexarray_append_pair(parameters, "device", device); + flexarray_append_pair(parameters, "target", target); + if (arg) + flexarray_append_pair(parameters, "arg", arg); + args = libxl__xs_kvs_of_flexarray(gc, parameters, parameters->count); + if (!args) + return ERROR_NOMEM; + + rc = qmp_synchronous_send(qmp, "change", &args, + NULL, NULL, qmp->timeout); + + flexarray_free(parameters); + return rc; +} + +int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid, + const libxl_domain_config *guest_config) +{ + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); libxl__qmp_handler *qmp = NULL; int ret = 0; @@ -886,6 +911,9 @@ int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid) if (!qmp) return -1; ret = libxl__qmp_query_serial(qmp); + if (!ret && vnc && vnc->passwd) { + ret = qmp_change(gc, qmp, "vnc", "password", vnc->passwd); + } libxl__qmp_close(qmp); return ret; } -- Anthony PERARD
Ian Campbell
2012-Feb-09 14:14 UTC
Re: [PATCH V2 1/3] libxl_qmp: Use GC instead of CTX as parameter for _initialize.
On Thu, 2012-02-09 at 14:06 +0000, Anthony PERARD wrote:> This make things a bit easier.It''s also the correct thing for a libxl__ function to take. BTW you can use the CTX macro as a shorthand for the libxl__gc_owner stuff.> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/libxl/libxl_create.c | 2 +- > tools/libxl/libxl_internal.h | 4 ++-- > tools/libxl/libxl_qmp.c | 27 ++++++++++++--------------- > 3 files changed, 15 insertions(+), 18 deletions(-) > > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c > index f28d814..9148b26 100644 > --- a/tools/libxl/libxl_create.c > +++ b/tools/libxl/libxl_create.c > @@ -594,7 +594,7 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config, > if (dm_starting) { > if (d_config->b_info.device_model_version > == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > - libxl__qmp_initializations(ctx, domid); > + libxl__qmp_initializations(gc, domid); > } > ret = libxl__confirm_device_model_startup(gc, &state, dm_starting); > if (ret < 0) { > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 832cf35..972c818 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -991,7 +991,7 @@ typedef struct libxl__qmp_handler libxl__qmp_handler; > /* Initialise and connect to the QMP socket. > * Return an handler or NULL if there is an error > */ > -_hidden libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, > +_hidden libxl__qmp_handler *libxl__qmp_initialize(libxl__gc *gc, > uint32_t domid); > /* ask to QEMU the serial port information and store it in xenstore. */ > _hidden int libxl__qmp_query_serial(libxl__qmp_handler *qmp); > @@ -1007,7 +1007,7 @@ _hidden void libxl__qmp_close(libxl__qmp_handler *qmp); > _hidden void libxl__qmp_cleanup(libxl__gc *gc, uint32_t domid); > > /* this helper calls qmp_initialize, query_serial and qmp_close */ > -_hidden int libxl__qmp_initializations(libxl_ctx *ctx, uint32_t domid); > +_hidden int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid); > > /* from libxl_json */ > #include <yajl/yajl_gen.h> > diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c > index e0642e3..ab34d1d 100644 > --- a/tools/libxl/libxl_qmp.c > +++ b/tools/libxl/libxl_qmp.c > @@ -289,17 +289,17 @@ static int qmp_handle_response(libxl__qmp_handler *qmp, > * Handler functions > */ > > -static libxl__qmp_handler *qmp_init_handler(libxl_ctx *ctx, uint32_t domid) > +static libxl__qmp_handler *qmp_init_handler(libxl__gc *gc, uint32_t domid) > { > libxl__qmp_handler *qmp = NULL; > > qmp = calloc(1, sizeof (libxl__qmp_handler)); > if (qmp == NULL) { > - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, > + LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR, > "Failed to allocate qmp_handler"); > return NULL; > } > - qmp->ctx = ctx; > + qmp->ctx = libxl__gc_owner(gc); > qmp->domid = domid; > qmp->timeout = 5; > > @@ -621,20 +621,18 @@ static void qmp_free_handler(libxl__qmp_handler *qmp) > * API > */ > > -libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, uint32_t domid) > +libxl__qmp_handler *libxl__qmp_initialize(libxl__gc *gc, uint32_t domid) > { > int ret = 0; > libxl__qmp_handler *qmp = NULL; > char *qmp_socket; > - GC_INIT(ctx); > > - qmp = qmp_init_handler(ctx, domid); > + qmp = qmp_init_handler(gc, domid); > > qmp_socket = libxl__sprintf(gc, "%s/qmp-libxl-%d", > libxl_run_dir_path(), domid); > if ((ret = qmp_open(qmp, qmp_socket, QMP_SOCKET_CONNECT_TIMEOUT)) < 0) { > - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Connection error"); > - GC_FREE; > + LIBXL__LOG_ERRNO(qmp->ctx, LIBXL__LOG_ERROR, "Connection error"); > qmp_free_handler(qmp); > return NULL; > } > @@ -648,9 +646,8 @@ libxl__qmp_handler *libxl__qmp_initialize(libxl_ctx *ctx, uint32_t domid) > } > } > > - GC_FREE; > if (!qmp->connected) { > - LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Failed to connect to QMP"); > + LIBXL__LOG(qmp->ctx, LIBXL__LOG_ERROR, "Failed to connect to QMP"); > libxl__qmp_close(qmp); > return NULL; > } > @@ -744,7 +741,7 @@ int libxl__qmp_pci_add(libxl__gc *gc, int domid, libxl_device_pci *pcidev) > char *hostaddr = NULL; > int rc = 0; > > - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); > + qmp = libxl__qmp_initialize(gc, domid); > if (!qmp) > return -1; > > @@ -789,7 +786,7 @@ static int qmp_device_del(libxl__gc *gc, int domid, char *id) > libxl_key_value_list args = NULL; > int rc = 0; > > - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); > + qmp = libxl__qmp_initialize(gc, domid); > if (!qmp) > return ERROR_FAIL; > > @@ -850,7 +847,7 @@ int libxl__qmp_migrate(libxl__gc *gc, int domid, int fd) > libxl_key_value_list args = NULL; > int rc = 0; > > - qmp = libxl__qmp_initialize(libxl__gc_owner(gc), domid); > + qmp = libxl__qmp_initialize(gc, domid); > if (!qmp) > return ERROR_FAIL; > > @@ -880,12 +877,12 @@ out: > return rc; > } > > -int libxl__qmp_initializations(libxl_ctx *ctx, uint32_t domid) > +int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid) > { > libxl__qmp_handler *qmp = NULL; > int ret = 0; > > - qmp = libxl__qmp_initialize(ctx, domid); > + qmp = libxl__qmp_initialize(gc, domid); > if (!qmp) > return -1; > ret = libxl__qmp_query_serial(qmp);
Ian Campbell
2012-Feb-09 14:15 UTC
Re: [PATCH V2 2/3] Provide dm_vnc() as a in libxl helper.
On Thu, 2012-02-09 at 14:06 +0000, Anthony PERARD wrote:> Just to use this function in more than one file.c. > > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>> --- > tools/libxl/libxl_dm.c | 8 ++++---- > tools/libxl/libxl_internal.h | 2 ++ > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 5fec137..3422ec0 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -73,7 +73,7 @@ static const char *libxl__domain_bios(libxl__gc *gc, > } > } > > -static const libxl_vnc_info *dm_vnc(const libxl_domain_config *guest_config) > +const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config) > { > const libxl_vnc_info *vnc = NULL; > if (guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) { > @@ -113,7 +113,7 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, > const libxl_domain_create_info *c_info = &guest_config->c_info; > const libxl_domain_build_info *b_info = &guest_config->b_info; > const libxl_device_nic *vifs = guest_config->vifs; > - const libxl_vnc_info *vnc = dm_vnc(guest_config); > + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); > const libxl_sdl_info *sdl = dm_sdl(guest_config); > const int num_vifs = guest_config->num_vifs; > const char *keymap = dm_keymap(guest_config); > @@ -328,7 +328,7 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, > const libxl_device_nic *vifs = guest_config->vifs; > const int num_disks = guest_config->num_disks; > const int num_vifs = guest_config->num_vifs; > - const libxl_vnc_info *vnc = dm_vnc(guest_config); > + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); > const libxl_sdl_info *sdl = dm_sdl(guest_config); > const char *keymap = dm_keymap(guest_config); > flexarray_t *dm_args; > @@ -889,7 +889,7 @@ int libxl__create_device_model(libxl__gc *gc, > libxl_ctx *ctx = libxl__gc_owner(gc); > const libxl_domain_create_info *c_info = &guest_config->c_info; > const libxl_domain_build_info *b_info = &guest_config->b_info; > - const libxl_vnc_info *vnc = dm_vnc(guest_config); > + const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config); > char *path, *logfile; > int logfile_w, null; > int rc; > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 972c818..957eca2 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -899,6 +899,8 @@ _hidden int libxl__wait_for_device_model(libxl__gc *gc, > > _hidden int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid); > > +_hidden const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *g_cfg); > + > _hidden char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path); > > #define LIBXL__LOG_DEBUG XTL_DEBUG
On Thu, 2012-02-09 at 14:06 +0000, Anthony PERARD wrote:> This patch provide the code to set the VNC password to QEMU upstream through > VNC. The password is still stored in xenstore but will not be used by QEMU > upstream. > > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com>
Anthony PERARD writes ("[Xen-devel] [PATCH V2 0/3] Set VNC password to QEMU upstream"):> Anthony PERARD (3): > libxl_qmp: Use GC instead of CTX as parameter for _initialize. > Provide dm_vnc() as a in libxl helper. > libxl: Set VNC password through QMPCommitted-by: Ian Jackson <ian.jackson@eu.citrix.com>