]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix issue of PF brought down if VF is 8021.Qbh and pci passthrough
authorNishank Trivedi <nistrive@cisco.com>
Thu, 30 Aug 2012 19:27:27 +0000 (15:27 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Thu, 30 Aug 2012 19:27:27 +0000 (15:27 -0400)
If a 8021.Qbh network device supports SRIOV and its VF is being used
in pci passthrough mode, when the guest is shutdown or destroyed, the
PF inteface is also brought down. qemuDomainHostdevNetConfigRestore()
finds out the PF for provided hostdev (which is VF) and passes it to
virNetDevPortProfileDisassociate() as linkdev. Later, linkdev gets passed
to virNetDevSetOnline() where the interface is brought down by clearing
IFF_UP flag.

Bringing down a PF, when only VF is being brought down is not expected
behavior. This patch adds a check so that virNetDevSetOnline() is called
only for PF and not if device is a VF.

Signed-off-by: Nishank Trivedi <nistrive@cisco.com>
AUTHORS
src/util/virnetdevvportprofile.c

diff --git a/AUTHORS b/AUTHORS
index 3a961c9a4c30d2cda79b2cadd71234676b9cea91..58a7303bf280d509cd53a323e55aa4e31c06132c 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -261,6 +261,7 @@ Patches have also been contributed by:
   J.B. Joret           <jb@linux.vnet.ibm.com>
   Stefan Hajnoczi      <stefanha@linux.vnet.ibm.com>
   Gene Czarcinski      <gene@czarc.net>
+  Nishank Trivedi      <nistrive@cisco.com>
 
   [....send patches to get your name here....]
 
index 52133782fd3c5cc016d54e8140db3404c2e3eb34..fbbdde91ac12f04028e84778b3df9f6bd143ec1d 100644 (file)
@@ -1235,7 +1235,8 @@ virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
         /* avoid disassociating twice */
         if (vmOp == VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH)
             break;
-        ignore_value(virNetDevSetOnline(linkdev, false));
+        if (vf < 0)
+            ignore_value(virNetDevSetOnline(linkdev, false));
         rc = virNetDevVPortProfileOp8021Qbh(linkdev, macvtap_macaddr, vf,
                                             virtPort, NULL,
                                             VIR_NETDEV_VPORT_PROFILE_LINK_OP_DISASSOCIATE);