mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +00:00
virsh: Fix return code for dump and migrate
When the job monitoring logic was refactored, these two commands
were not converted properly and the result is that a successful
dump or migration (char '0') would be reported as a failed one
(int 48) instead.
Fixes: dc0771cfa2
Reported-by: Brian Rak <brak@gameservers.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
9ced95a49c
commit
fbc4e81a36
@ -5436,7 +5436,6 @@ static const vshCmdOptDef opts_dump[] = {
|
|||||||
static void
|
static void
|
||||||
doDump(void *opaque)
|
doDump(void *opaque)
|
||||||
{
|
{
|
||||||
char ret = '1';
|
|
||||||
virshCtrlData *data = opaque;
|
virshCtrlData *data = opaque;
|
||||||
vshControl *ctl = data->ctl;
|
vshControl *ctl = data->ctl;
|
||||||
const vshCmd *cmd = data->cmd;
|
const vshCmd *cmd = data->cmd;
|
||||||
@ -5508,7 +5507,7 @@ doDump(void *opaque)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = '0';
|
data->ret = 0;
|
||||||
out:
|
out:
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
|
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
|
||||||
@ -5516,7 +5515,6 @@ doDump(void *opaque)
|
|||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
if (dom)
|
if (dom)
|
||||||
virshDomainFree(dom);
|
virshDomainFree(dom);
|
||||||
data->ret = ret;
|
|
||||||
g_main_loop_quit(data->eventLoop);
|
g_main_loop_quit(data->eventLoop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10722,7 +10720,6 @@ static const vshCmdOptDef opts_migrate[] = {
|
|||||||
static void
|
static void
|
||||||
doMigrate(void *opaque)
|
doMigrate(void *opaque)
|
||||||
{
|
{
|
||||||
char ret = '1';
|
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
const char *desturi = NULL;
|
const char *desturi = NULL;
|
||||||
const char *opt = NULL;
|
const char *opt = NULL;
|
||||||
@ -11001,14 +10998,14 @@ doMigrate(void *opaque)
|
|||||||
|
|
||||||
if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) {
|
if (flags & VIR_MIGRATE_PEER2PEER || vshCommandOptBool(cmd, "direct")) {
|
||||||
if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0)
|
if (virDomainMigrateToURI3(dom, desturi, params, nparams, flags) == 0)
|
||||||
ret = '0';
|
data->ret = 0;
|
||||||
} else {
|
} else {
|
||||||
/* For traditional live migration, connect to the destination host directly. */
|
/* For traditional live migration, connect to the destination host directly. */
|
||||||
virDomainPtr ddom = NULL;
|
virDomainPtr ddom = NULL;
|
||||||
|
|
||||||
if ((ddom = virDomainMigrate3(dom, dconn, params, nparams, flags))) {
|
if ((ddom = virDomainMigrate3(dom, dconn, params, nparams, flags))) {
|
||||||
virshDomainFree(ddom);
|
virshDomainFree(ddom);
|
||||||
ret = '0';
|
data->ret = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11019,7 +11016,6 @@ doMigrate(void *opaque)
|
|||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
virTypedParamsFree(params, nparams);
|
virTypedParamsFree(params, nparams);
|
||||||
virshDomainFree(dom);
|
virshDomainFree(dom);
|
||||||
data->ret = ret;
|
|
||||||
g_main_loop_quit(data->eventLoop);
|
g_main_loop_quit(data->eventLoop);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user