From 4a58a689db05e34af56cd96b7a6036cfeb2a9726 Mon Sep 17 00:00:00 2001 From: "David H. Gutteridge" Date: Wed, 28 Mar 2018 20:46:13 -0400 Subject: [PATCH] virt-xml: Warn when --update is inapplicable --- virt-xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/virt-xml b/virt-xml index eef623302..a287fd76c 100755 --- a/virt-xml +++ b/virt-xml @@ -430,9 +430,13 @@ def main(conn=None): print_stdout(dev.get_xml_config()) return 0 - if options.update and active_xmlobj: - devs, action = prepare_changes(active_xmlobj, options, parserclass) - update_changes(domain, devs, action, options.confirm) + if options.update: + if active_xmlobj: + devs, action = prepare_changes(active_xmlobj, options, parserclass) + update_changes(domain, devs, action, options.confirm) + else: + logging.warning( + _("The VM is not running, --update is inapplicable.")) if options.define: devs, action = prepare_changes(inactive_xmlobj, options, parserclass) applied = define_changes(conn, inactive_xmlobj,