Change in vdsm[master]: virt: New method Vm.get_devices

mzamazal at redhat.com mzamazal at redhat.com
Fri Feb 26 16:24:29 UTC 2016


Milan Zamazal has uploaded a new change for review.

Change subject: virt: New method Vm.get_devices
......................................................................

virt: New method Vm.get_devices

This is a preparation step for moving Vm._getUnderlying*() methods from
Vm to device classes.  The device classes need to obtain various data
from the Vm instance, such as device domain, device configuration and
device instances.  Most of the information is already available via
public interfaces from Vm, including disk and NIC devices, so it makes
little sense to pass the rest of the information in extra arguments to
the moved methods.  The new method generalizes the access to the Vm
devices.

After introducing the method, we can remove Vm.getNicDevices() and
Vm.getDiskDevices().  We'll do it in a separate patch as it's just a
bonus, not a primary goal, of this patch and we want to keep this patch
safe and simple.

Change-Id: I6a7c32806501df8672718c588b2f62087ff4e085
Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/54090/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 5833147..e09d191 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5070,6 +5070,9 @@
     def getNicDevices(self):
         return self._devices[hwclass.NIC]
 
+    def get_devices(self, hw_class):
+        return self._devices[hw_class]
+
     def getBalloonDevicesConf(self):
         for dev in self.conf['devices']:
             if dev['type'] == hwclass.BALLOON:


-- 
To view, visit https://gerrit.ovirt.org/54090
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a7c32806501df8672718c588b2f62087ff4e085
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>


More information about the vdsm-patches mailing list