[libvirt] [PATCH v2 1/2] qemu: Remove network type limitation for qemuARPGetInterfaces

Lin Ma lma at suse.com
Thu Sep 13 07:54:23 UTC 2018


When we call qemuARPGetInterfaces to get IP from the host's arp table, We
ignore VIR_DOMAIN_NET_TYPE_ETHERNET, VIR_DOMAIN_NET_TYPE_VHOSTUSER and
VIR_DOMAIN_NET_TYPE_DIRECT due to the host's arp table won't include the
ip <-> mac entries about these type of backends.

Signed-off-by: Lin Ma <lma at suse.com>
---
 src/qemu/qemu_driver.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2f8d6915e1..f066e02f36 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20940,7 +20940,9 @@ qemuARPGetInterfaces(virDomainObjPtr vm,
         goto cleanup;
 
     for (i = 0; i < vm->def->nnets; i++) {
-        if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK)
+        if (vm->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_ETHERNET ||
+            vm->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER ||
+            vm->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_DIRECT)
             continue;
 
         virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
-- 
2.15.1




More information about the libvir-list mailing list