When we call qemuARPGetInterfaces to get IP from host's arp table, The
iface's type has nothing to do with it, We should allow all of type.
Signed-off-by: Lin Ma <lma@suse.com>
---
src/qemu/qemu_driver.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2f8d6915e1..c2abecf81d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20940,9 +20940,6 @@ qemuARPGetInterfaces(virDomainObjPtr vm,
goto cleanup;
for (i = 0; i < vm->def->nnets; i++) {
- if (vm->def->nets[i]->type != VIR_DOMAIN_NET_TYPE_NETWORK)
- continue;
-
virMacAddrFormat(&(vm->def->nets[i]->mac), macaddr);
for (j = 0; j < table->n; j++) {
virArpTableEntry entry = table->t[j];
--
2.16.2
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
At 2018-09-07 18:44:53, "Lin Ma" <lma@suse.com> wrote: >When we call qemuARPGetInterfaces to get IP from host's arp table, The >iface's type has nothing to do with it, We should allow all of type. > >Signed-off-by: Lin Ma <lma@suse.com> Hi, with my limited tests, we can't get useful info by arp query from other kind of interface types. Regards, - Chen-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On 09/10/2018 02:55 PM, Chen Hanxiao wrote: > At 2018-09-07 18:44:53, "Lin Ma" <lma@suse.com> wrote: > >When we call qemuARPGetInterfaces to get IP from host's arp table, The > >iface's type has nothing to do with it, We should allow all of type. > > > >Signed-off-by: Lin Ma <lma@suse.com> > Hi, > with my limited tests, > we can't get useful info by arp query from other kind of interface types. IMO, As long as the host interface and the guest interface communicated through osi layer3 or above, Host kernel will maintaince the corresponding ip <-> macentry in arp able. What you mentioned above remind me one thing: I forgot to mention that if the switch doesn't support hairpin mode, thenthe virtual interfaces which backend is mactap can't communicate withhost, that means the host arp table won't include the ip <-> mac information of suchvirtual interfaces. Inthis case, the qemuARPGetInterfaces can't get IP. So I'd like to change the code to only ignore VIR_DOMAIN_NET_TYPE_DIRECT in patch V2, For anyelsenet types, the code will iterate the arp table for loopto try to search if there is a matched entry. what do you think? Thanks, Lin -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
At 2018-09-11 13:51:43, "Lin Ma" <lma@suse.com> wrote: >On 09/10/2018 02:55 PM, Chen Hanxiao wrote: > >At 2018-09-07 18:44:53, "Lin Ma" <lma@suse.com> wrote: >>When we call qemuARPGetInterfaces to get IP from host's arp table, The >>iface's type has nothing to do with it, We should allow all of type. >> >>Signed-off-by: Lin Ma <lma@suse.com> > >Hi, > with my limited tests, > we can't get useful info by arp query from other kind of interface types. > > > > > IMO, As long as the host interface and the guest interface > communicated > > through osi layer3 or above, Host kernel will maintaince > the corresponding > > ip <-> mac entry in arp able. > > A lot of network backend, such as vrouter, dpdk, the package from guest os did not come back to the host's protocol stack. We can't see them in host's arp table. > > What you mentioned above remind me one thing: I forgot to > mention that > > if the switch doesn't support hairpin mode, then the > virtual interfaces > > which backend is mactap can't communicate with host, > that means the host > > arp table won't include the ip <-> mac information > of such virtual interfaces. > > In this case, the qemuARPGetInterfaces > can't get IP. > > > > So I'd like to change the code to only ignore > VIR_DOMAIN_NET_TYPE_DIRECT Maybe adding VIR_DOMAIN_NET_TYPE_ETHERNET and VIR_DOMAIN_NET_TYPE_VHOSTUSER? Regards, - Chen > > in patch V2, For anyelse net types, the > code will iterate the arp table for > > loop to try to search if there is a > matched entry. > > > > what do you think? > > > > Thanks, > > Lin -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2026 Red Hat, Inc.