On Fri, Feb 24, 2023 at 07:49:49PM +0100, Andrea Bolognani wrote: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.Well, except that it means we now have two cases when before there was one. Reviewed-by: David Gibson <david(a)gibson.dropbear.id.au> in the sense that I think the patch is correct. I don't think there's much point to this change 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:-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson