Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 14

libvirt-0.8.2-29.el5.src.rpm

From dc653ff1d221391d98fa20923ac46d4f8892606c Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Thu, 27 Oct 2011 15:40:32 -0600
Subject: [PATCH] Add missing error reporting when loading mac filter config
 for QEMU
To: libvir-list@redhat.com

https://bugzilla.redhat.com/show_bug.cgi?id=747514

If the 'mac_filter' configuration parameter is enabled, and there
is a failure to enable filtering, no error is reported back to
the caller. Also fix some bogus whitespace indentation for
hugetlbfs_mount

* src/qemu/qemu_conf.c: Add missing error reporting
(cherry picked from commit c24c07f40be4346e08885ce0597604368d5dc7f3)

Conflicts:

	src/qemu/qemu_conf.c - context: 95a17ab and e19cdbf are not present

Signed-off-by: Daniel Veillard <veillard@redhat.com>
---
 src/qemu/qemu_conf.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 532e691..735d2d3 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -325,16 +325,16 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
         }
     }
 
-     p = virConfGetValue (conf, "hugetlbfs_mount");
-     CHECK_TYPE ("hugetlbfs_mount", VIR_CONF_STRING);
-     if (p && p->str) {
-         VIR_FREE(driver->hugetlbfs_mount);
-         if (!(driver->hugetlbfs_mount = strdup(p->str))) {
-             virReportOOMError();
-             virConfFree(conf);
-             return -1;
-         }
-     }
+    p = virConfGetValue (conf, "hugetlbfs_mount");
+    CHECK_TYPE ("hugetlbfs_mount", VIR_CONF_STRING);
+    if (p && p->str) {
+        VIR_FREE(driver->hugetlbfs_mount);
+        if (!(driver->hugetlbfs_mount = strdup(p->str))) {
+            virReportOOMError();
+            virConfFree(conf);
+            return -1;
+        }
+    }
 
     p = virConfGetValue (conf, "mac_filter");
     CHECK_TYPE ("mac_filter", VIR_CONF_LONG);
@@ -345,12 +345,16 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
             virReportSystemError(errno,
                                  _("failed to enable mac filter in '%s'"),
                                  __FILE__);
+            virConfFree(conf);
+            return -1;
         }
 
         if ((errno = networkDisableAllFrames(driver))) {
             virReportSystemError(errno,
                          _("failed to add rule to drop all frames in '%s'"),
                                  __FILE__);
+            virConfFree(conf);
+            return -1;
         }
     }
 
-- 
1.7.4.4