@@ -404,6 +404,19 @@ static long kexec_reboot(void *_image)
return 0;
}
+static long kexec_live_update(void *_image)
+{
+ struct kexec_image *image = _image;
+
+ kexecing = TRUE;
+
+ kexec_common_shutdown();
+ machine_reboot_kexec(image);
+
+ BUG();
+ return 0;
+}
+
static void do_crashdump_trigger(unsigned char key)
{
printk("'%c' pressed -> triggering crashdump\n", key);
@@ -736,6 +749,7 @@ static int kexec_load_get_bits(int type, int *base, int *bit)
switch ( type )
{
case KEXEC_TYPE_DEFAULT:
+ case KEXEC_TYPE_LIVE_UPDATE:
*base = KEXEC_IMAGE_DEFAULT_BASE;
*bit = KEXEC_FLAG_DEFAULT_POS;
break;
@@ -837,6 +851,10 @@ static int kexec_exec(XEN_GUEST_HANDLE_PARAM(void) uarg)
image = kexec_image[base + pos];
ret = continue_hypercall_on_cpu(0, kexec_reboot, image);
break;
+ case KEXEC_TYPE_LIVE_UPDATE:
+ image = kexec_image[base + pos];
+ ret = continue_hypercall_on_cpu(0, kexec_live_update, image);
+ break;
case KEXEC_TYPE_CRASH:
kexec_crash(); /* Does not return */
break;
@@ -71,18 +71,22 @@
*/
/*
- * Kexec supports two types of operation:
+ * Kexec supports three types of operation:
* - kexec into a regular kernel, very similar to a standard reboot
* - KEXEC_TYPE_DEFAULT is used to specify this type
* - kexec into a special "crash kernel", aka kexec-on-panic
* - KEXEC_TYPE_CRASH is used to specify this type
* - parts of our system may be broken at kexec-on-panic time
* - the code should be kept as simple and self-contained as possible
+ * - Live update into a new Xen, preserving all running domains
+ * - KEXEC_TYPE_LIVE_UPDATE is used to specify this type
+ * - Xen performs guest-transparent live migration and stores live
+ * update state in memory, passing it to the new Xen.
*/
-#define KEXEC_TYPE_DEFAULT 0
-#define KEXEC_TYPE_CRASH 1
-
+#define KEXEC_TYPE_DEFAULT 0
+#define KEXEC_TYPE_CRASH 1
+#define KEXEC_TYPE_LIVE_UPDATE 2
/* The kexec implementation for Xen allows the user to load two
* types of kernels, KEXEC_TYPE_DEFAULT and KEXEC_TYPE_CRASH.