cmdCPUCompare(vshControl *ctl, const vshCmd *cmd)
{
const char *from = NULL;
- bool ret = false;
int result;
g_auto(GStrv) cpus = NULL;
unsigned int flags = 0;
case VIR_CPU_COMPARE_INCOMPATIBLE:
vshPrint(ctl, _("CPU described in %s is incompatible with host CPU\n"),
from);
- goto cleanup;
+ return false;
break;
case VIR_CPU_COMPARE_IDENTICAL:
case VIR_CPU_COMPARE_ERROR:
default:
vshError(ctl, _("Failed to compare host CPU with %s"), from);
- goto cleanup;
+ return false;
}
- ret = true;
-
- cleanup:
- return ret;
+ return true;
}
/*
const char *emulator = NULL;
const char *arch = NULL;
const char *machine = NULL;
- bool ret = false;
int result;
g_auto(GStrv) cpus = NULL;
unsigned int flags = 0;
_("CPU described in %s is incompatible with the CPU provided "
"by hypervisor on the host\n"),
from);
- goto cleanup;
+ return false;
break;
case VIR_CPU_COMPARE_IDENTICAL:
case VIR_CPU_COMPARE_ERROR:
default:
vshError(ctl, _("Failed to compare hypervisor CPU with %s"), from);
- goto cleanup;
+ return false;
}
- ret = true;
-
- cleanup:
- return ret;
+ return true;
}
bool
cmdComplete(vshControl *ctl, const vshCmd *cmd)
{
- bool ret = false;
const vshClientHooks *hooks = ctl->hooks;
int stdin_fileno = STDIN_FILENO;
const char *arg = "";
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
if (vshCommandOptStringQuiet(ctl, cmd, "string", &arg) <= 0)
- goto cleanup;
+ return false;
/* This command is flagged VSH_CMD_FLAG_NOCONNECT because we
* need to prevent auth hooks reading any input. Therefore, we
VIR_FORCE_CLOSE(stdin_fileno);
if (!(hooks && hooks->connHandler && hooks->connHandler(ctl)))
- goto cleanup;
+ return false;
while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (virBufferUse(&buf) != 0)
rl_point = strlen(rl_line_buffer);
if (!(matches = vshReadlineCompletion(arg, 0, 0)))
- goto cleanup;
+ return false;
for (iter = matches; *iter; iter++) {
if (iter == matches && matches[1])
printf("%s\n", *iter);
}
- ret = true;
- cleanup:
- return ret;
+ return true;
}