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

Re: [Xen-devel] [RFC PATCH COLO v5 06/29] Update libxl__domain_unpause() to support qemu-xen



On Wed, Apr 01, 2015 at 02:41:42PM +0800, Yang Hongyang wrote:
> From: Wen Congyang <wency@xxxxxxxxxxxxxx>
> 
> Currently, libxl__domain_unpause() only supports
> qemu-xen-traditional. Update it to support qemu-xen.
> 
> Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx>
> ---
>  tools/libxl/libxl.c          | 13 +++++--------
>  tools/libxl/libxl_dom.c      | 25 +++++++++++++++++++++++++
>  tools/libxl/libxl_internal.h |  2 ++
>  3 files changed, 32 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index c3898ce..58629ed 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1039,8 +1039,6 @@ out:
>  
>  int libxl__domain_unpause(libxl__gc *gc, uint32_t domid)
>  {
> -    char *path;
> -    char *state;
>      int ret, rc = 0;
>  
>      libxl_domain_type type = libxl__domain_type(gc, domid);
> @@ -1050,12 +1048,11 @@ int libxl__domain_unpause(libxl__gc *gc, uint32_t 
> domid)
>      }
>  
>      if (type == LIBXL_DOMAIN_TYPE_HVM) {
> -        path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/state", 
> domid);
> -        state = libxl__xs_read(gc, XBT_NULL, path);
> -        if (state != NULL && !strcmp(state, "paused")) {
> -            libxl__qemu_traditional_cmd(gc, domid, "continue");
> -            libxl__wait_for_device_model_deprecated(gc, domid, "running",
> -                                         NULL, NULL, NULL);
> +        rc = libxl__domain_unpause_device_model(gc, domid);
> +        if (rc < 0) {
> +            LOG(ERROR, "failed to unpause device model for domain %u:%d",
> +                domid, rc);
> +            goto out;

You need to rebase. This hunk is changed in staging.

>          }
>      }
>  
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index eb4ed94..a3fce46 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -2272,6 +2272,31 @@ static void remus_teardown_done(libxl__egc *egc,
>      dss->callback(egc, dss, rc);
>  }
>  
> +int libxl__domain_unpause_device_model(libxl__gc *gc, uint32_t domid)
> +{
> +    char *path;
> +    char *state;
> +
> +    switch (libxl__device_model_version_running(gc, domid)) {
> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
> +        path = libxl__sprintf(gc, "/local/domain/0/device-model/%d/state", 
> domid);
> +        state = libxl__xs_read(gc, XBT_NULL, path);
> +        if (state != NULL && !strcmp(state, "paused")) {
> +            libxl__qemu_traditional_cmd(gc, domid, "continue");
> +            libxl__wait_for_device_model_deprecated(gc, domid, "running",
> +                                         NULL, NULL, NULL);
> +        }

This needs to use the snippet in upstream. That snippet copes with
device model running inside a stubdom.

> +    case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
> +        if (libxl__qmp_resume(gc, domid))
> +            return ERROR_FAIL;
> +        break;

Could you add a check here to make sure device model is not running
inside a stubdom?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.