Martin Polednik has uploaded a new change for review.

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

virt: move watchdog device to vmdevices.py

No real code changes

Change-Id: If5a9b6d56cc0a3d483f14e058d50eafd8cab960f
Signed-off-by: Martin Polednik <mpoled...@redhat.com>
---
M tests/vmTests.py
M vdsm/virt/vm.py
M vdsm/virt/vmdevices.py
3 files changed, 26 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/34308/1

diff --git a/tests/vmTests.py b/tests/vmTests.py
index a2fd8da..dc4cac7 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -521,7 +521,7 @@
         watchdogXML = '<watchdog action="none" model="i6300esb"/>'
         dev = {'device': 'watchdog', 'type': 'watchdog',
                'specParams': {'model': 'i6300esb', 'action': 'none'}}
-        watchdog = vm.WatchdogDevice(self.conf, self.log, **dev)
+        watchdog = vmdevices.Watchdog(self.conf, self.log, **dev)
         self.assertXML(watchdog.getXML(), watchdogXML)
 
     def testSoundXML(self):
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 1686b76..292b74b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1194,30 +1194,6 @@
         return m
 
 
-class WatchdogDevice(vmdevices.Base):
-    __slots__ = ('address',)
-
-    def __init__(self, *args, **kwargs):
-        super(WatchdogDevice, self).__init__(*args, **kwargs)
-
-        if not hasattr(self, 'specParams'):
-            self.specParams = {}
-
-    def getXML(self):
-        """
-        Create domxml for a watchdog device.
-
-        <watchdog model='i6300esb' action='reset'>
-          <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
-           function='0x0'/>
-        </watchdog>
-        """
-        m = self.createXmlElem(self.type, None, ['address'])
-        m.setAttrs(model=self.specParams.get('model', 'i6300esb'),
-                   action=self.specParams.get('action', 'none'))
-        return m
-
-
 class MigrationError(Exception):
     pass
 
@@ -1252,7 +1228,7 @@
                      (CONTROLLER_DEVICES, vmdevices.Controller),
                      (GENERAL_DEVICES, vmdevices.Generic),
                      (BALLOON_DEVICES, BalloonDevice),
-                     (WATCHDOG_DEVICES, WatchdogDevice),
+                     (WATCHDOG_DEVICES, vmdevices.Watchdog),
                      (CONSOLE_DEVICES, vmdevices.Console),
                      (REDIR_DEVICES, vmdevices.Redir),
                      (RNG_DEVICES, vmdevices.Rng),
diff --git a/vdsm/virt/vmdevices.py b/vdsm/virt/vmdevices.py
index 4fab94e..ac7488e 100644
--- a/vdsm/virt/vmdevices.py
+++ b/vdsm/virt/vmdevices.py
@@ -191,3 +191,27 @@
         backend.appendChildWithArgs('device',
                                     path=self.specParams['path'])
         return tpm
+
+
+class Watchdog(Base):
+    __slots__ = ('address',)
+
+    def __init__(self, *args, **kwargs):
+        super(Watchdog, self).__init__(*args, **kwargs)
+
+        if not hasattr(self, 'specParams'):
+            self.specParams = {}
+
+    def getXML(self):
+        """
+        Create domxml for a watchdog device.
+
+        <watchdog model='i6300esb' action='reset'>
+          <address type='pci' domain='0x0000' bus='0x00' slot='0x05'
+           function='0x0'/>
+        </watchdog>
+        """
+        m = self.createXmlElem(self.type, None, ['address'])
+        m.setAttrs(model=self.specParams.get('model', 'i6300esb'),
+                   action=self.specParams.get('action', 'none'))
+        return m


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5a9b6d56cc0a3d483f14e058d50eafd8cab960f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoled...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to