Nir Soffer has uploaded a new change for review.
Change subject: virt: Improve spacing ......................................................................
virt: Improve spacing
Separting logic blocks make it easier to to understand the flow.
Change-Id: I94b751112db67398891820035a9ec06abed59c3b Signed-off-by: Nir Soffer nsoffer@redhat.com --- M vdsm/virt/vmdevices/storage.py 1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/40067/1
diff --git a/vdsm/virt/vmdevices/storage.py b/vdsm/virt/vmdevices/storage.py index 799f66c..af1ddd2 100644 --- a/vdsm/virt/vmdevices/storage.py +++ b/vdsm/virt/vmdevices/storage.py @@ -333,14 +333,17 @@
if self.extSharedState == DRIVE_SHARED_TYPE.SHARED: diskelem.appendChildWithArgs('shareable') + if hasattr(self, 'readonly') and utils.tobool(self.readonly): diskelem.appendChildWithArgs('readonly') elif self.device == 'floppy' and not hasattr(self, 'readonly'): # floppies are used only internally for sysprep, so # they are readonly unless explicitely stated otherwise diskelem.appendChildWithArgs('readonly') + if hasattr(self, 'serial'): diskelem.appendChildWithArgs('serial', text=self.serial) + if hasattr(self, 'bootOrder'): diskelem.appendChildWithArgs('boot', order=self.bootOrder)
@@ -380,10 +383,12 @@ def _getDriverXML(self): driver = vmxml.Element('driver') driverAttrs = {'name': 'qemu'} + if self.blockDev: driverAttrs['io'] = 'native' else: driverAttrs['io'] = 'threads' + if self.format == 'cow': driverAttrs['type'] = 'qcow2' elif self.format: @@ -396,6 +401,7 @@ driverAttrs['error_policy'] = 'enospace' else: driverAttrs['error_policy'] = 'stop' + driver.setAttrs(**driverAttrs) return driver