summaryrefslogtreecommitdiff
path: root/virt-clone
diff options
context:
space:
mode:
authorKothapally Madhu Pavan <kmp@linux.vnet.ibm.com>2016-08-19 03:53:43 -0400
committerCole Robinson <crobinso@redhat.com>2016-09-02 14:10:17 -0400
commitd10776288078c10c296fd8cdab47155935dfa79f (patch)
treeb06f0e27cf966b6251a18dc88fe3c755a3c14d14 /virt-clone
parentc050bf45fa316223c98d6234d8e590ce90373738 (diff)
downloadvirt-manager-d10776288078c10c296fd8cdab47155935dfa79f.tar.gz
Error out cleanly when autoclone or destination file is not specified
When virt-clone is used without autoclone or destination file, libvirt errors with message "ERROR missing source information for device vda". This doesn't convey what is missing. This patch will indicate which options to use. Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
Diffstat (limited to 'virt-clone')
-rwxr-xr-xvirt-clone6
1 files changed, 6 insertions, 0 deletions
diff --git a/virt-clone b/virt-clone
index 00d0e30e..905c91ed 100755
--- a/virt-clone
+++ b/virt-clone
@@ -168,6 +168,12 @@ def main(conn=None):
if conn is None:
conn = cli.getConnection(options.connect)
+ if (options.new_diskfile is None and
+ options.auto_clone is False and
+ options.xmlonly is False):
+ fail(_("Either --auto-clone or --file is required,"
+ " use '--auto-clone or --file' and try again."))
+
design = Cloner(conn)
design.clone_running = options.clone_running