[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC PATCH v3 18/22] Add LU_VERSION and LU_END records to live update stream



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
 xen/common/lu/save.c                  | 13 ++++++++++++-
 xen/include/public/migration_stream.h |  9 +++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/xen/common/lu/save.c b/xen/common/lu/save.c
index c43962c44e..84852da35e 100644
--- a/xen/common/lu/save.c
+++ b/xen/common/lu/save.c
@@ -4,10 +4,17 @@
 #include <xen/lu.h>
 #include <xen/kimage.h>
 #include <xen/sched.h>
+#include <xen/version.h>
+#include <public/migration_stream.h>
 
 int lu_save_global(struct lu_stream *stream)
 {
-    return 0;
+    struct mr_lu_version ver_rec;
+
+    ver_rec.xen_major = xen_major_version();
+    ver_rec.xen_minor = xen_minor_version();
+    return lu_stream_append_record(stream, REC_TYPE_LU_VERSION,
+                                   &ver_rec, sizeof(ver_rec));
 }
 
 
@@ -34,6 +41,10 @@ int lu_save_all(struct kexec_image *image)
         ret = lu_save_domain(&stream, d);
     }
 
+    if (!ret)
+        ret = lu_stream_append_record(&stream, REC_TYPE_END,
+                                      NULL, 0);
+
     if (!ret)
         ret = kimage_add_live_update_data(image,
                           _mfn(virt_to_mfn(stream.pagelist)),
diff --git a/xen/include/public/migration_stream.h 
b/xen/include/public/migration_stream.h
index 92dd119f9f..29ed8cc2b5 100644
--- a/xen/include/public/migration_stream.h
+++ b/xen/include/public/migration_stream.h
@@ -51,6 +51,8 @@ struct mr_rhdr
 #define REC_TYPE_CHECKPOINT                 0x0000000eU
 #define REC_TYPE_CHECKPOINT_DIRTY_PFN_LIST  0x0000000fU
 
+#define REC_TYPE_LU_VERSION                 0x40000000U
+
 #define REC_TYPE_OPTIONAL             0x80000000U
 #define REC_TYPE_LIVE_UPDATE          0x40000000U
 
@@ -113,6 +115,13 @@ struct mr_hvm_params
     struct mr_hvm_params_entry param[0];
 };
 
+/* LU_VERSION */
+struct mr_lu_version
+{
+    uint32_t xen_major;
+    uint32_t xen_minor;
+};
+
 #endif /* __XEN_MIGRATION_STREAM_H__ */
 
 /*
-- 
2.21.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.