From dca027a9b7dd30925eaa309443c87ac414436032 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 1 May 2014 17:24:45 +0100 Subject: [PATCH] Misc error reporting bugs in QEMU cli builder A couple of places in the QEMU XML -> ARGV conversion code raised an error but then forgot to return an error status due to missing gotos. While fixing this also tweak style of a couple of other error reports Signed-off-by: Daniel P. Berrange --- src/qemu/qemu_command.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 961c679f6a..96072cf358 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8153,7 +8153,8 @@ qemuBuildCommandLine(virConnectPtr conn, is to raise an error if present="yes" */ if (def->clock.timers[i]->present == 1) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("pit timer is not supported")); + "%s", _("hpet timer is not supported")); + goto error; } } break; @@ -8197,7 +8198,7 @@ qemuBuildCommandLine(virConnectPtr conn, if (def->pm.s4) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISABLE_S4)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("setting ACPI S4 not supported")); goto error; } @@ -8669,6 +8670,7 @@ qemuBuildCommandLine(virConnectPtr conn, } else if (disk->src.type == VIR_STORAGE_TYPE_NETWORK) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("network disks are only supported with -drive")); + goto error; } else { if (VIR_STRDUP(file, disk->src.path) < 0) { goto error; @@ -10451,7 +10453,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, _("invalid device name '%s'"), def->dst); virDomainDiskDefFree(def); def = NULL; - /* fall through to "cleanup" */ + goto cleanup; } cleanup: -- GitLab