Skip to contentSkip to conversation

Prune legacy migration and move migration v2 out of daft status

PATCH In review Andrew Cooper 4 participants 25 messages Jul 20, 2015 – Jul 28, 2015

lore
Share & tools
lore
#0 lore raw

cover Prune legacy migration and move migration v2 out of daft status

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

There are no major changes in this series, but are important changes for the status of migration v2 in Xen 4.6

Andrew Cooper (6):
tools/libxc: Remove legacy migration implementation tools/libx{l,c}: Remove the toolstack_{save,restore} callbacks tools/libx{l,c}: Remove XC_DEVICE_MODEL_RESTORE_FILE tools/libx{l,c}: Drop '2' suffixes from xc_domain_{save,restore}2() functions
docs: Migration v2 is now no longer draft
tools/libx{l,c}: Fix trivial Coverity defects in migration v2 code

 docs/specs/libxc-migration-stream.pandoc |   19 +-
 docs/specs/libxl-migration-stream.pandoc |   19 +-
 tools/libxc/Makefile                     |    1 -
 tools/libxc/include/xenguest.h           |   34 -
 tools/libxc/xc_domain_restore.c          | 2411 ------------------------------
 tools/libxc/xc_domain_save.c             | 2198 ---------------------------
 tools/libxc/xc_nomigrate.c               |   20 -
 tools/libxc/xc_offline_page.c            |   59 +
 tools/libxc/xc_sr_restore.c              |   15 +-
 tools/libxc/xc_sr_save.c                 |   17 +-
 tools/libxc/xg_save_restore.h            |  247 ---
 tools/libxl/libxl.c                      |    2 +-
 tools/libxl/libxl_create.c               |    2 +-
 tools/libxl/libxl_internal.h             |    2 +-
 tools/libxl/libxl_save_callout.c         |    2 -
 tools/libxl/libxl_save_helper.c          |    4 +-
 tools/libxl/libxl_stream_read.c          |    4 +-
 17 files changed, 107 insertions(+), 4949 deletions(-)
 delete mode 100644 tools/libxc/xc_domain_restore.c
 delete mode 100644 tools/libxc/xc_domain_save.c
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/6 tools/libxc: Remove legacy migration implementation

It is no longer used.

One complication is that xc_map_m2p() has users in xc_offline_page.c, xen-mfndump and xen-mceinj. Move its implementation into xc_offline_page (for want of a better location) beside it's current user.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>

---

Going forwards, xc_map_m2p() should move into libxc (being host specific rather than guest specific) and gain a slightly more rational API to consolidate several open-coded instances throughout tools/. However, that is very much 4.7 work, given the current timescale on 4.6

---
 tools/libxc/Makefile            |    1 -
 tools/libxc/xc_domain_restore.c | 2411 ---------------------------------------
 tools/libxc/xc_domain_save.c    | 2198 -----------------------------------
 tools/libxc/xc_offline_page.c   |   59 +
 tools/libxc/xg_save_restore.h   |  247 ----
 5 files changed, 59 insertions(+), 4857 deletions(-)
 delete mode 100644 tools/libxc/xc_domain_restore.c
 delete mode 100644 tools/libxc/xc_domain_save.c
tools/libxc/Makefile +0 -1
index 1aec848..a026c4e 100644
@@ -53,7 +53,6 @@ CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 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_common.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86.c
 GUEST_SRCS-$(CONFIG_X86) += xc_sr_common_x86_pv.c
tools/libxc/xc_domain_restore.c deleted +0 -2411

2,411 lines not on this page · raw message

tools/libxc/xc_domain_save.c deleted +0 -2198

582 lines not on this page · raw message

tools/libxc/xc_offline_page.c +59 -0

59 lines not on this page · raw message

tools/libxc/xg_save_restore.h +0 -247

247 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.10.4

Part of the diff is not shown here. View the raw message.

Acked-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] tools/libxc: Remove legacy migration implementation

Quoted 11 lines · Andrew Cooper

It is no longer used.

One complication is that xc_map_m2p() has users in xc_offline_page.c, xen-mfndump and xen-mceinj. Move its implementation into xc_offline_page (for want of a better location) beside it's current user.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>

"git grep xc_domain_restore[^2]" shows a mention (of the filename) in MAINTAINERS which doesn't look to be handled later either.

#3 lore raw

Re: [PATCH 1/6] tools/libxc: Remove legacy migration implementation

Quoted 8 lines · Ian Campbell
Quoted 7 lines · Andrew Cooper

It is no longer used.

One complication is that xc_map_m2p() has users in xc_offline_page.c, xen-mfndump and xen-mceinj. Move its implementation into xc_offline_page (for want of a better location) beside it's current user.

Quoted 9 lines
Quoted 4 lines
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>

"git grep xc_domain_restore[^2]" shows a mention (of the filename) in MAINTAINERS which doesn't look to be handled later either.

Ah yes - I will drop those entries.

~Andrew

#4 lore raw

PATCH 2/6 tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks

In reply to Andrew Cooper

Update the libxc spec to indicate more sternly that TOOLSTACK records should no longer be used.

Also, trim further toolstack infrastructure which should have gone in c/s 39bf4e9 "tools/libxl: Drop all knowledge of toolstack callbacks"

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
---
 docs/specs/libxc-migration-stream.pandoc |   14 ++++++--------
 tools/libxc/include/xenguest.h           |   12 ------------
 tools/libxl/libxl_internal.h             |    1 -
 tools/libxl/libxl_save_callout.c         |    2 --
 4 files changed, 6 insertions(+), 23 deletions(-)
docs/specs/libxc-migration-stream.pandoc +6 -8
index 68fa513..9d8f17b 100644
@@ -219,7 +219,7 @@ type         0x00000000: END
 
              0x0000000A: HVM_PARAMS
 
-             0x0000000B: TOOLSTACK
+             0x0000000B: TOOLSTACK (deprecated)
 
              0x0000000C: X86_PV_VCPU_MSRS
 
@@ -540,17 +540,15 @@ param value      Parameter value.
 
 \clearpage
 
-TOOLSTACK
----------
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes during
+>  development.  It is should not be used.*
 
 An opaque blob provided by and supplied to the higher layers of the
 toolstack (e.g., libxl) during save and restore.
 
-> This is only temporary -- the intention is the toolstack takes care
-> of this itself.  This record is only present for early development
-> purposes and will be removed before submissions, along with changes
-> to libxl which cause libxl to handle this data itself.
-
      0     1     2     3     4     5     6     7 octet
     +------------------------+------------------------+
     | data                                            |
tools/libxc/include/xenguest.h +0 -12
index e95af54..231ec6e 100644
@@ -67,14 +67,6 @@ struct save_callbacks {
     /* Enable qemu-dm logging dirty pages to xen */
     int (*switch_qemu_logdirty)(int domid, unsigned enable, void *data); /* HVM only */
 
-    /* Save toolstack specific data
-     * @param buf the buffer with the data to be saved
-     * @param len the length of the buffer
-     * The callee allocates the buffer, the caller frees it (buffer must
-     * be free'able).
-     */
-    int (*toolstack_save)(uint32_t domid, uint8_t **buf, uint32_t *len, void *data);
-
     /* to be provided as the last argument to each callback function */
     void* data;
 };
@@ -98,10 +90,6 @@ int xc_domain_save2(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_ite
 
 /* callbacks provided by xc_domain_restore */
 struct restore_callbacks {
-    /* callback to restore toolstack specific data */
-    int (*toolstack_restore)(uint32_t domid, const uint8_t *buf,
-            uint32_t size, void* data);
-
     /* A checkpoint record has been found in the stream.
      * returns: */
 #define XGR_CHECKPOINT_ERROR    0 /* Terminate processing */
tools/libxl/libxl_internal.h +0 -1
index 2b6b2a0..4ab564a 100644
@@ -2744,7 +2744,6 @@ _hidden void libxl__datacopier_prefixdata(libxl__egc*, libxl__datacopier_state*,
     libxl__ev_fd readable;
     libxl__ev_child child;
     const char *stdin_what, *stdout_what;
-    FILE *toolstack_data_file;
 
     libxl__egc *egc; /* valid only for duration of each event callback;
                       * is here in this struct for the benefit of the
tools/libxl/libxl_save_callout.c +0 -2
index f2ce868..3af99af 100644
@@ -70,7 +70,6 @@ void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
     shs->completion_callback = libxl__xc_domain_restore_done;
     shs->caller_state = dcs;
     shs->need_results = 1;
-    shs->toolstack_data_file = 0;
 
     run_helper(egc, shs, "--restore-domain", restore_fd, 0, 0,
                argnums, ARRAY_SIZE(argnums));
@@ -333,7 +332,6 @@ static void helper_done(libxl__egc *egc, libxl__save_helper_state *shs)
     libxl__carefd_close(shs->pipes[0]);  shs->pipes[0] = 0;
     libxl__carefd_close(shs->pipes[1]);  shs->pipes[1] = 0;
     assert(!libxl__save_helper_inuse(shs));
-    if (shs->toolstack_data_file) fclose(shs->toolstack_data_file);
 
     shs->egc = egc;
     shs->completion_callback(egc, shs->caller_state,
Signature · 1 line
1.7.10.4
#5 lore raw

Re: [PATCH 2/6] tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks

docs/specs/libxc-migration-stream.pandoc param value Parameter value. · line 546

Quoted 5 lines · Andrew Cooper
docs/specs/libxc-migration-stream.pandoc +4 -0
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes during

"transitionary" isn't really a word... transitional is (even if it sounds a bit odd to me)?

Quoted 1 line

+> development. It is should not be used.*

Does it needs to be accepted on restore for N->N+1 purposes (or N+M for M>1 since you care about that)? Or does the conversion routine turn it into something else?

#6 lore raw

Re: [PATCH 2/6] tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks

Quoted 7 lines · Ian Campbell

docs/specs/libxc-migration-stream.pandoc param value Parameter value. · line 546

Quoted 4 lines · Andrew Cooper
docs/specs/libxc-migration-stream.pandoc +4 -0
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes during

"transitionary" isn't really a word... transitional is (even if it sounds a bit odd to me)?

It very much is.

http://www.oxforddictionaries.com/definition/english/transition

It is an appropriate derivative in this case.

Quoted 5 lines
Quoted 2 lines

+> development. It is should not be used.*

Does it needs to be accepted on restore for N->N+1 purposes (or N+M for M>1 since you care about that)? Or does the conversion routine turn it into something else?

The libxc toolstack record was used in the #LIBXL_HVM_COMPAT phase, but nothing (not even the conversion script) will generate one any more.

~Andrew

#7 lore raw

Re: [PATCH 2/6] tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks

Quoted 10 lines · Andrew Cooper
Quoted 8 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper
docs/specs/libxc-migration-stream.pandoc +4 -0
+TOOLSTACK (deprecated)
+----------------------
+
+> *This record was only present for transitionary purposes 

during

"transitionary" isn't really a word... transitional is (even if it sounds a bit odd to me)?

Quoted 5 lines

It very much is.

http://www.oxforddictionaries.com/definition/english/transition

It is an appropriate derivative in this case.

Fair enough, my spell checker mislead me on this one it seems.

Quoted 10 lines

+> development. It is should not be used.*

Quoted 5 lines

Does it needs to be accepted on restore for N->N+1 purposes (or N+M for
M>1 since you care about that)? Or does the conversion routine turn it
into something else?

The libxc toolstack record was used in the #LIBXL_HVM_COMPAT phase, but
nothing (not even the conversion script) will generate one any more.

Perfect.

#8 lore raw

Re: [PATCH 2/6] tools/libx{l, c}: Remove the toolstack_{save, restore} callbacks

Quoted 8 lines · Ian Campbell
Quoted 8 lines

+> development. It is should not be used.*

Quoted 5 lines

Does it needs to be accepted on restore for N->N+1 purposes (or N+M for
M>1 since you care about that)? Or does the conversion routine turn it
into something else?

Quoted 5 lines
Quoted 3 lines

The libxc toolstack record was used in the #LIBXL_HVM_COMPAT phase, but
nothing (not even the conversion script) will generate one any more.

Perfect.

By which I meant: Acked-by: Ian Campbell <[email protected]>?

#9 lore raw

PATCH 3/6 tools/libx{l, c}: Remove XC_DEVICE_MODEL_RESTORE_FILE

In reply to Andrew Cooper

All handling of device model files is now at the libxl level. Remove XC_DEVICE_MODEL_RESTORE_FILE and introduce LIBXL_DEVICE_MODEL_RESTORE_FILE in its place.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
---
 tools/libxc/include/xenguest.h  |    8 --------
 tools/libxl/libxl.c             |    2 +-
 tools/libxl/libxl_create.c      |    2 +-
 tools/libxl/libxl_internal.h    |    1 +
 tools/libxl/libxl_stream_read.c |    2 +-
 5 files changed, 4 insertions(+), 11 deletions(-)
tools/libxc/include/xenguest.h +0 -8
index 231ec6e..9772576 100644
@@ -135,14 +135,6 @@ int xc_domain_restore2(xc_interface *xch, int io_fd, uint32_t dom,
                        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.
- * The pathname of this file is XC_DEVICE_MODEL_RESTORE_FILE; The domid
- * of the new domain is automatically appended to the filename,
- * separated by a ".".
- */
-#define XC_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume"
 
 /**
  * This function will create a domain for a paravirtualized Linux
tools/libxl/libxl.c +1 -1
index 3fe1b99..c13aa8b 100644
@@ -1695,7 +1695,7 @@ static void devices_destroy_cb(libxl__egc *egc,
     rc = libxl__remove_file(gc, libxl__device_model_savefile(gc, domid));
     if (rc < 0) goto out;
     rc = libxl__remove_file(gc,
-             GCSPRINTF(XC_DEVICE_MODEL_RESTORE_FILE".%u", domid));
+             GCSPRINTF(LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", domid));
     if (rc < 0) goto out;
 
     rc = libxl__ev_child_fork(gc, &dis->destroyer, domain_destroy_domid_cb);
tools/libxl/libxl_create.c +1 -1
index 5b4d333..86d1181 100644
@@ -1083,7 +1083,7 @@ static void domcreate_stream_done(libxl__egc *egc,
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         state->saved_state = GCSPRINTF(
-                       XC_DEVICE_MODEL_RESTORE_FILE".%d", domid);
+                       LIBXL_DEVICE_MODEL_RESTORE_FILE".%d", domid);
     }
 
 out:
tools/libxl/libxl_internal.h +1 -0
index 4ab564a..20f4cde 100644
@@ -90,6 +90,7 @@
 /* QEMU may be slow to load and start due to a bug in Linux where the I/O
  * subsystem sometime produce high latency under load. */
 #define LIBXL_DEVICE_MODEL_START_TIMEOUT 60
+#define LIBXL_DEVICE_MODEL_RESTORE_FILE "/var/lib/xen/qemu-resume" /* .$domid */
 #define LIBXL_STUBDOM_START_TIMEOUT 30
 #define LIBXL_QEMU_BODGE_TIMEOUT 2
 #define LIBXL_XENCONSOLE_LIMIT 1048576
tools/libxl/libxl_stream_read.c +1 -1
index 0535e7f..94247b7 100644
@@ -592,7 +592,7 @@ static void write_emulator_blob(libxl__egc *egc,
     }
     emu_hdr = rec->body;
 
-    sprintf(path, XC_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
+    sprintf(path, LIBXL_DEVICE_MODEL_RESTORE_FILE".%u", dcs->guest_domid);
 
     assert(stream->emu_carefd == NULL);
     libxl__carefd_begin();
Signature · 1 line
1.7.10.4
Acked-by on v1 3/6
#10 lore raw

Re: [PATCH 3/6] tools/libx{l, c}: Remove XC_DEVICE_MODEL_RESTORE_FILE

Quoted 9 lines · Andrew Cooper

All handling of device model files is now at the libxl level. Remove XC_DEVICE_MODEL_RESTORE_FILE and introduce LIBXL_DEVICE_MODEL_RESTORE_FILE in
its place.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
#11 lore raw

PATCH 4/6 tools/libx{l, c}: Drop '2' suffixes from xc_domain_{save, restore}2() functions

In reply to Andrew Cooper

As there is now only the one implementation.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
---
 tools/libxc/include/xenguest.h  |   14 --------------
 tools/libxc/xc_nomigrate.c      |   20 --------------------
 tools/libxc/xc_sr_restore.c     |   14 +++++++-------
 tools/libxc/xc_sr_save.c        |    6 +++---
 tools/libxl/libxl_save_helper.c |    4 ++--
 5 files changed, 12 insertions(+), 46 deletions(-)
tools/libxc/include/xenguest.h +0 -14
index 9772576..f837bde 100644
@@ -83,11 +83,6 @@ 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 {
     /* A checkpoint record has been found in the stream.
@@ -127,15 +122,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
                       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);
-
 /**
  * This function will create a domain for a paravirtualized Linux
  * using file names pointing to kernel and ramdisk
tools/libxc/xc_nomigrate.c +0 -20
index 426aee6..76978a0 100644
@@ -29,14 +29,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
     return -1;
 }
 
-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)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 int xc_domain_restore(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,
@@ -49,18 +41,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     return -1;
 }
 
-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)
-{
-    errno = ENOSYS;
-    return -1;
-}
-
 /*
  * Local variables:
  * mode: C
tools/libxc/xc_sr_restore.c +7 -7
index bf1ee15..ebc8f2f 100644
@@ -714,13 +714,13 @@ static int restore(struct xc_sr_context *ctx)
     return rc;
 }
 
-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_gfn, domid_t console_domid,
-                       unsigned int hvm, unsigned int pae, int superpages,
-                       int checkpointed_stream,
-                       struct restore_callbacks *callbacks)
+int xc_domain_restore(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_gfn, domid_t console_domid,
+                      unsigned int hvm, unsigned int pae, int superpages,
+                      int checkpointed_stream,
+                      struct restore_callbacks *callbacks)
 {
     struct xc_sr_context ctx =
         {
tools/libxc/xc_sr_save.c +3 -3
index d63b783..7b38051 100644
@@ -818,9 +818,9 @@ static int save(struct xc_sr_context *ctx, uint16_t guest_type)
     return rc;
 };
 
-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)
+int xc_domain_save(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)
 {
     xen_pfn_t nr_pfns;
     struct xc_sr_context ctx =
tools/libxl/libxl_save_helper.c +2 -2
index 1622bb7..57ae978 100644
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
         startup("save");
         setup_signals(save_signal_handler);
 
-        r = xc_domain_save2(xch, io_fd, dom, max_iters, max_factor, flags,
+        r = xc_domain_save(xch, io_fd, dom, max_iters, max_factor, flags,
                            &helper_save_callbacks, hvm);
         complete(r);
 
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
         startup("restore");
         setup_signals(SIG_DFL);
 
-        r = xc_domain_restore2(xch, io_fd, dom, store_evtchn, &store_mfn,
+        r = xc_domain_restore(xch, io_fd, dom, store_evtchn, &store_mfn,
                               store_domid, console_evtchn, &console_mfn,
                               console_domid, hvm, pae, superpages,
                               checkpointed,
Signature · 1 line
1.7.10.4
#13 lore raw

PATCH 5/6 docs: Migration v2 is now no longer draft

In reply to Andrew Cooper

Add further instructions to the libxc "Future Extensions" section, and provide such a section for libxl.

In addition, drop the "In experimental __func__" IPRINTF()s from the libxc implementations.

Finally, a correction to libxl's "Not Yet Included" section which should have been amended in c/s 7eaec00 when libxl Remus support was introduced into the protocol.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
---
 docs/specs/libxc-migration-stream.pandoc |    5 ++++-
 docs/specs/libxl-migration-stream.pandoc |   19 ++++++++++++++++---
 tools/libxc/xc_sr_restore.c              |    1 -
 tools/libxc/xc_sr_save.c                 |    1 -
 4 files changed, 20 insertions(+), 6 deletions(-)
docs/specs/libxc-migration-stream.pandoc +4 -1
index 9d8f17b..8cd678f 100644
@@ -1,7 +1,7 @@
 % LibXenCtrl Domain Image Format
 % David Vrabel <<[email protected]>>
   Andrew Cooper <<[email protected]>>
-% Draft G
+% Revision 1
 
 Introduction
 ============
@@ -679,6 +679,9 @@ introduced in Xen 3.0.
 Future Extensions
 =================
 
+All changes to this specification should bump the revision number in
+the title block.
+
 All changes to the image or domain headers require the image version
 to be increased.
 
docs/specs/libxl-migration-stream.pandoc +16 -3
index c24a434..cdec168 100644
@@ -1,6 +1,6 @@
 % LibXenLight Domain Image Format
 % Andrew Cooper <<[email protected]>>
-% Draft B
+% Revision 1
 
 Introduction
 ============
@@ -41,8 +41,6 @@ Not Yet Included
 The following features are not yet fully specified and will be
 included in a future draft.
 
-* Remus
-
 * ARM
 
 
@@ -215,3 +213,18 @@ A checkpoint end record marks the end of a checkpoint in the image.
     +-------------------------------------------------+
 
 The end record contains no fields; its body_length is 0.
+
+
+Future Extensions
+=================
+
+All changes to this specification should bump the revision number in
+the title block.
+
+All changes to the header require the header version to be increased.
+
+The format may be extended by adding additional record types.
+
+Extending an existing record type must be done by adding a new record
+type.  This allows old images with the old record to still be
+restored.
tools/libxc/xc_sr_restore.c +0 -1
index ebc8f2f..df885b6 100644
@@ -740,7 +740,6 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     if ( checkpointed_stream )
         assert(callbacks->checkpoint);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, hvm %u, pae %u, superpages %d"
             ", checkpointed_stream %d", io_fd, dom, hvm, pae,
             superpages, checkpointed_stream);
tools/libxc/xc_sr_save.c +0 -1
index 7b38051..46700a1 100644
@@ -850,7 +850,6 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom,
     if ( ctx.save.checkpointed )
         assert(callbacks->checkpoint && callbacks->postcopy);
 
-    IPRINTF("In experimental %s", __func__);
     DPRINTF("fd %d, dom %u, max_iters %u, max_factor %u, flags %u, hvm %d",
             io_fd, dom, max_iters, max_factor, flags, hvm);
 
Signature · 1 line
1.7.10.4
Acked-by on v1 5/6
#14 lore raw

Re: [PATCH 5/6] docs: Migration v2 is now no longer draft

Quoted 4 lines · Andrew Cooper

Add further instructions to the libxc "Future Extensions" section, and
provide such a section for libxl.

Quoted 8 lines

In addition, drop the "In experimental __func__" IPRINTF()s from the libxc implementations.

Finally, a correction to libxl's "Not Yet Included" section which should have been amended in c/s 7eaec00 when libxl Remus support was introduced into the protocol.

#15 lore raw

PATCH 6/6 tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code

In reply to Andrew Cooper

All of these are UNUSED_VALUE defects where a default vaule is unconditionally overwritten. They are not particularly interesting, bug wise, but keeping these defects at bay helps prevent real bugs going unnoticed in the volume.

No functional change.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Wei Liu <[email protected]>
---
 tools/libxc/xc_sr_save.c        |   10 +++++-----
 tools/libxl/libxl_stream_read.c |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
tools/libxc/xc_sr_save.c +5 -5
index 46700a1..79c389a 100644
@@ -473,7 +473,7 @@ static int send_memory_live(struct xc_sr_context *ctx)
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
     unsigned x;
-    int rc = -1;
+    int rc;
 
     rc = update_progress_string(ctx, &progress_str, 0);
     if ( rc )
@@ -525,7 +525,7 @@ static int suspend_and_send_dirty(struct xc_sr_context *ctx)
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
     char *progress_str = NULL;
-    int rc = -1;
+    int rc;
     DECLARE_HYPERCALL_BUFFER_SHADOW(unsigned long, dirty_bitmap,
                                     &ctx->save.dirty_bitmap_hbuf);
 
@@ -572,7 +572,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
     xc_shadow_op_stats_t stats = { 0, ctx->save.p2m_size };
-    int rc = -1;
+    int rc;
     struct xc_sr_record rec =
     {
         .type = REC_TYPE_VERIFY,
@@ -612,7 +612,7 @@ static int send_memory_verify(struct xc_sr_context *ctx)
  */
 static int send_domain_memory_live(struct xc_sr_context *ctx)
 {
-    int rc = -1;
+    int rc;
 
     rc = enable_logdirty(ctx);
     if ( rc )
@@ -652,7 +652,7 @@ static int send_domain_memory_checkpointed(struct xc_sr_context *ctx)
 static int send_domain_memory_nonlive(struct xc_sr_context *ctx)
 {
     xc_interface *xch = ctx->xch;
-    int rc = -1;
+    int rc;
 
     rc = suspend_domain(ctx);
     if ( rc )
tools/libxl/libxl_stream_read.c +1 -1
index 94247b7..213bdc2 100644
@@ -583,7 +583,7 @@ static void write_emulator_blob(libxl__egc *egc,
     libxl__sr_emulator_hdr *emu_hdr;
     STATE_AO_GC(stream->ao);
     char path[256];
-    int rc = 0, writefd = -1;
+    int rc = 0, writefd;
 
     if (rec->hdr.length < sizeof(*emu_hdr)) {
         rc = ERROR_FAIL;
Signature · 1 line
1.7.10.4
Acked-by on v1 6/6
#16 lore raw

Re: [PATCH 6/6] tools/libx{l, c}: Fix trivial Coverity defects in migration v2 code

Quoted 1 line · Andrew Cooper

All of these are UNUSED_VALUE defects where a default vaule is

"value".

Quoted 3 lines

unconditionally overwritten. They are not particularly interesting, bug wise, but keeping these defects at bay helps prevent real bugs going unnoticed in the volume.

The flip side is that if the code uses the "init everything and goto out on error" idiom then the init might need to be put back if the code changes, hopefully even a regular compiler would spot this though.

Quoted 3 lines

No functional change.

#17 lore raw
In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

The only real risk here is breaking the build, since if it builds it will surely work.

Wei, final call is yours.

Ian.

Quoted 36 lines

There are no major changes in this series, but are important changes for the status of migration v2 in Xen 4.6

Andrew Cooper (6):
tools/libxc: Remove legacy migration implementation tools/libx{l,c}: Remove the toolstack_{save,restore} callbacks tools/libx{l,c}: Remove XC_DEVICE_MODEL_RESTORE_FILE tools/libx{l,c}: Drop '2' suffixes from xc_domain_{save,restore}2()
functions
docs: Migration v2 is now no longer draft tools/libx{l,c}: Fix trivial Coverity defects in migration v2 code

 docs/specs/libxc-migration-stream.pandoc |   19 +-
 docs/specs/libxl-migration-stream.pandoc |   19 +-
 tools/libxc/Makefile                     |    1 -
 tools/libxc/include/xenguest.h           |   34 -
 tools/libxc/xc_domain_restore.c          | 2411 --------------------
----------
 tools/libxc/xc_domain_save.c             | 2198 --------------------
-------
 tools/libxc/xc_nomigrate.c               |   20 -
 tools/libxc/xc_offline_page.c            |   59 +
 tools/libxc/xc_sr_restore.c              |   15 +-
 tools/libxc/xc_sr_save.c                 |   17 +-
 tools/libxc/xg_save_restore.h            |  247 ---
 tools/libxl/libxl.c                      |    2 +-
 tools/libxl/libxl_create.c               |    2 +-
 tools/libxl/libxl_internal.h             |    2 +-
 tools/libxl/libxl_save_callout.c         |    2 -
 tools/libxl/libxl_save_helper.c          |    4 +-
 tools/libxl/libxl_stream_read.c          |    4 +-
 17 files changed, 107 insertions(+), 4949 deletions(-)
 delete mode 100644 tools/libxc/xc_domain_restore.c
 delete mode 100644 tools/libxc/xc_domain_save.c
#18 lore raw
Quoted 12 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

Quoted 5 lines

The only real risk here is breaking the build, since if it builds it will surely work.

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Wei.

Quoted 38 lines

Ian.

Quoted 36 lines

There are no major changes in this series, but are important changes for the status of migration v2 in Xen 4.6

Andrew Cooper (6):
tools/libxc: Remove legacy migration implementation tools/libx{l,c}: Remove the toolstack_{save,restore} callbacks tools/libx{l,c}: Remove XC_DEVICE_MODEL_RESTORE_FILE tools/libx{l,c}: Drop '2' suffixes from xc_domain_{save,restore}2()
functions
docs: Migration v2 is now no longer draft tools/libx{l,c}: Fix trivial Coverity defects in migration v2 code

 docs/specs/libxc-migration-stream.pandoc |   19 +-
 docs/specs/libxl-migration-stream.pandoc |   19 +-
 tools/libxc/Makefile                     |    1 -
 tools/libxc/include/xenguest.h           |   34 -
 tools/libxc/xc_domain_restore.c          | 2411 --------------------
----------
 tools/libxc/xc_domain_save.c             | 2198 --------------------
-------
 tools/libxc/xc_nomigrate.c               |   20 -
 tools/libxc/xc_offline_page.c            |   59 +
 tools/libxc/xc_sr_restore.c              |   15 +-
 tools/libxc/xc_sr_save.c                 |   17 +-
 tools/libxc/xg_save_restore.h            |  247 ---
 tools/libxl/libxl.c                      |    2 +-
 tools/libxl/libxl_create.c               |    2 +-
 tools/libxl/libxl_internal.h             |    2 +-
 tools/libxl/libxl_save_callout.c         |    2 -
 tools/libxl/libxl_save_helper.c          |    4 +-
 tools/libxl/libxl_stream_read.c          |    4 +-
 17 files changed, 107 insertions(+), 4949 deletions(-)
 delete mode 100644 tools/libxc/xc_domain_restore.c
 delete mode 100644 tools/libxc/xc_domain_save.c
#19 lore raw
Quoted 15 lines · Wei Liu
Quoted 14 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

The only real risk here is breaking the build, since if it builds it will surely work.

Quoted 6 lines
Quoted 2 lines

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Wei.

There are no conflicts I am aware of, having rebased this series myself.

I will however put together a v2 series, covering the two comments from review here.

~Andrew

#20 lore raw
Quoted 16 lines · Andrew Cooper
Quoted 15 lines · Wei Liu
Quoted 14 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

The only real risk here is breaking the build, since if it builds it will surely work.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Wei.

There are no conflicts I am aware of, having rebased this series myself.

Do you mean you rebase on top of full series of COLOPre (including those patches that have not been applied)? That's what I'm looking at. Hongyang could still post remaining part of COLOPre within this week.

Wei.

Quoted 4 lines

I will however put together a v2 series, covering the two comments from review here.

~Andrew

#21 lore raw
Quoted 22 lines · Wei Liu
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Wei Liu
Quoted 11 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

Quoted 5 lines

The only real risk here is breaking the build, since if it builds it will surely work.

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Wei.

There are no conflicts I am aware of, having rebased this series myself.

Do you mean you rebase on top of full series of COLOPre (including those patches that have not been applied)? That's what I'm looking at. Hongyang could still post remaining part of COLOPre within this week.

Ah - this series does interfere with that, insofar as the other bits of COLOPre patch the legacy code to maintain the build.

One of us will have to rebase over the other. I am not fussed which way around that is.

~Andrew

#22 lore raw
Quoted 30 lines · Andrew Cooper
Quoted 22 lines · Wei Liu
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Wei Liu
Quoted 11 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

Quoted 5 lines

The only real risk here is breaking the build, since if it builds it will surely work.

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Wei.

There are no conflicts I am aware of, having rebased this series myself.

Do you mean you rebase on top of full series of COLOPre (including those patches that have not been applied)? That's what I'm looking at. Hongyang could still post remaining part of COLOPre within this week.

Quoted 6 lines

Ah - this series does interfere with that, insofar as the other bits of COLOPre patch the legacy code to maintain the build.

One of us will have to rebase over the other. I am not fussed which way around that is.

Then this series needs to wait until the window for applying patches with freeze exception is closed. Those series have priority in this week.

Wei.

Quoted 1 line

~Andrew

#23 lore raw
Quoted 34 lines · Wei Liu
Quoted 33 lines · Andrew Cooper
Quoted 22 lines · Wei Liu
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Wei Liu
Quoted 11 lines · Ian Campbell
Quoted 5 lines · Andrew Cooper

This series is some cleanup following the integration of migration v2 into the codebase. It removes the legacy migration implementation (compatability is provided with the python conversion script), and adjusts the migration v2 docs/implementation to no longer be experimental.

IMHO we should take this for 4.6, there is no point in shipping obsolete/unused code and leaving it there with the xc_domain_save name and the supported thing with a 2 suffix will only tempt people to continue to use or build on it.

Quoted 5 lines

The only real risk here is breaking the build, since if it builds it will surely work.

Wei, final call is yours.

Yes. I agree with you. But please do check this doesn't conflict with COLOPre before applying.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Wei.

There are no conflicts I am aware of, having rebased this series myself.

Do you mean you rebase on top of full series of COLOPre (including those patches that have not been applied)? That's what I'm looking at. Hongyang could still post remaining part of COLOPre within this week.

Ah - this series does interfere with that, insofar as the other bits of COLOPre patch the legacy code to maintain the build.

Quoted 7 lines
Quoted 3 lines

One of us will have to rebase over the other. I am not fussed which way around that is.

Then this series needs to wait until the window for applying patches with freeze exception is closed. Those series have priority in this week.

Thank you Wei, I think I will remove all colo related patches from COLOPre and send a patchset which only do pure refactoring & bug fix. So that the only patch I need to sort out is the 7th.

Quoted 6 lines

Wei.

Quoted 1 line

~Andrew

.

Signature · 2 lines
Thanks,
Yang.
#24 lore raw
In reply to Wei Liu
Quoted 4 lines · Wei Liu

Then this series needs to wait until the window for applying patches with freeze exception is closed. Those series have priority in this week.

I applied, having checked with you on IRC.