1. 12 6月, 2018 3 次提交
  2. 11 6月, 2018 5 次提交
  3. 09 6月, 2018 1 次提交
  4. 08 6月, 2018 29 次提交
  5. 07 6月, 2018 2 次提交
    • D
      nwfilter: directly use poll to wait for packets instead of pcap_next · ab4591f1
      Daniel P. Berrangé 提交于
      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: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ab4591f1
    • D
      nwfilter: fix IP address learning · 1e49132d
      Daniel P. Berrangé 提交于
      In a previous commit:
      
        commit d4bf8f41
        Author: Daniel P. Berrangé <berrange@redhat.com>
        Date:   Wed Feb 14 09:43:59 2018 +0000
      
          nwfilter: handle missing switch enum cases
      
          Ensure all enum cases are listed in switch statements, or cast away
          enum type in places where we don't wish to cover all cases.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      
      we changed a switch in the nwfilter learning thread so that it had
      explict cases for all enum entries. Unfortunately the parameters in the
      method had been declared with incorrect type. The "howDetect" parameter
      does *not* accept "enum howDetect" values, rather it accepts a bitmask
      of "enum howDetect" values, so it should have been an "int" type.
      
      The caller always passes DETECT_STATIC|DETECT_DHCP, so essentially the
      IP addressing learning was completely broken by the above change, as it
      never matched any switch case, hitting the default leading to EINVAL.
      
      Stop using a typedef for the parameter name this this is a bitmask,
      not a plain enum value. Also stop using switch() since that's misleading
      with bitmasks too.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      1e49132d