Dan Kenigsberg has uploaded a new change for review.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
libvirtvm: use <interface type='network'>
In the future, this would allow us to migrate a VM from a bridge-based network to funkier types of networks defined in http://libvirt.org/formatnetwork.html .
Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Signed-off-by: Dan Kenigsberg danken@redhat.com --- M tests/libvirtvmTests.py M vdsm/libvirtvm.py 2 files changed, 15 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/9441/1
diff --git a/tests/libvirtvmTests.py b/tests/libvirtvmTests.py index 4293276..2a0f097 100644 --- a/tests/libvirtvmTests.py +++ b/tests/libvirtvmTests.py @@ -261,10 +261,10 @@
def testInterfaceXML(self): interfaceXML = """ - <interface type="bridge"> <address %s/> + <interface type="network"> <address %s/> <mac address="52:54:00:59:F5:3F"/> <model type="virtio"/> - <source bridge="ovirtmgmt"/> + <source network="vdsm-ovirtmgmt"/> <filterref filter="no-mac-spoofing"/> <boot order="1"/> <driver name="vhost"/> diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 3439dc3..7bbab95 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -982,16 +982,17 @@ """ Create domxml for network interface.
- <interface type="bridge"> + <interface type="network"> <mac address="aa:bb:dd:dd:aa:bb"/> <model type="virtio"/> - <source bridge="engine"/> + <source network="vdsm-engine"/> [<filterref filter='filter name'/>] [<tune><sndbuf>0</sndbuf></tune>] </interface> """ doc = xml.dom.minidom.Document() iface = self.createXmlElem('interface', self.device, ['address']) + iface.setAttribute('type', 'network') m = doc.createElement('mac') m.setAttribute('address', self.macAddr) iface.appendChild(m) @@ -999,7 +1000,7 @@ m.setAttribute('type', self.nicModel) iface.appendChild(m) m = doc.createElement('source') - m.setAttribute('bridge', self.network) + m.setAttribute('network', netinfo.LIBVIRT_NET_PREFIX + self.network) iface.appendChild(m) if hasattr(self, 'filter'): m = doc.createElement('filterref') @@ -2790,10 +2791,15 @@ mac = x.getElementsByTagName('mac')[0].getAttribute('address') alias = x.getElementsByTagName('alias')[0].getAttribute('name') model = x.getElementsByTagName('model')[0].getAttribute('type') - bridge = None + + network = None source = x.getElementsByTagName('source') if source: - bridge = source[0].getAttribute('bridge') + network = source[0].getAttribute('bridge') + if not network: + network = source[0].getAttribute('network') + network = network[len(netinfo.LIBVIRT_NET_PREFIX):] + # Get nic address address = self._getUnderlyingDeviceAddress(x) for nic in self._devices[vm.NIC_DEVICES]: @@ -2819,8 +2825,8 @@ 'address': address, 'alias': alias, 'name': name} - if bridge: - nicDev['network'] = bridge + if network: + nicDev['network'] = network self.conf['devices'].append(nicDev)
def _setWriteWatermarks(self):
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/131/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/165/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/131/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/165/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Shu Ming has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File tests/libvirtvmTests.py Line 263: interfaceXML = """ Line 264: <interface type="network"> <address %s/> Line 265: <mac address="52:54:00:59:F5:3F"/> Line 266: <model type="virtio"/> Line 267: <source network="vdsm-ovirtmgmt"/> Is it "vdsm-engine" instead of "vdsm-ovirtmgmt? See the comments in the top of NetworkInterfaceDevice.getXML()? Line 268: <filterref filter="no-mac-spoofing"/> Line 269: <boot order="1"/> Line 270: <driver name="vhost"/> Line 271: <tune>
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File tests/libvirtvmTests.py Line 263: interfaceXML = """ Line 264: <interface type="network"> <address %s/> Line 265: <mac address="52:54:00:59:F5:3F"/> Line 266: <model type="virtio"/> Line 267: <source network="vdsm-ovirtmgmt"/> in this context, "ovirtmgmt" is just another name for a network, as well as "engine". Both are valid examples.
It might have been nicer to have both examples the same, but in any case, this issue precedes my current change and unrelated to it. If you insist, I can send a follow-up patch, changing the docstring to match the test. Line 268: <filterref filter="no-mac-spoofing"/> Line 269: <boot order="1"/> Line 270: <driver name="vhost"/> Line 271: <tune>
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Shu Ming has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
Please fix the function comments to match the test examples. It might confuse others.
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
(1 inline comment)
Another minor suggestion, It's better to update the exaplation of network in @VmInterfaceDevice # @network: The name of the attached host bridge device
It could just represent the libvirt network, but not for any host bridge.
.................................................... File vdsm/libvirtvm.py Line 2794: Line 2795: network = None Line 2796: source = x.getElementsByTagName('source') Line 2797: if source: Line 2798: network = source[0].getAttribute('bridge') What's the purpose of this code? Make sure not to break across vdsm live upgrade? It's better to add a comment Line 2799: if not network: Line 2800: network = source[0].getAttribute('network') Line 2801: network = network[len(netinfo.LIBVIRT_NET_PREFIX):] Line 2802:
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 1: I would prefer that you didn't submit this
would break migration to hosts not expecting the <network> element. we need to first prepare for it there.
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/221/ (1/2)
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/187/ (2/2)
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/187/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/221/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Hunt Xu has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Shu Ming has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2: I would prefer that you didn't submit this
Unfortunately we can't move to using interface type='network' until https://bugzilla.redhat.com/show_bug.cgi?id=881480 is solved.
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Antoni Segura Puimedon has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2:
https://bugzilla.redhat.com/show_bug.cgi?id=881480 has been fixed and there are packages for it in F17 and rhel6.4.
I think now we could rebase this patch on top of the latest master and check/extend it so that it does not break the vmUpdateDevice functionality.
-- To view, visit http://gerrit.ovirt.org/9441 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: If173a6351b1033c3a1c821cbadd05a2cbdf3d76c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Hunt Xu mhuntxu@gmail.com Gerrit-Reviewer: Livnat Peer lpeer@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Itamar Heim has posted comments on this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Patch Set 2:
ping?
Itamar Heim has abandoned this change.
Change subject: libvirtvm: use <interface type='network'> ......................................................................
Abandoned
abandoning as no activity, please restore if relevant
vdsm-patches@lists.fedorahosted.org