Vinzenz Feenstra has uploaded a new change for review. Change subject: vdsm: Refactor out LibvirtVmDevice ......................................................................
vdsm: Refactor out LibvirtVmDevice Removal of the class LibvirtVmDevice Change-Id: I4e05b948dbe88328f3cd3186df7d12a40eb5e648 Signed-off-by: Vinzenz Feenstra <[email protected]> --- M vdsm/vm/devices/__init__.py M vdsm/vm/devices/device.py 2 files changed, 14 insertions(+), 17 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/10866/1 diff --git a/vdsm/vm/devices/__init__.py b/vdsm/vm/devices/__init__.py index 6c5283c..d32030b 100644 --- a/vdsm/vm/devices/__init__.py +++ b/vdsm/vm/devices/__init__.py @@ -18,7 +18,7 @@ # Refer to the README and COPYING files for full details of the license # -from device import Device, LibvirtVmDevice, GeneralDevice, ControllerDevice,\ +from device import Device, GeneralDevice, ControllerDevice,\ VideoDevice, SoundDevice, NetworkInterfaceDevice, Drive, BalloonDevice,\ WatchdogDevice, SmartCardDevice, RedirDevice, ConsoleDevice @@ -46,7 +46,6 @@ "CONSOLE_DEVICES", "SMARTCARD_DEVICES", "Device", - "LibvirtVmDevice", "GeneralDevice", "ControllerDevice", "VideoDevice", diff --git a/vdsm/vm/devices/device.py b/vdsm/vm/devices/device.py index 8d3b5cc..d8a1f79 100644 --- a/vdsm/vm/devices/device.py +++ b/vdsm/vm/devices/device.py @@ -39,8 +39,6 @@ if not a.startswith('__')] return " ".join(attrs) - -class LibvirtVmDevice(Device): def createXmlElem(self, elemType, deviceType, attributes=[]): """ Create domxml device element according to passed in params @@ -67,7 +65,7 @@ return element -class GeneralDevice(LibvirtVmDevice): +class GeneralDevice(Device): def getXML(self): """ @@ -76,7 +74,7 @@ return self.createXmlElem(self.type, self.device, ['address']) -class ControllerDevice(LibvirtVmDevice): +class ControllerDevice(Device): def getXML(self): """ @@ -91,7 +89,7 @@ return ctrl -class VideoDevice(LibvirtVmDevice): +class VideoDevice(Device): def getXML(self): """ @@ -108,7 +106,7 @@ return video -class SoundDevice(LibvirtVmDevice): +class SoundDevice(Device): def getXML(self): """ @@ -119,7 +117,7 @@ return sound -class NetworkInterfaceDevice(LibvirtVmDevice): +class NetworkInterfaceDevice(Device): def __init__(self, conf, log, **kwargs): # pyLint can't tell that the Device.__init__() will @@ -130,7 +128,7 @@ kwargs[attr] = 'virtio' elif attr == 'network' and value == '': kwargs[attr] = DUMMY_BRIDGE - LibvirtVmDevice.__init__(self, conf, log, **kwargs) + Device.__init__(self, conf, log, **kwargs) self.sndbufParam = False self._customize() @@ -209,7 +207,7 @@ return iface -class Drive(LibvirtVmDevice): +class Drive(Device): VOLWM_CHUNK_MB = config.getint('irs', 'volume_utilization_chunk_mb') VOLWM_FREE_PCT = 100 - config.getint('irs', 'volume_utilization_percent') VOLWM_CHUNK_REPLICATE_MULT = 2 # Chunk multiplier during replication @@ -217,7 +215,7 @@ def __init__(self, conf, log, **kwargs): if not kwargs.get('serial'): self.serial = kwargs.get('imageID'[-20:]) or '' - LibvirtVmDevice.__init__(self, conf, log, **kwargs) + Device.__init__(self, conf, log, **kwargs) # Keep sizes as int self.reqsize = int(kwargs.get('reqsize', '0')) # Backward compatible self.truesize = int(kwargs.get('truesize', '0')) @@ -369,7 +367,7 @@ return diskelem -class BalloonDevice(LibvirtVmDevice): +class BalloonDevice(Device): def getXML(self): """ @@ -385,7 +383,7 @@ return m -class WatchdogDevice(LibvirtVmDevice): +class WatchdogDevice(Device): def getXML(self): """ Create domxml for a watchdog device. @@ -401,7 +399,7 @@ return m -class SmartCardDevice(LibvirtVmDevice): +class SmartCardDevice(Device): def getXML(self): """ Add smartcard section to domain xml @@ -416,7 +414,7 @@ return card -class RedirDevice(LibvirtVmDevice): +class RedirDevice(Device): def getXML(self): """ Create domxml for a redir device. @@ -428,7 +426,7 @@ return self.createXmlElem('redirdev', self.device, ['bus', 'address']) -class ConsoleDevice(LibvirtVmDevice): +class ConsoleDevice(Device): def getXML(self): """ Create domxml for a console device. -- To view, visit http://gerrit.ovirt.org/10866 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e05b948dbe88328f3cd3186df7d12a40eb5e648 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
