aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-10-27 04:22:57 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-10 12:15:14 -0500
commite69d50d621ccc1ab8b1048a3075ad944afebfed5 (patch)
treeb5051df8b4510f3d0392e339759100e90106f5f4 /softmmu
parentcca686b44aa1315df4cda4dee56ca601050fab71 (diff)
migration, vl: start migration via qmp_migrate_incoming
Make qemu_start_incoming_migration local to migration/migration.c. By using the runstate instead of a separate flag, vl need not do anything to setup deferred incoming migration. qmp_migrate_incoming also does not need the deferred_incoming flag anymore, because "-incoming PROTOCOL" will clear the "once" flag before the main loop starts. Therefore, later invocations of the migrate-incoming command will fail with the existing "The incoming migration has already been started" error message. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/vl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index e65eb0c9f2..20dd0cd517 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -109,6 +109,7 @@
#include "qapi/qapi-visit-block-core.h"
#include "qapi/qapi-visit-ui.h"
#include "qapi/qapi-commands-block-core.h"
+#include "qapi/qapi-commands-migration.h"
#include "qapi/qapi-commands-run-state.h"
#include "qapi/qapi-commands-ui.h"
#include "qapi/qmp/qerror.h"
@@ -4556,10 +4557,12 @@ void qemu_init(int argc, char **argv, char **envp)
}
if (incoming) {
Error *local_err = NULL;
- qemu_start_incoming_migration(incoming, &local_err);
- if (local_err) {
- error_reportf_err(local_err, "-incoming %s: ", incoming);
- exit(1);
+ if (strcmp(incoming, "defer") != 0) {
+ qmp_migrate_incoming(incoming, &local_err);
+ if (local_err) {
+ error_reportf_err(local_err, "-incoming %s: ", incoming);
+ exit(1);
+ }
}
} else if (autostart) {
vm_start();