Dan Yasny has posted comments on this change.

Change subject: Cisco VM-FEX support vdsm hooks
......................................................................


Patch Set 9: (4 inline comments)

....................................................
File vdsm_hooks/vmfex/before_vm_migrate_destination.py
Line 8:     import libvirtconnection
Line 9: except ImportError:
Line 10:     #3.1 compat
Line 11:     from vdsm import libvirtconnection
Line 12: import fcntl
Done
Line 13: from xml.dom import minidom
Line 14: 
Line 15: '''
Line 16: Placed in before_vm_migrate_destination


....................................................
File vdsm_hooks/vmfex/before_vm_start.py
Line 92:     # Example ['eth0','eth1']
Line 93:     nics = []
Line 94:     for root, dirs, names in os.walk('/sys/devices/'):
Line 95:         if 'address' in names and 'pci' in root:
Line 96:             f = open(root + '/address', 'r')
According to what people are saying on python forums, file() is not a good idea 
and one should stick to open() instead. There's even talk of deprecating file() 
completely in the future.
Line 97:             mac = f.readlines()[0].strip()
Line 98:             f.close()
Line 99:             if mac == '00:00:00:00:00:00':
Line 100:                 eth = root.split('/')[-1]


Line 158:     else:
Line 159:         return False
Line 160: 
Line 161: 
Line 162: def handleDirectPool(conn):
I don't "update" here, this is a logical wrapper on update/check/verify/... all 
the actions around directPool. I am thinking of actually moving the rest of the 
directPool functions into this one, somehow, but that's not as urgent as taking 
this entire set of functions into a separate module, IMO
Line 163:     #TODO: take this part and everything it uses out and into a 
separate
Line 164:     # module
Line 165: 
Line 166:     #is direct-pool defined? If not, just create it and move on


Line 168:         createDirectPool(conn)
Line 169:         return
Line 170:     #Now we know for sure that the pool exists...
Line 171:     #are there VMs running?
Line 172:     if conn.listDomainsID():
Makes sense... 
Done.
Line 173:         #does any of the running VMs havd a Qbh nic?
Line 174:         #if yes, can't touch the existing pool
Line 175:         if not qbhInUse(conn):
Line 176:         #no VMs use the existing pool, it can be checked and updated


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I45a7fa46919bb39a648dff190c40618395990e91
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Yasny <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dan Yasny <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[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