qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 6/7] migration-local: add option to command line for


From: Lei Li
Subject: [Qemu-devel] [PATCH 6/7] migration-local: add option to command line for -incoming-local
Date: Sun, 16 Jun 2013 23:37:32 +0800

Signed-off-by: Lei Li <address@hidden>
---
 qemu-options.hx |    9 +++++++++
 vl.c            |   14 ++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index bf94862..bb1a88a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2913,6 +2913,15 @@ STEXI
 Prepare for incoming migration, listen on @var{port}.
 ETEXI
 
+DEF("incoming-local", HAS_ARG, QEMU_OPTION_incoming_local, \
+    "-incoming-local p prepare for localhost incoming migration, listen on 
domain unix socket p\n",
+    QEMU_ARCH_ALL)
+STEXI
address@hidden -incoming-local @var{port}
address@hidden -incoming-local
+Prepare for localhost incoming migration, listen on @var{port}
+ETEXI
+
 DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
     "-nodefaults     don't create default devices\n", QEMU_ARCH_ALL)
 STEXI
diff --git a/vl.c b/vl.c
index 9f8fd6e..496a264 100644
--- a/vl.c
+++ b/vl.c
@@ -2856,6 +2856,7 @@ int main(int argc, char **argv, char **envp)
     const char *vga_model = "none";
     const char *pid_file = NULL;
     const char *incoming = NULL;
+    const char *incoming_local = NULL;
 #ifdef CONFIG_VNC
     int show_vnc_port = 0;
 #endif
@@ -3755,6 +3756,10 @@ int main(int argc, char **argv, char **envp)
                 incoming = optarg;
                 runstate_set(RUN_STATE_INMIGRATE);
                 break;
+            case QEMU_OPTION_incoming_local:
+                incoming_local = optarg;
+                runstate_set(RUN_STATE_INMIGRATE);
+                break;
             case QEMU_OPTION_nodefaults:
                 default_serial = 0;
                 default_parallel = 0;
@@ -4418,6 +4423,15 @@ int main(int argc, char **argv, char **envp)
             error_free(local_err);
             exit(1);
         }
+    } else if (incoming_local) {
+        Error *local_err = NULL;
+        qemu_start_local_incoming_migration(incoming_local, &local_err);
+        if (local_err) {
+            fprintf(stderr, "-incoming_local %s: %s\n", incoming_local,
+                    error_get_pretty(local_err));
+            error_free(local_err);
+            exit(1);
+        }
     } else if (autostart) {
         vm_start();
     }
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]