[libvirt] [PATCH 10/17] Fix missing jump to error cleanup in qemuParseCommandLineDisk
Doug Goldstein
cardoe at gentoo.org
Tue Sep 24 21:25:35 UTC 2013
On Tue, Sep 24, 2013 at 11:04 AM, Daniel P. Berrange
<berrange at redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> In a number of places in qemuParseCommandLineDisk, an error
> is reported, but no 'goto error' jump is used. This causes
> failure to report OOM conditions to the caler.
s/caler/caller/
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
> src/qemu/qemu_command.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index f6a3aa2..fe53cf7 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -10068,6 +10068,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> if ((def->iomode = virDomainDiskIoTypeFromString(values[i])) < 0) {
> virReportError(VIR_ERR_INTERNAL_ERROR,
> _("cannot parse io mode '%s'"), values[i]);
> + goto error;
> }
> } else if (STREQ(keywords[i], "cyls")) {
> if (virStrToLong_ui(values[i], NULL, 10,
> @@ -10077,6 +10078,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> virReportError(VIR_ERR_INTERNAL_ERROR,
> _("cannot parse cylinders value'%s'"),
> values[i]);
> + goto error;
> }
> } else if (STREQ(keywords[i], "heads")) {
> if (virStrToLong_ui(values[i], NULL, 10,
> @@ -10086,6 +10088,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> virReportError(VIR_ERR_INTERNAL_ERROR,
> _("cannot parse heads value'%s'"),
> values[i]);
> + goto error;
> }
> } else if (STREQ(keywords[i], "secs")) {
> if (virStrToLong_ui(values[i], NULL, 10,
> @@ -10095,6 +10098,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> virReportError(VIR_ERR_INTERNAL_ERROR,
> _("cannot parse sectors value'%s'"),
> values[i]);
> + goto error;
> }
> } else if (STREQ(keywords[i], "trans")) {
> def->geometry.trans =
> @@ -10106,6 +10110,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> virReportError(VIR_ERR_INTERNAL_ERROR,
> _("cannot parse translation value'%s'"),
> values[i]);
> + goto error;
> }
> }
> }
> --
> 1.8.3.1
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
ACK. Typo above in commit message.
--
Doug Goldstein
More information about the libvir-list
mailing list