Change in vdsm[master]: vm: devices: replace Video device info

fromani at redhat.com fromani at redhat.com
Wed Dec 9 15:39:02 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: vm: devices: replace Video device info
......................................................................

vm: devices: replace Video device info

Change-Id: I72e1607f43856d700184dce023cb702a12b3c0ce
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 29 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/50195/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index da9d6cd..6565bf6 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1696,7 +1696,7 @@
         self._getUnderlyingNetworkInterfaceInfo()
         self._getUnderlyingDriveInfo()
         self._getUnderlyingSoundDeviceInfo()
-        self._getUnderlyingVideoDeviceInfo()
+        self._getUnderlyingDeviceInfo(hwclass.VIDEO)
         self._getUnderlyingGraphicsDeviceInfo()
         self._getUnderlyingControllerDeviceInfo()
         self._getUnderlyingBalloonDeviceInfo()
@@ -4189,34 +4189,6 @@
                               'alias': alias,
                               'address': address}
                 self.conf['devices'].append(hostdevice)
-
-    def _getUnderlyingVideoDeviceInfo(self):
-        """
-        Obtain video devices info from libvirt.
-        """
-        for x in self._domain.get_device_elements('video'):
-            if not x.getElementsByTagName('address'):
-                self.log.debug('device without address: %s', x)
-                continue
-            address = self._getUnderlyingDeviceAddress(x)
-            alias = x.getElementsByTagName('alias')[0].getAttribute('name')
-
-            # FIXME. We have an identification problem here.
-            # Video card device has not unique identifier, except the alias
-            # (but backend not aware to device's aliases). So, for now
-            # we can only assign the address according to devices order.
-            for vc in self._devices[hwclass.VIDEO]:
-                if not hasattr(vc, 'address') or not hasattr(vc, 'alias'):
-                    vc.alias = alias
-                    vc.address = address
-                    break
-            # Update vm's conf with address
-            for dev in self.conf['devices']:
-                if ((dev['type'] == hwclass.VIDEO) and
-                        (not dev.get('address') or not dev.get('alias'))):
-                    dev['address'] = address
-                    dev['alias'] = alias
-                    break
 
     def _getUnderlyingSoundDeviceInfo(self):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72e1607f43856d700184dce023cb702a12b3c0ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list