summaryrefslogtreecommitdiff
path: root/virt-xml
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2018-02-22 18:47:49 -0500
committerCole Robinson <crobinso@redhat.com>2018-02-22 18:48:31 -0500
commit8c3388697c262312a58895b89e0f5139e76e13ed (patch)
tree281ec7f531f344f033e1849d3d1a3910d40e00c4 /virt-xml
parent8371a681b143c4d2ba5dd03b0cf3a85a12ed5597 (diff)
downloadvirt-manager-8c3388697c262312a58895b89e0f5139e76e13ed.tar.gz
virt-xml: Remove redundant XML roundtripping
Based on how we do diff reporting it doesn't accomplish anything anyways
Diffstat (limited to 'virt-xml')
-rwxr-xr-xvirt-xml15
1 files changed, 4 insertions, 11 deletions
diff --git a/virt-xml b/virt-xml
index e0495029..30fee7c7 100755
--- a/virt-xml
+++ b/virt-xml
@@ -68,13 +68,6 @@ def get_diff(origxml, newxml):
return ret
-def _make_guest(conn, xml):
- # We do this to minimize the diff, sanitizing XML quotes to what libxml
- # generates
- return virtinst.Guest(conn,
- parsexml=virtinst.Guest(conn, parsexml=xml).get_xml_config())
-
-
def get_domain_and_guest(conn, domstr):
try:
int(domstr)
@@ -97,11 +90,11 @@ def get_domain_and_guest(conn, domstr):
state = domain.info()[0]
active_xmlobj = None
- inactive_xmlobj = _make_guest(conn, domain.XMLDesc(0))
+ inactive_xmlobj = virtinst.Guest(conn, parsexml=domain.XMLDesc(0))
if state != libvirt.VIR_DOMAIN_SHUTOFF:
active_xmlobj = inactive_xmlobj
- inactive_xmlobj = _make_guest(conn,
- domain.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE))
+ inactive_xmlobj = virtinst.Guest(conn,
+ parsexml=domain.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE))
return (domain, inactive_xmlobj, active_xmlobj)
@@ -440,7 +433,7 @@ def main(conn=None):
domain, inactive_xmlobj, active_xmlobj = get_domain_and_guest(
conn, options.domain)
elif not options.build_xml:
- inactive_xmlobj = _make_guest(conn, options.stdinxml)
+ inactive_xmlobj = virtinst.Guest(conn, options.stdinxml)
check_action_collision(options)
parserclass = check_xmlopt_collision(options)