From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: wei.liu2@citrix.com, wency@cn.fujitsu.com,
	andrew.cooper3@citrix.com, yunhong.jiang@intel.com,
	eddie.dong@intel.com, xen-devel@lists.xen.org,
	guijianfeng@cn.fujitsu.com, rshriram@cs.ubc.ca,
	ian.jackson@eu.citrix.com
Subject: Re: [PATCH v3 COLOPre 12/26] tools/libxl: Update libxl_domain_unpause() to support qemu-xen
Date: Wed, 1 Jul 2015 10:10:13 +0800	[thread overview]
Message-ID: <55934C05.5000806@cn.fujitsu.com> (raw)
In-Reply-To: <1435658447.21469.63.camel@citrix.com>
On 06/30/2015 06:00 PM, Ian Campbell wrote:
> On Thu, 2015-06-25 at 14:25 +0800, Yang Hongyang wrote:
>> Currently, libxl__domain_unpause() only supports
>> qemu-xen-traditional. Update it to support qemu-xen.
>> We use libxl__domain_resume_device_model to unpause guest dm.
>
> There appears to be at least two significant semantic changes to the
> libxl__domain_resume_device_model function (namely it now deals
> internally with stubdom and checks the current status before doing
> anything). What is the impact on the existing callers of those changes?
This change was suggested by Wei on last round(v2), he thought it is an
enhancement to the existing callers.
>
> I think those changes should be two separate preparatory patches.
>
>
>>
>> Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
>> ---
>>   tools/libxl/libxl.c             | 15 +++++----------
>>   tools/libxl/libxl_dom_suspend.c | 15 ++++++++++++---
>>   tools/libxl/libxl_internal.h    |  1 +
>>   3 files changed, 18 insertions(+), 13 deletions(-)
>>
>> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
>> index 2ca59ea..59e2dfe 100644
>> --- a/tools/libxl/libxl.c
>> +++ b/tools/libxl/libxl.c
>> @@ -938,8 +938,6 @@ out:
>>   int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
>>   {
>>       GC_INIT(ctx);
>> -    char *path;
>> -    char *state;
>>       int ret, rc = 0;
>>
>>       libxl_domain_type type = libxl__domain_type(gc, domid);
>> @@ -949,14 +947,11 @@ int libxl_domain_unpause(libxl_ctx *ctx, uint32_t domid)
>>       }
>>
>>       if (type == LIBXL_DOMAIN_TYPE_HVM) {
>> -        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");
>> -            libxl__wait_for_device_model_deprecated(gc, domid, "running",
>> -                                         NULL, NULL, NULL);
>> +        rc = libxl__domain_resume_device_model(gc, domid);
>> +        if (rc < 0) {
>> +            LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "failed to unpause device model "
>> +                       "for domain %u:%d", domid, rc);
>> +            goto out;
>>           }
>>       }
>>       ret = xc_domain_unpause(ctx->xch, domid);
>> diff --git a/tools/libxl/libxl_dom_suspend.c b/tools/libxl/libxl_dom_suspend.c
>> index 1c486c4..3edbd2e 100644
>> --- a/tools/libxl/libxl_dom_suspend.c
>> +++ b/tools/libxl/libxl_dom_suspend.c
>> @@ -376,13 +376,22 @@ static void domain_suspend_callback_common_done(libxl__egc *egc,
>>
>>   /*======================= Domain resume ========================*/
>>
>> -static int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid)
>> +int libxl__domain_resume_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: {
>> -        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");
>> +            libxl__wait_for_device_model_deprecated(gc, domid, "running",
>> +                                                    NULL, NULL, NULL);
>> +        }
>>           break;
>>       }
>>       case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
>> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
>> index 0adc9b4..6960280 100644
>> --- a/tools/libxl/libxl_internal.h
>> +++ b/tools/libxl/libxl_internal.h
>> @@ -3326,6 +3326,7 @@ static inline bool libxl__save_helper_inuse(const libxl__save_helper_state *shs)
>>   /* Each time the dm needs to be saved, we must call suspend and then save */
>>   _hidden int libxl__domain_suspend_device_model(libxl__gc *gc,
>>                                              libxl__domain_suspend_state *dsps);
>> +_hidden int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid);
>>   _hidden void libxl__domain_save_device_model(libxl__egc *egc,
>>                                        libxl__domain_save_state *dss,
>>                                        libxl__save_device_model_cb *callback);
>
>
> .
>
-- 
Thanks,
Yang.
next prev parent reply	other threads:[~2015-07-01  2:10 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25  6:25 [PATCH v3 COLOPre 00/26] Prerequisite patches for COLO Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 01/26] tools/libxl: rename libxl__domain_suspend to libxl__domain_save Yang Hongyang
2015-06-29 15:43   ` Ian Campbell
2015-06-30  9:32     ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 02/26] tools/libxl: move domain suspend code into libxl_dom_suspend.c Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 03/26] tools/libxl: move domain resume " Yang Hongyang
2015-06-29 15:44   ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 04/26] tools/libxl: move remus code into libxl_remus.c Yang Hongyang
2015-06-29 15:48   ` Ian Campbell
2015-06-30  9:36     ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 05/26] tools/libxl: move save/restore code into libxl_dom_save.c Yang Hongyang
2015-06-29 15:49   ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 06/26] libxl/save: Refactor libxl__domain_suspend_state Yang Hongyang
2015-06-29 16:01   ` Ian Campbell
2015-06-30  9:43     ` Yang Hongyang
2015-06-30  9:50       ` Ian Campbell
2015-06-30 10:05         ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 07/26] libxc/restore: fix error handle of process_record Yang Hongyang
2015-06-29 16:07   ` Ian Campbell
2015-06-30  9:45     ` Yang Hongyang
2015-07-03  3:12       ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 08/26] tools/libxc: support to resume uncooperative HVM guests Yang Hongyang
2015-06-29 16:27   ` Ian Campbell
2015-06-30 10:08     ` Wen Congyang
2015-06-30 10:59       ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 09/26] tools/libxl: introduce enum type libxl_checkpointed_stream Yang Hongyang
2015-06-29 16:30   ` Ian Campbell
2015-06-30  9:53     ` Yang Hongyang
2015-06-30 10:52       ` Ian Campbell
2015-07-01  2:05         ` Yang Hongyang
2015-07-01 10:36           ` Ian Campbell
2015-07-01 13:43             ` Yang Hongyang
2015-07-01 14:09               ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 10/26] migration/save: pass checkpointed_stream from libxl to libxc Yang Hongyang
2015-06-29 16:33   ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 11/26] tools/libxl: introduce a new API libxl__domain_restore() to load qemu state Yang Hongyang
2015-06-29 16:38   ` Ian Campbell
2015-06-30 10:04     ` Yang Hongyang
2015-06-30 10:54       ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 12/26] tools/libxl: Update libxl_domain_unpause() to support qemu-xen Yang Hongyang
2015-06-30 10:00   ` Ian Campbell
2015-07-01  2:10     ` Yang Hongyang [this message]
2015-07-01 10:38       ` Ian Campbell
2015-07-01 13:38         ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 13/26] tools/libxl: introduce libxl__domain_common_switch_qemu_logdirty() Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 14/26] tools/libxl: export logdirty_init Yang Hongyang
2015-06-30 10:01   ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 15/26] tools/libxl: Add back channel to allow migration target send data back Yang Hongyang
2015-06-30 10:07   ` Ian Campbell
2015-07-01  2:28     ` Yang Hongyang
2015-07-01 10:40       ` Ian Campbell
2015-07-01 13:46         ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 16/26] tools/libx{l, c}: add back channel to libxc Yang Hongyang
2015-06-30 10:10   ` Ian Campbell
2015-07-01  2:38     ` Yang Hongyang
2015-07-01 10:42       ` Ian Campbell
2015-07-01 11:01         ` Andrew Cooper
2015-07-01 11:21           ` Ian Campbell
2015-07-01 12:07             ` Ian Jackson
2015-07-01 13:56               ` Yang Hongyang
2015-07-01 13:58                 ` Ian Jackson
2015-07-01 14:21               ` Ian Campbell
2015-07-01 13:54           ` Yang Hongyang
2015-07-01 14:03             ` Andrew Cooper
2015-06-30 10:17   ` Ian Campbell
2015-07-01  2:40     ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 17/26] tools/libx{l, c}: introduce should_checkpoint callback Yang Hongyang
2015-06-30 10:19   ` Ian Campbell
2015-07-01  2:43     ` Yang Hongyang
2015-07-01 10:43       ` Ian Campbell
2015-07-01 13:58         ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 18/26] tools/libx{l, c}: add postcopy/suspend callback to restore side Yang Hongyang
2015-06-30 10:21   ` Ian Campbell
2015-07-01  2:48     ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 19/26] libxc/migration: Specification update for DIRTY_BITMAP records Yang Hongyang
2015-06-30 10:24   ` Ian Campbell
2015-07-01  3:07     ` Yang Hongyang
2015-07-01 10:16       ` Andrew Cooper
2015-07-01 10:27         ` Ian Campbell
2015-07-01 10:39           ` Andrew Cooper
2015-07-01 11:00             ` Ian Campbell
2015-07-03 14:25               ` Andrew Cooper
2015-07-03 14:41                 ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 20/26] libxc/migration: export read_record for common use Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 21/26] tools/libxl: refactor write stream to support back channel Yang Hongyang
2015-06-30 10:28   ` Ian Campbell
2015-07-01  5:33     ` Wen Congyang
2015-07-01 10:45       ` Ian Campbell
2015-07-01 11:09         ` Wen Congyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 22/26] tools/libxl: refactor read " Yang Hongyang
2015-06-30 10:39   ` Ian Campbell
2015-06-25  6:25 ` [PATCH v3 COLOPre 23/26] docs/libxl: Introduce COLO_CONTEXT to support migration v2 colo streams Yang Hongyang
2015-06-30 10:42   ` Ian Campbell
2015-07-01  3:10     ` Yang Hongyang
2015-07-01 10:44       ` Ian Campbell
2015-07-01 14:05         ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 24/26] tools/libxl: rename remus device to checkpoint device Yang Hongyang
2015-06-30 10:43   ` Ian Campbell
2015-07-01  3:11     ` Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 25/26] tools/libxl: adjust the indentation Yang Hongyang
2015-06-25  6:25 ` [PATCH v3 COLOPre 26/26] tools/libxl: don't touch remus in checkpoint_device Yang Hongyang
2015-06-30 10:50   ` Ian Campbell
2015-07-01  3:11     ` Yang Hongyang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=55934C05.5000806@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=eddie.dong@intel.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wei.liu2@citrix.com \
    --cc=wency@cn.fujitsu.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yunhong.jiang@intel.com \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).