[virt-tools-list] [PATCH v2 1/6] virtinst: Add a compare_controller function for future use

Lin Ma lma at suse.com
Thu Nov 23 09:32:45 UTC 2017


Signed-off-by: Lin Ma <lma at suse.com>
---
 virtinst/device.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/virtinst/device.py b/virtinst/device.py
index 4f9dcb2c..c160378b 100644
--- a/virtinst/device.py
+++ b/virtinst/device.py
@@ -72,6 +72,12 @@ class VirtualDeviceAddress(XMLBuilder):
             raise ValueError(_("Could not determine or unsupported "
                                "format of '%s'") % addrstr)
 
+    def compare_controller(self, controller, dev_bus):
+        if (controller.type == dev_bus and
+            controller.index == self.controller):
+            return True
+        return False
+
 
     type = XMLProperty("./@type")
     # type=pci
-- 
2.14.0




More information about the virt-tools-list mailing list