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(a)redhat.com> --- qrap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qrap.c b/qrap.c index 27c12ed..d0e2fb2 100644 --- a/qrap.c +++ b/qrap.c @@ -311,7 +311,11 @@ int main(int argc, char **argv) } qemu_argv[qemu_argc++] = "-netdev"; - qemu_argv[qemu_argc++] = "socket,fd=" STR(DEFAULT_FD) ",id=hostnet0"; + 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: -- 2.39.2