virt-xml: fix defined_xml_is_unchanged

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>
This commit is contained in:
Pavel Hrdina 2019-12-03 13:02:21 +01:00
parent 5f0155508d
commit 29f9f5f2d7
1 changed files with 2 additions and 2 deletions

View File

@ -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
################