]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add missing error reporting when loading mac filter config for QEMU
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 14 Jun 2011 08:11:31 +0000 (09:11 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 17 Jun 2011 10:02:13 +0000 (11:02 +0100)
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

src/qemu/qemu_conf.c

index ea4d7d00597a26d4345de247c776699e9111185c..46f6976094056bb29935194802a55ce3f3f12ea2 100644 (file)
@@ -378,16 +378,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);
@@ -398,12 +398,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;
         }
     }