Francesco Romani has posted comments on this change.
Change subject: vm: Allow to use 'serial' or 'virtio' type consoles ......................................................................
Patch Set 9: Code-Review+1
(2 comments)
looks ok, thanks for the change. In the inline comment I suggested a possible readability improvement, but patch looks good enough already.
http://gerrit.ovirt.org/#/c/25979/9/vdsm/virt/vm.py File vdsm/virt/vm.py:
Line 2561: domxml._devices.appendChild(graphDev.getSpiceVmcChannelsXML()) Line 2562: break Line 2563: Line 2564: for consoleDev in self._devices[CONSOLE_DEVICES]: Line 2565: if consoleDev.specParams.get('consoleType', 'virtio') == 'serial': with the new property, this will read as
if consoleDev.isSerial: ... Line 2566: domxml._devices.appendChild(consoleDev.getSerialDeviceXML()) Line 2567: break Line 2568: Line 2569: for drive in self._devices[DISK_DEVICES][:]:
http://gerrit.ovirt.org/#/c/25979/9/vdsm/virt/vmdevices.py File vdsm/virt/vmdevices.py:
Line 78: def __init__(self, *args, **kwargs): Line 79: super(Console, self).__init__(*args, **kwargs) Line 80: Line 81: if not hasattr(self, 'specParams'): Line 82: self.specParams = {} let's add one property, since the check looks otherwise a little awkward:
@property def isSerial(self): # or whatever name you find better return self.specParams.get('consoleType', 'virtio') == 'serial' Line 83: Line 84: def getSerialDeviceXML(self): Line 85: """ Line 86: Add a serial port for the console device if it exists and is a