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

[Libvir] [patch 1/2] Create directory for saving iptables rules



The patch which reworked the iptables rules saving
accidently dropped the call to virFileMakePath()
resulting in:

  Failed to saves iptables rules to /var/lib/libvirt/iptables/filter/INPUT.chain : No such file or directory

Re-instate the virFileMakePath() call.

Signed-off-by: Mark McLoughlin <markmc redhat com>

Index: libvirt/src/iptables.c
===================================================================
--- libvirt.orig/src/iptables.c	2008-02-06 23:14:28.000000000 +0000
+++ libvirt/src/iptables.c	2008-02-06 23:15:33.000000000 +0000
@@ -238,6 +238,12 @@
 #ifdef ENABLE_IPTABLES_LOKKIT
     int err;
 
+    if ((err = virFileMakePath(rules->dir))) {
+        qemudLog(QEMUD_WARN "Failed to create directory %s : %s",
+                 rules->dir, strerror(err));
+        return;
+    }
+
     if ((err = writeRules(rules->path, rules->rules, rules->nrules))) {
         qemudLog(QEMUD_WARN, "Failed to saves iptables rules to %s : %s",
                  rules->path, strerror(err));

-- 


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