qrap: Generate -netdev as JSON
While generating -device as JSON when JSON is in use is mandatory, because not doing so can often prevent the VM from starting up, using JSON for -netdev simply makes things a bit nicer. No reason not to do it, though. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
4f2341f31d
commit
0d547a5b0f
1 changed files with 5 additions and 1 deletions
4
qrap.c
4
qrap.c
|
@ -311,7 +311,11 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
qemu_argv[qemu_argc++] = "-netdev";
|
||||
if (!has_json) {
|
||||
qemu_argv[qemu_argc++] = "socket,fd=" STR(DEFAULT_FD) ",id=hostnet0";
|
||||
} else {
|
||||
qemu_argv[qemu_argc++] = "{\"type\":\"socket\",\"fd\":\"" STR(DEFAULT_FD) "\",\"id\":\"hostnet0\"}";
|
||||
}
|
||||
qemu_argv[qemu_argc] = NULL;
|
||||
|
||||
valid_args:
|
||||
|
|
Loading…
Reference in a new issue