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

Mark McLoughlin <markmc@redhat.com> wrote:
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));
+1, modulo what looks like a missing comma after QEMUD_WARN

On Thu, Feb 07, 2008 at 09:16:47AM +0100, Jim Meyering wrote:
Mark McLoughlin <markmc@redhat.com> wrote:
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));
+1, modulo what looks like a missing comma after QEMUD_WARN
Agreed :-) +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Thu, 2008-02-07 at 05:03 -0500, Daniel Veillard wrote:
On Thu, Feb 07, 2008 at 09:16:47AM +0100, Jim Meyering wrote:
Mark McLoughlin <markmc@redhat.com> wrote:
+ if ((err = writeRules(rules->path, rules->rules, rules->nrules))) { qemudLog(QEMUD_WARN, "Failed to saves iptables rules to %s : %s", rules->path, strerror(err));
+1, modulo what looks like a missing comma after QEMUD_WARN
Agreed :-) +1
Nice catch Jim ... I'm still note quite sure why there was no warning on that one ... Cheers, Mark.
participants (3)
-
Daniel Veillard
-
Jim Meyering
-
Mark McLoughlin