Martin Polednik has uploaded a new change for review.

Change subject: virt: move redir device to vmdevices.py
......................................................................

virt: move redir device to vmdevices.py

No real code changes

Change-Id: I0a5cb5140302b9b909750c7f5df4d257958bab3d
Signed-off-by: Martin Polednik <[email protected]>
---
M tests/vmTests.py
M vdsm/virt/vm.py
M vdsm/virt/vmdevices.py
3 files changed, 21 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/34250/1

diff --git a/tests/vmTests.py b/tests/vmTests.py
index a8842d6..97581b3 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -263,7 +263,7 @@
         smartcardXML = '<smartcard mode="passthrough" type="spicevmc"/>'
         dev = {'device': 'smartcard',
                'specParams': {'mode': 'passthrough', 'type': 'spicevmc'}}
-        smartcard = vm.SmartCardDevice(self.conf, self.log, **dev)
+        smartcard = vmdevices.SmartCard(self.conf, self.log, **dev)
         self.assertXML(smartcard.getXML(), smartcardXML)
 
     def testTpmXML(self):
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9905fe1..fecb42e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1218,25 +1218,6 @@
         return m
 
 
-class SmartCardDevice(vmdevices.Base):
-    __slots__ = ('address',)
-
-    def getXML(self):
-        """
-        Add smartcard section to domain xml
-
-        <smartcard mode='passthrough' type='spicevmc'>
-          <address ... />
-        </smartcard>
-        """
-        card = self.createXmlElem(self.device, None, ['address'])
-        sourceAttrs = {'mode': self.specParams['mode']}
-        if sourceAttrs['mode'] != 'host':
-            sourceAttrs['type'] = self.specParams['type']
-        card.setAttrs(**sourceAttrs)
-        return card
-
-
 class TpmDevice(vmdevices.Base):
     __slots__ = ()
 
@@ -1339,7 +1320,7 @@
                      (CONSOLE_DEVICES, ConsoleDevice),
                      (REDIR_DEVICES, vmdevices.Redir),
                      (RNG_DEVICES, RngDevice),
-                     (SMARTCARD_DEVICES, SmartCardDevice),
+                     (SMARTCARD_DEVICES, vmdevices.SmartCard),
                      (TPM_DEVICES, TpmDevice))
 
     def _makeDeviceDict(self):
diff --git a/vdsm/virt/vmdevices.py b/vdsm/virt/vmdevices.py
index 9f40890..41f508c 100644
--- a/vdsm/virt/vmdevices.py
+++ b/vdsm/virt/vmdevices.py
@@ -69,6 +69,25 @@
         return ctrl
 
 
+class SmartCard(Base):
+    __slots__ = ('address',)
+
+    def getXML(self):
+        """
+        Add smartcard section to domain xml
+
+        <smartcard mode='passthrough' type='spicevmc'>
+          <address ... />
+        </smartcard>
+        """
+        card = self.createXmlElem(self.device, None, ['address'])
+        sourceAttrs = {'mode': self.specParams['mode']}
+        if sourceAttrs['mode'] != 'host':
+            sourceAttrs['type'] = self.specParams['type']
+        card.setAttrs(**sourceAttrs)
+        return card
+
+
 class Sound(Base):
     __slots__ = ('address', 'alias')
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a5cb5140302b9b909750c7f5df4d257958bab3d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to