virt-manager/6dfc4de1-add-support-for-parsing-formatting-SR-IOV-VFs.patch
Charles Arnold dc258c8290 - Upstream bug fixes (bsc#1027942)
3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
  6dfc4de1-add-support-for-parsing-formatting-SR-IOV-VFs.patch
  083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
- Add Recommends: python3-virt-bootstrap
  Change 'Requires: libvirt-python' to 'Requires: python-libvirt-python'
  virt-manager.spec
- Add corrections to sle15 detection (bsc#1054986)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=372
2017-10-11 20:11:09 +00:00

84 lines
2.8 KiB
Diff

Subject: network: add support for parsing/formatting SR-IOV VFs
From: Lin Ma lma@suse.com Fri Sep 22 19:39:09 2017 +0800
Date: Mon Oct 9 10:22:48 2017 +0200:
Git: 6dfc4de125022c43cb6e60e2f9e0c395ece159d6
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/tests/xmlparse-xml/network-vf-pool-in.xml b/tests/xmlparse-xml/network-vf-pool-in.xml
index 821aa075..542757de 100644
--- a/tests/xmlparse-xml/network-vf-pool-in.xml
+++ b/tests/xmlparse-xml/network-vf-pool-in.xml
@@ -1,5 +1,7 @@
<network>
<name>passthrough</name>
<forward mode="hostdev" managed="yes">
+ <pf dev="eth3"/>
+ <address type="pci" domain="0x0000" bus="0x03" slot="0x10" function="0x0"/>
</forward>
</network>
diff --git a/tests/xmlparse-xml/network-vf-pool-out.xml b/tests/xmlparse-xml/network-vf-pool-out.xml
index 62a73050..83644118 100644
--- a/tests/xmlparse-xml/network-vf-pool-out.xml
+++ b/tests/xmlparse-xml/network-vf-pool-out.xml
@@ -2,5 +2,6 @@
<name>new-foo</name>
<forward mode="hostdev" managed="yes">
<pf dev="eth3"/>
+ <address type="pci" domain="0x0000" bus="0x03" slot="0x10" function="0x0"/>
</forward>
</network>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index cc29eadc..1cceebce 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -1332,11 +1332,16 @@ class XMLParseTest(unittest.TestCase):
check("mode", "hostdev")
check("managed", "yes")
- r = net.forward.add_pf()
- r.dev = "eth3"
- check = self._make_checker(r)
+ check = self._make_checker(net.forward.pf[0])
check("dev", "eth3")
+ check = self._make_checker(net.forward.vfs[0])
+ check("type", "pci")
+ check("domain", 0x0000)
+ check("bus", 0x03)
+ check("slot", 0x10)
+ check("function", 0x0)
+
utils.diff_compare(net.get_xml_config(), outfile)
utils.test_create(conn, net.get_xml_config(), "networkDefineXML")
diff --git a/virtinst/network.py b/virtinst/network.py
index 183b0e3a..1cc71118 100644
--- a/virtinst/network.py
+++ b/virtinst/network.py
@@ -77,6 +77,15 @@ class _NetworkForwardPf(XMLBuilder):
dev = XMLProperty("./@dev")
+class _NetworkForwardAddress(XMLBuilder):
+ _XML_ROOT_NAME = "address"
+ type = XMLProperty("./@type")
+ domain = XMLProperty("./@domain", is_int=True)
+ bus = XMLProperty("./@bus", is_int=True)
+ slot = XMLProperty("./@slot", is_int=True)
+ function = XMLProperty("./@function", is_int=True)
+
+
class _NetworkForward(XMLBuilder):
_XML_ROOT_NAME = "forward"
@@ -84,6 +93,7 @@ class _NetworkForward(XMLBuilder):
dev = XMLProperty("./@dev")
managed = XMLProperty("./@managed")
pf = XMLChildProperty(_NetworkForwardPf)
+ vfs = XMLChildProperty(_NetworkForwardAddress)
def add_pf(self):
r = _NetworkForwardPf(self.conn)