src/iptables.c: Create directory for saving iptables rules

This commit is contained in:
Mark McLoughlin 2008-02-07 10:17:24 +00:00
parent f90cd4c3f4
commit 3d3c8ac4c4
2 changed files with 10 additions and 0 deletions

View File

@ -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

View 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));