代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ed5210b67f18478af5669976abb6b61c3bd576e0 Mon Sep 17 00:00:00 2001
From: Peter Krempa <pkrempa@redhat.com>
Date: Thu, 14 May 2020 12:02:55 +0200
Subject: [PATCH 09/18] 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: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
src/qemu/qemu_command.c | 20 ++++++++++----------
tests/qemuxml2argvdata/net-user-addr.args | 3 ++-
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 056a74fb60..688c9db851 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3991,20 +3991,20 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
for (i = 0; i < net->guestIP.nips; i++) {
const virNetDevIPAddr *ip = net->guestIP.ips[i];
g_autofree char *addr = NULL;
- const char *prefix = "";
if (!(addr = virSocketAddrFormat(&ip->address)))
return NULL;
- if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET))
- prefix = "net=";
- if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6))
- prefix = "ipv6-net=";
-
- virBufferAsprintf(&buf, "%s%s", prefix, addr);
- if (ip->prefix)
- virBufferAsprintf(&buf, "/%u", ip->prefix);
- virBufferAddChar(&buf, ',');
+ if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) {
+ virBufferAsprintf(&buf, "net=%s", addr);
+ if (ip->prefix)
+ virBufferAsprintf(&buf, "/%u", ip->prefix);
+ virBufferAddChar(&buf, ',');
+ } else if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET6)) {
+ virBufferAsprintf(&buf, "ipv6-prefix=%s,", addr);
+ if (ip->prefix)
+ virBufferAsprintf(&buf, "ipv6-prefixlen=%u,", ip->prefix);
+ }
}
}
break;
diff --git a/tests/qemuxml2argvdata/net-user-addr.args b/tests/qemuxml2argvdata/net-user-addr.args
index 6cc82d9e62..5f1de305e0 100644
--- a/tests/qemuxml2argvdata/net-user-addr.args
+++ b/tests/qemuxml2argvdata/net-user-addr.args
@@ -27,6 +27,7 @@ server,nowait \
-usb \
-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 \
--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,\
addr=0x3
--
2.23.0.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。