[PATCH 10/17] Fix missing jump to error cleanup in qemuParseCommandLineDisk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]