[libvirt] [PATCH 1/2] qemu: return error condition

--- src/qemu/qemu_bridge_filter.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c index f700631..03ed284 100644 --- a/src/qemu/qemu_bridge_filter.c +++ b/src/qemu/qemu_bridge_filter.c @@ -78,6 +78,7 @@ networkAllowMacOnPort(struct qemud_driver *driver, virReportSystemError(err, _("failed to add ebtables rule to allow routing to '%s'"), ifname); + return err; } return 0; @@ -99,6 +100,7 @@ networkDisallowMacOnPort(struct qemud_driver *driver, virReportSystemError(err, _("failed to add ebtables rule to allow routing to '%s'"), ifname); + return err; } return 0; -- 1.7.0.4

On 07/08/2011 09:13 AM, Michael Santos wrote:
--- src/qemu/qemu_bridge_filter.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c index f700631..03ed284 100644 --- a/src/qemu/qemu_bridge_filter.c +++ b/src/qemu/qemu_bridge_filter.c @@ -78,6 +78,7 @@ networkAllowMacOnPort(struct qemud_driver *driver, virReportSystemError(err, _("failed to add ebtables rule to allow routing to '%s'"), ifname); + return err; }
return 0;
Good catch. However, we now have a problem - networkAlloMacOnPort is issuing an error, and the caller, qemuPhysIfaceConnect, will now overwrite that error. Furthermore, qemuPhysIfaceConnect is not doing any special return handling on error, either. I think we need a v2 of this patch that propagates the error return all the way up the call chain, while still only emitting the error once. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Michael Santos