mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
bhyve: eliminate unnecessary labels
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
84fddfed45
commit
ac59ecc9f8
@ -169,7 +169,6 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
const char *disk_source;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
g_auto(virBuffer) device = VIR_BUFFER_INITIALIZER;
|
||||
@ -187,11 +186,11 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
|
||||
(virDomainDiskGetType(disk) != VIR_STORAGE_TYPE_VOLUME)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("unsupported disk type"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virDomainDiskTranslateSourcePool(disk) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
disk_source = virDomainDiskGetSource(disk);
|
||||
|
||||
@ -200,7 +199,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("cdrom device without source path "
|
||||
"not supported"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (disk->device) {
|
||||
@ -219,7 +218,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("unsupported disk device"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
virBufferAddBuffer(&buf, &device);
|
||||
}
|
||||
@ -229,9 +228,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
|
||||
controller->info.addr.pci.slot,
|
||||
virBufferCurrentContent(&buf));
|
||||
|
||||
ret = 0;
|
||||
error:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -406,7 +403,7 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
|
||||
if (!(glisten = virDomainGraphicsGetListen(graphics, 0))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Missing listen element"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
virBufferAsprintf(&opt, "%d:%d,fbuf", video->info.addr.pci.slot, video->info.addr.pci.function);
|
||||
@ -421,13 +418,13 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
|
||||
graphics->data.vnc.port > 65535)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("vnc port must be in range [5900,65535]"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (graphics->data.vnc.auth.passwd) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("vnc password auth not supported"));
|
||||
goto error;
|
||||
return -1;
|
||||
} else {
|
||||
/* Bhyve doesn't support VNC Auth yet, so print a warning about
|
||||
* unauthenticated VNC sessions */
|
||||
@ -461,11 +458,11 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
|
||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Unsupported listen type"));
|
||||
goto error;
|
||||
return -1;
|
||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST:
|
||||
default:
|
||||
virReportEnumRangeError(virDomainGraphicsListenType, glisten->type);
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (video->driver)
|
||||
@ -476,8 +473,6 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
|
||||
virCommandAddArgBuffer(cmd, &opt);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
virCommandPtr
|
||||
|
Loading…
x
Reference in New Issue
Block a user