virsh: Fix return code for dump

After the commit dc0771c, ret variable no longer
represents the status of the return code, use
data->ret replace it.

Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Xu Yandong 2020-05-04 16:36:19 +08:00 committed by Andrea Bolognani
parent 7b0f46343c
commit 5534e4e659

View File

@ -5522,7 +5522,6 @@ static bool
cmdDump(vshControl *ctl, const vshCmd *cmd) cmdDump(vshControl *ctl, const vshCmd *cmd)
{ {
virDomainPtr dom; virDomainPtr dom;
bool ret = false;
bool verbose = false; bool verbose = false;
const char *name = NULL; const char *name = NULL;
const char *to = NULL; const char *to = NULL;
@ -5556,12 +5555,12 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
virThreadJoin(&workerThread); virThreadJoin(&workerThread);
if (!ret) if (!data.ret)
vshPrintExtra(ctl, _("\nDomain %s dumped to %s\n"), name, to); vshPrintExtra(ctl, _("\nDomain %s dumped to %s\n"), name, to);
cleanup: cleanup:
virshDomainFree(dom); virshDomainFree(dom);
return !ret; return !data.ret;
} }
static const vshCmdInfo info_screenshot[] = { static const vshCmdInfo info_screenshot[] = {