diff mbox

[v11,13/27] tools/libx{l, c}: add postcopy/suspend callback to restore side

Message ID 1457080891-26054-14-git-send-email-xiecl.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Changlong Xie March 4, 2016, 8:41 a.m. UTC
From: Wen Congyang <wency@cn.fujitsu.com>

Secondary(restore side) is running under COLO, we also need
postcopy/suspend callbacks.

Signed-off-by: Yang Hongyang <hongyang.yang@easystack.cn>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
---
 tools/libxc/include/xenguest.h     | 10 ++++++++++
 tools/libxl/libxl_save_msgs_gen.pl |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)

Comments

Ian Jackson March 4, 2016, 5:05 p.m. UTC | #1
Changlong Xie writes ("[PATCH v11 13/27] tools/libx{l,c}: add postcopy/suspend callback to restore side"):
> From: Wen Congyang <wency@cn.fujitsu.com>
> 
> Secondary(restore side) is running under COLO, we also need
> postcopy/suspend callbacks.

This patch does not provide an implementation of any of these
callbacks, nor a call site.

I think you need to mention that in the commit message.  You should
also explain what would currently happen in libxl if these callbacks
were to be called.

Ian.
Changlong Xie March 17, 2016, 8:17 a.m. UTC | #2
On 03/05/2016 01:05 AM, Ian Jackson wrote:
> Changlong Xie writes ("[PATCH v11 13/27] tools/libx{l,c}: add postcopy/suspend callback to restore side"):
>> From: Wen Congyang <wency@cn.fujitsu.com>
>>
>> Secondary(restore side) is running under COLO, we also need
>> postcopy/suspend callbacks.
>
> This patch does not provide an implementation of any of these
> callbacks, nor a call site.
>
> I think you need to mention that in the commit message.  You should
> also explain what would currently happen in libxl if these callbacks
> were to be called.

I will merge it in the implement patch in next version

Thanks
	-Xie
>
> Ian.
>
>
> .
>
diff mbox

Patch

diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h
index f598bec..cb0bbcf 100644
--- a/tools/libxc/include/xenguest.h
+++ b/tools/libxc/include/xenguest.h
@@ -101,6 +101,16 @@  int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
+    /* Called after a new checkpoint to suspend the guest.
+     */
+    int (*suspend)(void* data);
+
+    /* Called after the secondary vm is ready to resume.
+     * Callback function resumes the guest & the device model,
+     * returns to xc_domain_restore.
+     */
+    int (*postcopy)(void* data);
+
     /* A checkpoint record has been found in the stream.
      * returns: */
 #define XGR_CHECKPOINT_ERROR    0 /* Terminate processing */
diff --git a/tools/libxl/libxl_save_msgs_gen.pl b/tools/libxl/libxl_save_msgs_gen.pl
index 51d004d..6016706 100755
--- a/tools/libxl/libxl_save_msgs_gen.pl
+++ b/tools/libxl/libxl_save_msgs_gen.pl
@@ -23,8 +23,8 @@  our @msgs = (
                                                  STRING doing_what),
                                                 'unsigned long', 'done',
                                                 'unsigned long', 'total'] ],
-    [  3, 'scxA',   "suspend", [] ],
-    [  4, 'scxA',   "postcopy", [] ],
+    [  3, 'srcxA',  "suspend", [] ],
+    [  4, 'srcxA',  "postcopy", [] ],
     [  5, 'srcxA',  "checkpoint", [] ],
     [  6, 'srcxA',  "wait_checkpoint", [] ],
     [  7, 'scxA',   "switch_qemu_logdirty",  [qw(int domid