Francesco Romani has uploaded a new change for review. Change subject: vm: xml: add a method do append custom device XML ......................................................................
vm: xml: add a method do append custom device XML add a method to vmxml.Domain to append the XML representation of a device. This is used to update the XML after the hooks are been run. This is needed to achieve better isolation among vm.Vm and vmxml.Domain, and brings us one tiny step closer to the isolation of all XML-related processing into vdsm/virt/vmxml. Change-Id: Ic1c2842e31ade6e1a3c5bb967fcb02d91b81e26b Signed-off-by: Francesco Romani <[email protected]> --- M vdsm/virt/vm.py M vdsm/virt/vmxml.py 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/31381/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 1ca2e0e..43eaa40 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2651,8 +2651,7 @@ deviceXML, self.conf, dev.custom) dev._deviceXML = deviceXML - domxml._devices.appendChild( - xml.dom.minidom.parseString(deviceXML).firstChild) + domxml.appendDeviceXML(deviceXML) def _buildCmdLine(self): domxml = vmxml.Domain(self.conf, self.log, self.arch) diff --git a/vdsm/virt/vmxml.py b/vdsm/virt/vmxml.py index b8d87df..7faba40 100644 --- a/vdsm/virt/vmxml.py +++ b/vdsm/virt/vmxml.py @@ -420,6 +420,10 @@ self._devices.appendChild(emulator) + def appendDeviceXML(self, deviceXML): + self._devices.appendChild( + xml.dom.minidom.parseString(deviceXML).firstChild) + def toxml(self): return self.doc.toprettyxml(encoding='utf-8') -- To view, visit http://gerrit.ovirt.org/31381 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1c2842e31ade6e1a3c5bb967fcb02d91b81e26b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
