[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 --for 4.6 COLOPre 15/25] tools/libxl: check QEMU state before resume dm
On Wed, 2015-07-15 at 15:45 +0800, Yang Hongyang wrote: > check QEMU state before resume dm on QEMU_XEN_TRADITIONAL. > > Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx> > CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx> > CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> > CC: Wei Liu <wei.liu2@xxxxxxxxxx> > --- > tools/libxl/libxl_dom_suspend.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c > index 6f04c26..686a49b 100644 > --- a/tools/libxl/libxl_dom_suspend.c > +++ b/tools/libxl/libxl_dom_suspend.c > @@ -434,11 +434,20 @@ static void > domain_suspend_callback_common_done(libxl__egc *egc, > > int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid) > { > + char *path; > + char *state; Can both be const. Could also be on one line, but that is is a matter of taste so up to you. > switch (libxl__device_model_version_running(gc, domid)) { > case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: { > - libxl__qemu_traditional_cmd(gc, domid, "continue"); > - libxl__wait_for_device_model_deprecated(gc, domid, "running", NULL, > NULL, NULL); > + uint32_t dm_domid = libxl_get_stubdom_id(CTX, domid); > + > + path = libxl__device_model_xs_path(gc, dm_domid, domid, "/state"); > + state = libxl__xs_read(gc, XBT_NULL, path); > + if (state != NULL && !strcmp(state, "paused")) { > + libxl__qemu_traditional_cmd(gc, domid, "continue"); Please can you explain the apparent discrepancy between the use of dm_domid and domid here? > + libxl__wait_for_device_model_deprecated(gc, domid, "running", > + NULL, NULL, NULL); > + } > break; > } > case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |