All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: Wei Liu <wei.liu2@citrix.com>, Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: ian.campbell@citrix.com, ian.jackson@eu.citrix.com,
	yunhong.jiang@intel.com, eddie.dong@intel.com,
	xen-devel@lists.xen.org, rshriram@cs.ubc.ca
Subject: Re: [RFC PATCH COLO v5 02/29] Refactor domain_suspend_callback_common()
Date: Tue, 14 Apr 2015 13:56:05 +0800	[thread overview]
Message-ID: <552CABF5.9000105@cn.fujitsu.com> (raw)
In-Reply-To: <20150408181129.GQ30811@zion.uk.xensource.com>

On 04/09/2015 02:11 AM, Wei Liu wrote:
> On Wed, Apr 01, 2015 at 02:41:38PM +0800, Yang Hongyang wrote:
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> libxl__domain_suspend() is to save the guest. I think
>> we should call it libxl__domain_save(), but I don't
>> rename it.
>>
> 
> FWIW this is not public API so we have certain degree of liberty to
> rename it if the new name is deemed more appropriate.

OK

> 
>> Secondary vm is running in colo mode. So we will do
>> the following things again and again:
>> 1. suspend both primay vm and secondary vm
>> 2. sync the state
>> 3. resume both primary vm and secondary vm
>> To suspend secondary vm, we need an independent API to
>> suspend vm.
>>
> [...]
>>  
>> +/*
>> + * libxl__domain_suspend_state is for saving guest, not
>> + * for suspending guest. We need to an independent API
>> + * to suspend guest only.
>> + */
>> +struct libxl__domain_suspend_state2 {
>> +    /* set by caller of libxl__domain_suspend2 */
>> +    libxl__ao *ao;
>> +
>> +    uint32_t domid;
>> +    libxl__ev_evtchn guest_evtchn;;
>> +    int guest_evtchn_lockfd;
>> +    int hvm;
>> +    const char *dm_savefile;
>> +    void (*callback_common_done)(libxl__egc*,
>> +                                 libxl__domain_suspend_state2*, int ok);
>> +    int save_dm;
>> +    int guest_responded;
>> +    libxl__xswait_state pvcontrol;
>> +    libxl__ev_xswatch guest_watch;
>> +    libxl__ev_time guest_timeout;
>> +};
>> +
>>  struct libxl__domain_suspend_state {
>>      /* set by caller of libxl__domain_suspend */
>>      libxl__ao *ao;
>> @@ -2827,22 +2851,14 @@ struct libxl__domain_suspend_state {
>>      int debug;
>>      const libxl_domain_remus_info *remus;
>>      /* private */
>> -    libxl__ev_evtchn guest_evtchn;
>> -    int guest_evtchn_lockfd;
>> +    libxl__domain_suspend_state2 dss2;
>>      int hvm;
>>      int xcflags;
>> -    int guest_responded;
>> -    libxl__xswait_state pvcontrol;
>> -    libxl__ev_xswatch guest_watch;
>> -    libxl__ev_time guest_timeout;
>> -    const char *dm_savefile;
>>      libxl__remus_devices_state rds;
>>      libxl__ev_time checkpoint_timeout; /* used for Remus checkpoint */
>>      int interval; /* checkpoint interval (for Remus) */
>>      libxl__save_helper_state shs;
>>      libxl__logdirty_switch logdirty;
>> -    void (*callback_common_done)(libxl__egc*,
>> -                                 struct libxl__domain_suspend_state*, int ok);
>>      /* private for libxl__domain_save_device_model */
>>      libxl__save_device_model_cb *save_dm_callback;
>>      libxl__datacopier_state save_dm_datacopier;
> 
> You moved dm_savefile to new struct but not these two fields, why?
> Since your suspend2 function is just a wrapper around
> domain_suspend_callback_common, it doesn't seem to need access to
> dm_savefile.

Hmm, there are two operations:
1. save qemu state to dm_savefile
2. transfer qemu state to dm_savefile

The function libxl__domain_suspend_device_model() does operation 1, and
the function libxl__domain_save_device_model() does operation 2.

The function libxl__domain_suspend_device_model() is called when we suspend
the guest, and it only uses the filed dm_savefile.

I think we should split it out: save qemu state to dm_savefile if the caller
needs to do it.

Thanks
Wen Congyang

> 
> Wei.
> 
>> @@ -3116,6 +3132,9 @@ struct libxl__domain_create_state {
>>  
>>  /*----- Domain suspend (save) functions -----*/
>>  
>> +/* calls dss2->callback_common_done when done */
>> +_hidden void libxl__domain_suspend2(libxl__egc *egc,
>> +                                    libxl__domain_suspend_state2 *dss2);
>>  /* calls dss->callback when done */
>>  _hidden void libxl__domain_suspend(libxl__egc *egc,
>>                                     libxl__domain_suspend_state *dss);
>> @@ -3155,7 +3174,7 @@ _hidden void libxl__xc_domain_restore_done(libxl__egc *egc, void *dcs_void,
>>  
>>  /* 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 *dss);
>> +                                           libxl__domain_suspend_state2 *dss2);
>>  _hidden void libxl__domain_save_device_model(libxl__egc *egc,
>>                                       libxl__domain_suspend_state *dss,
>>                                       libxl__save_device_model_cb *callback);
>> -- 
>> 1.9.1
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
> .
> 

  reply	other threads:[~2015-04-14  5:56 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  6:41 [RFC PATCH COLO v5 00/29] COarse-grain LOck-stepping Virtual Machines for Non-stop Service Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 01/29] Add readme Yang Hongyang
2015-04-08 18:11   ` Wei Liu
2015-04-14  4:06     ` Hongyang Yang
2015-04-01  6:41 ` [RFC PATCH COLO v5 02/29] Refactor domain_suspend_callback_common() Yang Hongyang
2015-04-08 18:11   ` Wei Liu
2015-04-14  5:56     ` Wen Congyang [this message]
2015-04-22 14:45   ` Ian Campbell
2015-04-01  6:41 ` [RFC PATCH COLO v5 03/29] tools: libxl: introduce a new API libxl__domain_restore() to read qemu state Yang Hongyang
2015-04-08 18:11   ` Wei Liu
2015-04-15 13:19     ` Ian Jackson
2015-04-01  6:41 ` [RFC PATCH COLO v5 04/29] Update libxl__domain_suspend_common_switch_qemu_logdirty() for colo Yang Hongyang
2015-04-08 18:12   ` Wei Liu
2015-04-01  6:41 ` [RFC PATCH COLO v5 05/29] Introduce a new internal API libxl__domain_unpause() Yang Hongyang
2015-04-08 18:12   ` Wei Liu
2015-04-01  6:41 ` [RFC PATCH COLO v5 06/29] Update libxl__domain_unpause() to support qemu-xen Yang Hongyang
2015-04-08 18:12   ` Wei Liu
2015-04-01  6:41 ` [RFC PATCH COLO v5 07/29] support to resume uncooperative HVM guests Yang Hongyang
2015-04-08 18:12   ` Wei Liu
2015-04-23 12:09     ` Wen Congyang
2015-04-22 14:54   ` Ian Campbell
2015-04-23 12:08     ` Wen Congyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 08/29] tools/libxl: Introduce bitops macros Yang Hongyang
2015-04-22 15:10   ` Ian Campbell
2015-04-23 11:56     ` Wen Congyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 09/29] move remus related codes to libxl_remus.c Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 10/29] rename remus device to checkpoint device Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 11/29] adjust the indentation Yang Hongyang
2015-04-22 15:20   ` Ian Campbell
2015-04-01  6:41 ` [RFC PATCH COLO v5 12/29] don't touch remus in checkpoint_device Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 13/29] Update libxl_save_msgs_gen.pl to support return data from xl to xc Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 14/29] Allow slave sends data to master Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 15/29] secondary vm suspend/resume/checkpoint code Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 16/29] primary vm suspend/get_dirty_pfn/resume/checkpoint code Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 17/29] xc_domain_save: flush cache before calling callbacks->postcopy() in colo mode Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 18/29] COLO: xc related codes Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 19/29] send store mfn and console mfn to xl before resuming secondary vm Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 20/29] implement the cmdline for COLO Yang Hongyang
2015-04-01  6:41 ` [RFC PATCH COLO v5 21/29] tools: xc_doamin_restore: zero ioreq page only one time Yang Hongyang
2015-04-01  6:55 ` [RFC PATCH COLO v5 22/29] Support colo mode for qemu disk Yang Hongyang
2015-04-01  6:57 ` [RFC PATCH COLO v5 23/29] COLO: use qemu block replication Yang Hongyang
2015-04-01  6:57 ` [RFC PATCH COLO v5 24/29] COLO proxy: implement setup/teardown of COLO proxy module Yang Hongyang
2015-04-01  6:57 ` [RFC PATCH COLO v5 25/29] COLO proxy: preresume, postresume and checkpoint Yang Hongyang
2015-04-01  6:57 ` [RFC PATCH COLO v5 26/29] COLO nic: implement COLO nic subkind Yang Hongyang
2015-04-01  6:58 ` [RFC PATCH COLO v5 27/29] setup and control colo proxy on primary side Yang Hongyang
2015-04-01  6:58 ` [RFC PATCH COLO v5 28/29] setup and control colo proxy on secondary side Yang Hongyang
2015-04-01  6:58 ` [RFC PATCH COLO v5 29/29] cmdline switches and config vars to control colo-proxy 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=552CABF5.9000105@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=eddie.dong@intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yanghy@cn.fujitsu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.