virt-manager/29f9f5f2-virt-xml-fix-defined_xml_is_unchanged.patch
2019-12-03 17:38:59 +00:00

28 lines
979 B
Diff

Subject: virt-xml: fix defined_xml_is_unchanged
From: Pavel Hrdina phrdina@redhat.com Tue Dec 3 13:02:21 2019 +0100
Date: Tue Dec 3 13:04:37 2019 +0100:
Git: 29f9f5f2d7f47fe6cc3333f2a9e6c6209db5a8f3
Commit <53f075ab76e1c372474ae0d88f202e487d9f213f> added a warning if the
VM XML is not changed after removing default devices but the code was
incorrect. We have to compare strings instead of string vs Guest object
and also the condition was inverted.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
diff --git a/virt-xml b/virt-xml
index 71445c9f..7b0174c9 100755
--- a/virt-xml
+++ b/virt-xml
@@ -105,8 +105,8 @@ def get_domain_and_guest(conn, domstr):
def defined_xml_is_unchanged(conn, domain, original_xml):
rawxml = get_xmldesc(domain, inactive=True)
- new_xml = virtinst.Guest(conn, parsexml=rawxml)
- return new_xml != original_xml
+ new_xml = virtinst.Guest(conn, parsexml=rawxml).get_xml()
+ return new_xml == original_xml
################