]> xenbits.xensource.com Git - libvirt.git/commit
nwfilter: directly use poll to wait for packets instead of pcap_next
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 21 May 2018 11:46:00 +0000 (12:46 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 7 Jun 2018 15:59:33 +0000 (16:59 +0100)
commitab4591f1f4d8a57a8e1bce3fde125376a0524d66
treefbbaaa7971b2bd29de57e1a07ec990e4036fbd70
parent1e49132dde6ae7ec229e3d7550289f9f558ff59b
nwfilter: directly use poll to wait for packets instead of pcap_next

When a QEMU VM shuts down its TAP device gets deleted while nwfilter
IP address learning thread is still capturing packets. It is seen that
with TPACKET_V3 support in libcap, the pcap_next() call will not always
exit its poll() when the NIC is removed. This prevents the learning
thread from exiting which blocks the rest of libvirtd waiting on mutex
acquisition. By switching to do poll() in libvirt code, we can ensure
that we always exit the poll() at a time that is right for libvirt.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/nwfilter/nwfilter_learnipaddr.c