提交 54e43282 编写于 作者: P Peter Krempa

qemuBuildHostNetStr: Stop using 'ipv6-net' convenience argument

In qemu the argument of 'ipv6-net' is split up into 'ipv6-prefix' and
'ipv6-prefixlen'. Additionally now that 'netdev_add' was qapified, only
the real properties are allowed. Switch to using them explicitly.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 202bb53c
...@@ -3645,20 +3645,20 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, ...@@ -3645,20 +3645,20 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
for (i = 0; i < net->guestIP.nips; i++) { for (i = 0; i < net->guestIP.nips; i++) {
const virNetDevIPAddr *ip = net->guestIP.ips[i]; const virNetDevIPAddr *ip = net->guestIP.ips[i];
g_autofree char *addr = NULL; g_autofree char *addr = NULL;
const char *prefix = "";
if (!(addr = virSocketAddrFormat(&ip->address))) if (!(addr = virSocketAddrFormat(&ip->address)))
return NULL; return NULL;
if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) {
prefix = "net="; virBufferAsprintf(&buf, "net=%s", addr);
if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) if (ip->prefix)
prefix = "ipv6-net="; virBufferAsprintf(&buf, "/%u", ip->prefix);
virBufferAddChar(&buf, ',');
virBufferAsprintf(&buf, "%s%s", prefix, addr); } else if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) {
if (ip->prefix) virBufferAsprintf(&buf, "ipv6-prefix=%s,", addr);
virBufferAsprintf(&buf, "/%u", ip->prefix); if (ip->prefix)
virBufferAddChar(&buf, ','); virBufferAsprintf(&buf, "ipv6-prefixlen=%u,", ip->prefix);
}
} }
} }
break; break;
......
...@@ -27,6 +27,7 @@ server,nowait \ ...@@ -27,6 +27,7 @@ server,nowait \
-usb \ -usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-netdev user,net=172.17.2.0/24,ipv6-net=2001:db8:ac10:fd01::/64,id=hostnet0 \ -netdev user,net=172.17.2.0/24,ipv6-prefix=2001:db8:ac10:fd01::,\
ipv6-prefixlen=64,id=hostnet0 \
-device rtl8139,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,\ -device rtl8139,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,\
addr=0x3 addr=0x3
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册