Skip to contentSkip to conversation

Avoid crashing on multiple -incoming

PATCH Applied Dr. David Alan Gilbert (git) 4 participants 4 messages Feb 26, 2015 – Mar 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Avoid crashing on multiple -incoming

From: "Dr. David Alan Gilbert" <[email protected]>

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.

---
 vl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
vl.c +3 -1
index e1ffd0a..aefc66d 100644
@@ -3610,8 +3610,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;
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

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.:

Quoted 8 lines

qemu-system-x86_64 -nographic -incoming tcp::4444 -incoming defer

ends up doing the defer.

---
 vl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 11 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

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.

Amit

#3 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 11 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

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.

Applied, thanks.