Antoni Segura Puimedon has posted comments on this change.
Change subject: [WIP] netwiring: [4/4] Add API definitions.
......................................................................
Patch Set 22: (6 inline comments)
....................................................
File vdsm/dummybr.py
Line 24:
Line 25: from vdsm import libvirtconnection, utils, constants
Line 26:
Line 27:
Line 28: DUMMY_BRIDGE = ';;;;;;;;'
I guess I need to change my font :-) I will change it to that.
Line 29:
Line 30:
Line 31: def createEphemeralBridge(bridgeName):
Line 32: rc, out, err = utils.execCmd([constants.EXT_BRCTL, 'addbr',
bridgeName])
Line 36:
Line 37:
Line 38: def addBridgeToLibvirt(bridgeName):
Line 39: conn = libvirtconnection.get()
Line 40: if bridgeName not in conn.listNetworks():
I will change it to ask for forgiveness and catch the libvirtError.
Yes, the lack of prefix was intentional, as a way of saying "this is not really
one of the networks that we consider fair game". I will change it to have the
prefix for ownership, though.
Line 41: conn.networkCreateXML(
Line 42: '''<network><name>%s</name><forward mode='bridge'/><bridge
'''
Line 43: '''name='%s'/></network>''' % (bridgeName, bridgeName))
Line 44:
....................................................
File vdsm/libvirtvm.py
Line 54: DRIVE_NOT_FOUND = "Drive Not Found"
Line 55: BASE_NOT_FOUND = "Base Not Found"
Line 56:
Line 57:
Line 58: class setLinkAndNetworkError(Exception):
Done
Line 59: pass
Line 60:
Line 61:
Line 62: class updatePortMirroringError(Exception):
Line 1590: except Exception as e:
Line 1591: # Rollback link and network.
Line 1592:
self._dom.updateDeviceFlags(vnicXML.toxml(encoding='utf-8'),
Line 1593:
libvirt.VIR_DOMAIN_AFFECT_LIVE)
Line 1594: if isinstance(e, updatePortMirroringError):
Yes, I had considered to separate the try blocks. I was kind of doubting if to
nest one in another, to reuse the rollback code.
Line 1595: raise
Line 1596: else:
Line 1597: self.log.debug('Request to update the the vnic %s
failed. '
Line 1598: 'Made with the following xml: %s',
Line 1593:
libvirt.VIR_DOMAIN_AFFECT_LIVE)
Line 1594: if isinstance(e, updatePortMirroringError):
Line 1595: raise
Line 1596: else:
Line 1597: self.log.debug('Request to update the the vnic %s
failed. '
You're right. In any case I was to improve the logging of this whole thing.
Line 1598: 'Made with the following xml: %s',
Line 1599: dev.alias,
Line 1600: vnicXML.toprettyxml(encoding='utf-8'),
Line 1601: exc_info=True)
Line 1643: def updateDevice(self, params):
Line 1644: if params.get('deviceType') == vm.NIC_DEVICES:
Line 1645: return self._updateInterfaceDevice(params)
Line 1646: else:
Line 1647: return errCode['noimpl']
Done
Line 1648:
Line 1649: def hotunplugNic(self, params):
Line 1650: if self.isMigrating():
Line 1651: return errCode['migInProgress']
--
To view, visit http://gerrit.ovirt.org/9562
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3b9b4f49f80466a83e3e13f1042ac2a8866c6bcd
Gerrit-PatchSet: 22
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches