The 'ipv6-prefix' and 'ipv6-prefixlen' fields can be directly added using virJSONValueObjectAdd rather tha by two separate calls. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_command.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 420fe4ed0c..1fc235153e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3974,11 +3974,10 @@ qemuBuildHostNetProps(virDomainObj *vm, if (virJSONValueObjectAppendString(netprops, "net", ipv4netaddr) < 0) return NULL; } else if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) { - if (virJSONValueObjectAppendString(netprops, "ipv6-prefix", addr) < 0) - return NULL; - if (ip->prefix && - virJSONValueObjectAppendNumberUlong(netprops, "ipv6-prefixlen", - ip->prefix) < 0) + if (virJSONValueObjectAdd(&netprops, + "s:ipv6-prefix", addr, + "p:ipv6-prefixlen", ip->prefix, + NULL) < 0) return NULL; } } -- 2.39.2