render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
9119d9
From 0a11b90fc609d5ff7c32f2f25ff25a4e7d4013d9 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <0a11b90fc609d5ff7c32f2f25ff25a4e7d4013d9@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Fri, 19 Sep 2014 08:32:36 -0400
9119d9
Subject: [PATCH] qemu: Add missing goto on rawio
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1103739
9119d9
9119d9
Commit id '9a2f36ec' added a build conditional of CAP_SYS_RAWIO
9119d9
in order to determine whether or not a disk definition using rawio
9119d9
should be allowed on platforms without CAP_SYS_RAWIO. If one was
9119d9
found, virReportError was used but the code didn't goto cleanup.
9119d9
9119d9
This patch adds the goto.
9119d9
9119d9
(cherry picked from commit 8921d48868652e7dbb67aa7c77035ac2d5ccb5a3)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_process.c | 4 +++-
9119d9
 1 file changed, 3 insertions(+), 1 deletion(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9119d9
index a0eb845..528b6eb 100644
9119d9
--- a/src/qemu/qemu_process.c
9119d9
+++ b/src/qemu/qemu_process.c
9119d9
@@ -4355,13 +4355,15 @@ int qemuProcessStart(virConnectPtr conn,
9119d9
         virDomainDeviceDef dev;
9119d9
         virDomainDiskDefPtr disk = vm->def->disks[i];
9119d9
 
9119d9
-        if (vm->def->disks[i]->rawio == 1)
9119d9
+        if (vm->def->disks[i]->rawio == 1) {
9119d9
 #ifdef CAP_SYS_RAWIO
9119d9
             virCommandAllowCap(cmd, CAP_SYS_RAWIO);
9119d9
 #else
9119d9
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
9119d9
                            _("Raw I/O is not supported on this platform"));
9119d9
+            goto cleanup;
9119d9
 #endif
9119d9
+        }
9119d9
 
9119d9
         dev.type = VIR_DOMAIN_DEVICE_DISK;
9119d9
         dev.data.disk = disk;
9119d9
-- 
9119d9
2.1.1
9119d9