Antoni Segura Puimedon has posted comments on this change.

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


Patch Set 1: (7 inline comments)

Thanks Mark and Shu for the reviews!

....................................................
File vdsm_hooks/sriov/after_vm_destroy.py
Line 10: SYS_NIC_PATH = '/sys/class/net/%s'
Line 11: VDSM_VAR_HOOKS_DIR = '/var/run/vdsm/hooks'
Line 12: SRIOV_CACHE_FILENAME = 'sriov.cache'
Line 13: 
Line 14: 
This has to go since I create it as managed.
Line 15: def returnDeviceToHost(addr, devpath):
Line 16:     # attach device back to host
Line 17:     connection = libvirtconnection.get(None)
Line 18:     nodeDevice = connection.nodeDeviceLookupByName(addr)


Line 44:             with open(path, 'r') as f:
Line 45:                 for line in f:
Line 46:                     nicAddr = line.split('=')
Line 47:                     if nicAddr[0] in nics:
Line 48:                         returnDeviceToHost(nicAddr[1], 
nicAddr[2].strip('\n'))
I'll have to check that. I basically kept this parts' functionality, but I'm 
open to changes.
Line 49:                     else:
Line 50:                         lines += line
Line 51: 
Line 52:             with open(path, 'w') as f:


....................................................
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
Done
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.
Indeed, better in a follow-up patch.
Line 76:         <virtualport type='802.10bh'>
Line 77:             <parameters proileid='foobar'/>
Line 78:         </virtualport>
Line 79:     </interface>


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.
Agreed. Will do so in a follow-up patch. Thanks for the idea ;-)
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')
RIght, I should drop detach and returnDeviceToHost :-) Thanks for pointing it 
out. I love to get rid of code :-)
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')
Done
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 <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dan Yasny <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: Shu Ming <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to