Change in vdsm[master]: Hook: ide2sata: To switch IDE disks to SATA
ciudavitacos at gmail.com
ciudavitacos at gmail.com
Thu Jan 21 18:50:50 UTC 2016
Javier Coscia has posted comments on this change.
Change subject: Hook: ide2sata: To switch IDE disks to SATA
......................................................................
Patch Set 6:
(5 comments)
https://gerrit.ovirt.org/#/c/48450/6/vdsm.spec.in
File vdsm.spec.in:
Line 611: BuildArch: noarch
Line 612: Requires: qemu-kvm >= 0.14
Line 613:
Line 614: %description hook-ide2sata
Line 615: VDSM hooks which changes IDE to SATA disks.
> changes IDE to SATA disks -> changes IDE disks to SATA.
Done
Line 616:
Line 617: %if 0%{?with_gluster_mgmt}
Line 618: %package gluster
Line 619: Summary: Gluster Plugin for VDSM
https://gerrit.ovirt.org/#/c/48450/6/vdsm_hooks/ide2sata/before_vm_start.py
File vdsm_hooks/ide2sata/before_vm_start.py:
Line 42: for disk in domxml.getElementsByTagName('disk'):
Line 43: device = disk.getAttribute('device')
Line 44: target = disk.getElementsByTagName('target')[0]
Line 45: bus = target.getAttribute('bus')
Line 46: dev = target.getAttribute('dev')
> This is needed only if this is a idea bus, and the device is disk or lun, s
Done
Line 47: if ((device == 'disk' or device == 'lun')
Line 48: and (bus == 'ide')):
Line 49: target.setAttribute('bus', 'sata')
Line 50: target.setAttribute('dev', 's%s' % dev[1:])
Line 44: target = disk.getElementsByTagName('target')[0]
Line 45: bus = target.getAttribute('bus')
Line 46: dev = target.getAttribute('dev')
Line 47: if ((device == 'disk' or device == 'lun')
Line 48: and (bus == 'ide')):
> This conditional can be simpler and more clear:
Done
Line 49: target.setAttribute('bus', 'sata')
Line 50: target.setAttribute('dev', 's%s' % dev[1:])
Line 51:
Line 52:
Line 82: <boot order="1"/>
Line 83: <driver cache="none" error_policy="stop" io="native" name="qemu"
Line 84: type="raw"/>
Line 85: </disk>
Line 86: </devices>
> This is not a correct domain xml - please include the <domain> element.
Done
Line 87: '''
Line 88:
Line 89: xmldom = minidom.parseString(text)
Line 90: print("\nDisk device definition BEFORE hook execution:\n\n%s"
Line 90: print("\nDisk device definition BEFORE hook execution:\n\n%s"
Line 91: % xmldom.toxml(encoding='UTF-8'))
Line 92: change2Sata(xmldom)
Line 93: print("\nDisk device definition AFTER hook execution: \n\n%s"
Line 94: % xmldom.toxml(encoding='UTF-8'))
> This does not test much.
Sorry, I haven't had time to work on a test module for this hook, I think it can go as it is for now, please, let me know if that's ok with you. Thanks!!
Line 95:
Line 96: if __name__ == '__main__':
Line 97: try:
Line 98: if '--test' in sys.argv:
--
To view, visit https://gerrit.ovirt.org/48450
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0088dae191cf4560a00ee62023a54f5ab746a3c9
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Javier Coscia <ciudavitacos at gmail.com>
Gerrit-Reviewer: Amador Pahim <apahim at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Javier Coscia <ciudavitacos at gmail.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list