diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 42a255cd6d..2eaac9ad8c 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -578,7 +578,6 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) const char *alias = NULL; struct DiskAddress diskAddr; bool isFile = false; - bool functionReturn = false; int ret; unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT; const char *stype = NULL; @@ -615,7 +614,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) vshCommandOptStringReq(ctl, cmd, "targetbus", &targetbus) < 0 || vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0 || vshCommandOptStringReq(ctl, cmd, "sourcetype", &stype) < 0) - goto cleanup; + return false; if (!stype) { if (driver && (STREQ(driver, "file") || STREQ(driver, "tap"))) { @@ -628,19 +627,19 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) isFile = true; } else if (STRNEQ(stype, "block")) { vshError(ctl, _("Unknown source type: '%s'"), stype); - goto cleanup; + return false; } if (mode) { if (STRNEQ(mode, "readonly") && STRNEQ(mode, "shareable")) { vshError(ctl, _("No support for %s in command 'attach-disk'"), mode); - goto cleanup; + return false; } } if (wwn && !virValidateWWN(wwn)) - goto cleanup; + return false; /* Make XML of disk */ virBufferAsprintf(&buf, "