From: Mark McLoughlin Date: Thu, 7 Feb 2008 10:17:24 +0000 (+0000) Subject: src/iptables.c: Create directory for saving iptables rules X-Git-Tag: LIBVIRT_0_4_1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d3c8ac4c4ace29cf92e5561c9b9489737e39fe0;p=thirdparty%2Flibvirt.git src/iptables.c: Create directory for saving iptables rules --- diff --git a/ChangeLog b/ChangeLog index 2752b7ff13..242dae577b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 7 10:16:42 IST 2008 Mark McLoughlin + + * src/iptables.c: Create directory for saving iptables rules + Thu Feb 7 10:12:15 IST 2008 Mark McLoughlin * src/xm_internal.[ch]: Move static function prototype from header diff --git a/src/iptables.c b/src/iptables.c index dc2225aac0..e8d1182ae7 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -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));