提交 c41a21de 编写于 作者: A Alex Jia 提交者: Michal Privoznik

virsh: improve doMigrate function docs

When running virsh migrate with --xml option and actual xml file doesn't
exist, virsh hasn't output any error information, although return value
is 1.

* tools/virsh.c: Raising a appropriate error information when operation fails.

* How to reproduce?
% virsh migrate <domain> --live qemu+ssh://<target host>/system --xml non-existent.xml
% echo $?

* Fixed result:
error: file 'non-existent.xml' doesn't exist
Signed-off-by: NAlex Jia <ajia@redhat.com>
上级 99be754a
......@@ -6338,9 +6338,10 @@ doMigrate (void *opaque)
flags |= VIR_MIGRATE_CHANGE_PROTECTION;
if (xmlfile &&
virFileReadAll(xmlfile, 8192, &xml) < 0)
virFileReadAll(xmlfile, 8192, &xml) < 0) {
vshError(ctl, _("file '%s' doesn't exist"), xmlfile);
goto out;
}
if ((flags & VIR_MIGRATE_PEER2PEER) ||
vshCommandOptBool (cmd, "direct")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册