mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
virt-xml: If no XML diff is generated, explicitly warn
This commit is contained in:
parent
9ed926a898
commit
0221471e4f
@ -1088,7 +1088,7 @@ c.add_valid("--sound=? --tpm=?") # basic introspection test
|
||||
c.add_valid("test-state-shutoff --edit --update --boot menu=on") # --update with inactive VM, should work but warn
|
||||
c.add_valid("test-for-virtxml --edit --graphics password=foo --update --confirm", input_text="no\nno\n") # prompt exiting
|
||||
c.add_valid("test-for-virtxml --edit --cpu host-passthrough --no-define --start --confirm", input_text="no") # transient prompt exiting
|
||||
c.add_valid("test-for-virtxml --edit --metadata name=test-for-virtxml") # 'no diff' code path
|
||||
c.add_valid("test-for-virtxml --edit --metadata name=test-for-virtxml", grep="requested changes will have no effect")
|
||||
c.add_invalid("test --edit 2 --events on_poweroff=destroy", grep="'--edit 2' doesn't make sense with --events")
|
||||
c.add_invalid("test --os-variant fedora26 --edit --cpu host-passthrough", grep="--os-variant is not supported")
|
||||
c.add_invalid("test-for-virtxml --os-variant fedora26 --remove-device --disk 1", grep="--os-variant is not supported")
|
||||
|
4
virt-xml
4
virt-xml
@ -333,6 +333,10 @@ def prepare_changes(xmlobj, options, parserclass):
|
||||
newxml = xmlobj.get_xml()
|
||||
diff = get_diff(origxml, newxml)
|
||||
|
||||
if not diff:
|
||||
logging.warning(_("No XML diff was generated. The requested "
|
||||
"changes will have no effect."))
|
||||
|
||||
if options.print_diff:
|
||||
if diff:
|
||||
print_stdout(diff)
|
||||
|
Loading…
Reference in New Issue
Block a user