Change in vdsm[master]: Make sr-iov hook use interface instead of hostdev

wudxw at linux.vnet.ibm.com wudxw at linux.vnet.ibm.com
Wed Apr 3 06:17:41 UTC 2013


Mark Wu has posted comments on this change.

Change subject: Make sr-iov hook use interface instead of hostdev
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(4 inline comments)

....................................................
File vdsm_hooks/sriov/before_vm_start.py
Line 68:         <source>
Line 69:             <address type='pci' domain='0x0' bus='0x1a' slot='0x10' slot='0x07'
Line 70:              function='0x06'/>
Line 71:         </source>
Line 72:         # TODO: Check if we omit the mac address to have libvirt auto-generate
libvirt can generate the mac address automatically
Line 73:         # it
Line 74:         <mac address='4:54:00:6d:90:02'/>
Line 75:         # TODO: This should be set only if connected to this kind of switch.
Line 76:         <virtualport type='802.10bh'>


Line 71:         </source>
Line 72:         # TODO: Check if we omit the mac address to have libvirt auto-generate
Line 73:         # it
Line 74:         <mac address='4:54:00:6d:90:02'/>
Line 75:         # TODO: This should be set only if connected to this kind of switch.
It's up to the type of external switch and optional. So we should make it optional and allow different parameters for different switches.  You could separate this part into another patch.
Line 76:         <virtualport type='802.10bh'>
Line 77:             <parameters proileid='foobar'/>
Line 78:         </virtualport>
Line 79:     </interface>


Line 80:     '''
Line 81: 
Line 82:     interface = domxml.createElement('interface')
Line 83:     interface.setAttribute('type', 'hostdev')
Line 84:     interface.setAttribute('managed', 'yes')
Since we set the attribute  'managed'  to 'yes',  libvirt should be responsible to detach device bedore vm start and re-attach device to host after vm destroy.  So,  probably you need still cleanup the code of 'detachDevice' and 'returnDeviceToHost'

http://www.libvirt.org/formatdomain.html#elementsNICSHostdev
Line 85: 
Line 86:     source = domxml.createElement('source')
Line 87:     interface.appendChild(source)
Line 88: 


Line 88: 
Line 89:     address = domxml.createElement('address')
Line 90:     address.setAttribute('type', 'pci')
Line 91:     # The domain is not currently used by Qemu
Line 92:     #address.setAttribute('domain', '0')
it's no harm to set it
Line 93:     address.setAttribute('bus', bus)
Line 94:     address.setAttribute('slot', slot)
Line 95:     address.setAttribute('function', function)
Line 96: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib2f88a8400fe4d230c0877428afef62df8e397db
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dan Yasny <dyasny at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list