Change in vdsm[master]: vdsm: move sound device to devices.py

mpoledni at redhat.com mpoledni at redhat.com
Thu Jun 26 11:44:12 UTC 2014


Martin Polednik has uploaded a new change for review.

Change subject: vdsm: move sound device to devices.py
......................................................................

vdsm: move sound device to devices.py

No real code changes

Change-Id: I42b8ae3475373d39c7d6375ccbc23a85437e19d0
Signed-off-by: Martin Polednik <mpoledni at redhat.com>
---
M tests/vmTests.py
M vdsm/virt/devices.py
M vdsm/virt/vm.py
3 files changed, 15 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/29265/1

diff --git a/tests/vmTests.py b/tests/vmTests.py
index 2b6e82c..bb1e32b 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -31,6 +31,7 @@
 from virt import vm
 from virt import vmexitreason
 from virt import xmldom
+from virt import devices
 from vdsm import constants
 from vdsm import define
 from testrunner import VdsmTestCase as TestCaseBase
@@ -539,7 +540,7 @@
     def testSoundXML(self):
         soundXML = '<sound model="ac97"/>'
         dev = {'device': 'ac97'}
-        sound = vm.SoundDevice(self.conf, self.log, **dev)
+        sound = devices.SoundDevice(self.conf, self.log, **dev)
         self.assertXML(sound.getXML(), soundXML)
 
     def testVideoXML(self):
diff --git a/vdsm/virt/devices.py b/vdsm/virt/devices.py
index d484136..28386aa 100644
--- a/vdsm/virt/devices.py
+++ b/vdsm/virt/devices.py
@@ -32,3 +32,15 @@
         Create domxml for general device
         """
         return self.createXmlElem(self.type, self.device, ['address'])
+
+
+class SoundDevice(VmDevice):
+    __slots__ = ('address', 'alias')
+
+    def getXML(self):
+        """
+        Create domxml for sound device
+        """
+        sound = self.createXmlElem('sound', None, ['address'])
+        sound.setAttrs(model=self.device)
+        return sound
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index a0f4edf..5d52a79 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -645,18 +645,6 @@
         return video
 
 
-class SoundDevice(devices.VmDevice):
-    __slots__ = ('address', 'alias')
-
-    def getXML(self):
-        """
-        Create domxml for sound device
-        """
-        sound = self.createXmlElem('sound', None, ['address'])
-        sound.setAttrs(model=self.device)
-        return sound
-
-
 class NetworkInterfaceDevice(devices.VmDevice):
     __slots__ = ('nicModel', 'macAddr', 'network', 'bootOrder', 'address',
                  'linkActive', 'portMirroring', 'filter',
@@ -1344,7 +1332,7 @@
     _ongoingCreations = threading.BoundedSemaphore(4)
     DeviceMapping = ((DISK_DEVICES, Drive),
                      (NIC_DEVICES, NetworkInterfaceDevice),
-                     (SOUND_DEVICES, SoundDevice),
+                     (SOUND_DEVICES, devices.SoundDevice),
                      (VIDEO_DEVICES, VideoDevice),
                      (GRAPHICS_DEVICES, GraphicsDevice),
                      (CONTROLLER_DEVICES, ControllerDevice),


-- 
To view, visit http://gerrit.ovirt.org/29265
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42b8ae3475373d39c7d6375ccbc23a85437e19d0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni at redhat.com>


More information about the vdsm-patches mailing list