[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v9 03/15] tools/libxc: Migration v2 framework
For testing purposes, the environmental variable "XG_MIGRATION_V2" allows the two save/restore codepaths to coexist, and have a runtime switch. Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx> CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> CC: Wei Liu <wei.liu2@xxxxxxxxxx> --- v8: Adjust layout to compile with MiniOS --- tools/libxc/Makefile | 2 ++ tools/libxc/include/xenguest.h | 13 +++++++++++++ tools/libxc/xc_domain_restore.c | 8 ++++++++ tools/libxc/xc_domain_save.c | 6 ++++++ tools/libxc/xc_sr_common.h | 15 +++++++++++++++ tools/libxc/xc_sr_restore.c | 23 +++++++++++++++++++++++ tools/libxc/xc_sr_save.c | 19 +++++++++++++++++++ 7 files changed, 86 insertions(+) create mode 100644 tools/libxc/xc_sr_common.h create mode 100644 tools/libxc/xc_sr_restore.c create mode 100644 tools/libxc/xc_sr_save.c diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 22ba2a1..0c9a7a7 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -53,6 +53,8 @@ GUEST_SRCS-y := GUEST_SRCS-y += xg_private.c xc_suspend.c ifeq ($(CONFIG_MIGRATE),y) GUEST_SRCS-y += xc_domain_restore.c xc_domain_save.c +GUEST_SRCS-y += xc_sr_restore.c +GUEST_SRCS-y += xc_sr_save.c GUEST_SRCS-y += xc_offline_page.c xc_compression.c else GUEST_SRCS-y += xc_nomigrate.c diff --git a/tools/libxc/include/xenguest.h b/tools/libxc/include/xenguest.h index 601b108..8e39075 100644 --- a/tools/libxc/include/xenguest.h +++ b/tools/libxc/include/xenguest.h @@ -90,6 +90,10 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter uint32_t max_factor, uint32_t flags /* XCFLAGS_xxx */, struct save_callbacks* callbacks, int hvm); +/* Domain Save v2 */ +int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters, + uint32_t max_factor, uint32_t flags, + struct save_callbacks* callbacks, int hvm); /* callbacks provided by xc_domain_restore */ struct restore_callbacks { @@ -126,6 +130,15 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, unsigned int hvm, unsigned int pae, int superpages, int checkpointed_stream, struct restore_callbacks *callbacks); + +/* Domain Restore v2 */ +int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom, + unsigned int store_evtchn, unsigned long *store_mfn, + domid_t store_domid, unsigned int console_evtchn, + unsigned long *console_mfn, domid_t console_domid, + unsigned int hvm, unsigned int pae, int superpages, + int checkpointed_stream, + struct restore_callbacks *callbacks); /** * xc_domain_restore writes a file to disk that contains the device * model saved state. diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c index e9c036f..b8a8ef4 100644 --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -1502,6 +1502,14 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, struct restore_ctx *ctx = &_ctx; struct domain_info_context *dinfo = &ctx->dinfo; + if ( getenv("XG_MIGRATION_V2") ) + { + return xc_domain_restore2( + xch, io_fd, dom, store_evtchn, store_mfn, + store_domid, console_evtchn, console_mfn, console_domid, + hvm, pae, superpages, checkpointed_stream, callbacks); + } + DPRINTF("%s: starting restore of new domid %u", __func__, dom); pagebuf_init(&pagebuf); diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c index a71442e..301e770 100644 --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -894,6 +894,12 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter int completed = 0; + if ( getenv("XG_MIGRATION_V2") ) + { + return xc_domain_save2(xch, io_fd, dom, max_iters, + max_factor, flags, callbacks, hvm); + } + DPRINTF("%s: starting save of domid %u", __func__, dom); if ( hvm && !callbacks->switch_qemu_logdirty ) diff --git a/tools/libxc/xc_sr_common.h b/tools/libxc/xc_sr_common.h new file mode 100644 index 0000000..ab7cb46 --- /dev/null +++ b/tools/libxc/xc_sr_common.h @@ -0,0 +1,15 @@ +#ifndef __COMMON__H +#define __COMMON__H + +#include "xg_private.h" + +#endif +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c new file mode 100644 index 0000000..cdebc69 --- /dev/null +++ b/tools/libxc/xc_sr_restore.c @@ -0,0 +1,23 @@ +#include "xc_sr_common.h" + +int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom, + unsigned int store_evtchn, unsigned long *store_mfn, + domid_t store_domid, unsigned int console_evtchn, + unsigned long *console_mfn, domid_t console_domid, + unsigned int hvm, unsigned int pae, int superpages, + int checkpointed_stream, + struct restore_callbacks *callbacks) +{ + IPRINTF("In experimental %s", __func__); + return -1; +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/tools/libxc/xc_sr_save.c b/tools/libxc/xc_sr_save.c new file mode 100644 index 0000000..3c34a6b --- /dev/null +++ b/tools/libxc/xc_sr_save.c @@ -0,0 +1,19 @@ +#include "xc_sr_common.h" + +int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, + uint32_t max_iters, uint32_t max_factor, uint32_t flags, + struct save_callbacks* callbacks, int hvm) +{ + IPRINTF("In experimental %s", __func__); + return -1; +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |