Federico Simoncelli has uploaded a new change for review.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
libvirtvm: fix xml generation for all the devices
In one of the patches of the before_device_create series has been removed the XML generation for the regular devices. This patch fixes the behavior reintroducing the missing XML.
Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Signed-off-by: Federico Simoncelli fsimonce@redhat.com --- M vdsm/libvirtvm.py 1 file changed, 15 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/13637/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 607dedb..6f45226 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -1304,25 +1304,24 @@
for devType in self._devices: for dev in self._devices[devType]: - if not getattr(dev, 'custom', {}): - continue + if hasattr(dev, 'custom'): + yield
- yield dev - - def _beforeDeviceCreateHooks(self, domxml): + def _beforeDeviceCreateHooks(self, dev): """ Run before_device_create hook script for devices with custom properties
The resulting device xml is cached in dev._deviceXML. """ + deviceXML = dev.getXML()
- for dev in self._customDevices(): - deviceXML = dev.getXML().toxml(encoding='utf-8') - deviceXML = hooks.before_device_create( - deviceXML, self.conf, dev.custom) - dev._deviceXML = deviceXML - domxml._devices.appendChild( - xml.dom.minidom.parseString(deviceXML).firstChild) + if not hasattr(dev, 'custom'): + return deviceXML + + dev._deviceXML = hooks.before_device_create( + deviceXML.toxml(encoding='utf-8'), self.conf, dev.custom) + + return xml.dom.minidom.parseString(dev._deviceXML).firstChild
def _buildCmdLine(self): domxml = _DomXML(self.conf, self.log) @@ -1347,7 +1346,10 @@ domxml.appendInput() domxml.appendGraphics()
- self._beforeDeviceCreateHooks(domxml) + for devType in self._devices: + for dev in self._devices[devType]: + deviceXML = self._beforeDeviceCreateHooks(dev) + domxml._devices.appendChild(deviceXML)
for drive in self._devices[vm.DISK_DEVICES][:]: if not hasattr(drive, 'volumeChain'):
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com
Federico Simoncelli has posted comments on this change.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
Patch Set 1:
Please verify that this doesn't break your before_device_create.
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1828/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1879/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1828/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1879/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: libvirtvm: fix xml generation for all the devices ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
oh dear. will get to unbreak master first thing tomorrow.
.................................................... File vdsm/libvirtvm.py Line 1304: Line 1305: for devType in self._devices: Line 1306: for dev in self._devices[devType]: Line 1307: if hasattr(dev, 'custom'): Line 1308: yield yield None? Line 1309: Line 1310: def _beforeDeviceCreateHooks(self, dev): Line 1311: """ Line 1312: Run before_device_create hook script for devices with custom properties
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1835/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1886/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 2: Fails
Build Failed
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1835/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1886/ : FAILURE
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1836/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1887/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1836/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1887/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 3: Verified
All devices are added to the VM's domxml, and devices with custom properties get their hooks called.
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1837/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1888/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 5:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1889/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 5:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1838/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 5: Verified
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 5:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1838/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1889/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Patch Set 5: Looks good to me, approved
Thanks for the quick fix, Assaf. Thanks for reporting the breakage, Federico!
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Device custom properties: Keep non-custom devices in domxml ......................................................................
Device custom properties: Keep non-custom devices in domxml
Bug fix for device custom properties feature: Previously only devices with custom properties were added to the VM's domxml because of stupidity. Now all devices are added and device creation hooks are called only for devices with custom properties.
Patch Sets 2-5: Styling, naming.
Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Signed-off-by: Muller amuller@redhat.com --- M vdsm/libvirtvm.py 1 file changed, 17 insertions(+), 14 deletions(-)
Approvals: Assaf Muller: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/13637 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Ifb4f9eb32bc58371cec66301275689660193447b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org