]> xenbits.xensource.com Git - libvirt.git/commitdiff
src/iptables.c: Create directory for saving iptables rules
authorMark McLoughlin <markmc@redhat.com>
Thu, 7 Feb 2008 10:17:24 +0000 (10:17 +0000)
committerMark McLoughlin <markmc@redhat.com>
Thu, 7 Feb 2008 10:17:24 +0000 (10:17 +0000)
ChangeLog
src/iptables.c

index 2752b7ff1370eeea14cc6e9ae9508d5745b23125..242dae577b4a3370dccc68fa524f0df649d2e93d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Feb  7 10:16:42 IST 2008 Mark McLoughlin <markmc@redhat.com>
+
+       * src/iptables.c: Create directory for saving iptables rules
+       
 Thu Feb  7 10:12:15 IST 2008 Mark McLoughlin <markmc@redhat.com>
 
        * src/xm_internal.[ch]: Move static function prototype from header
index dc2225aac0b72017e896250a8deb3cb50c8422e3..e8d1182ae714aa033e09a8f794734abec097693a 100644 (file)
@@ -238,6 +238,12 @@ iptRulesSave(iptRules *rules)
 #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));