From 7c76235a3e6e24f596ab4b157157bd62f44b80f5 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Thu, 26 Feb 2015 14:16:06 +0000 Subject: [PATCH] Avoid crashing on multiple -incoming Passing multiple -incoming options used to crash qemu (due to an invalid state transition incoming->incoming). Instead we now take the last -incoming option, e.g.: qemu-system-x86_64 -nographic -incoming tcp::4444 -incoming defer ends up doing the defer. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Eric Blake Reviewed-by: Amit Shah Signed-off-by: Juan Quintela --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 75ec292216..74c2681641 100644 --- a/vl.c +++ b/vl.c @@ -3618,8 +3618,10 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_incoming: + if (!incoming) { + runstate_set(RUN_STATE_INMIGRATE); + } incoming = optarg; - runstate_set(RUN_STATE_INMIGRATE); break; case QEMU_OPTION_nodefaults: has_defaults = 0;