]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: change cleanup: to success/cleanup/error: in network*() functions
authorLaine Stump <laine@laine.org>
Mon, 6 Aug 2012 17:45:57 +0000 (13:45 -0400)
committerLaine Stump <laine@laine.org>
Wed, 15 Aug 2012 03:53:58 +0000 (23:53 -0400)
commit4fee4e052a3e65aafe637779b030b07a3d83a962
tree4880bc0109facd7e1786fb1de6ee0f69126cc1a1
parent92a830408124c85f54a2222465a2e9a0ebff9d7e
network: change cleanup: to success/cleanup/error: in network*() functions

A later patch will be adding a counter that will be
incremented/decremented each time an guest interface starts/stops
using a particular network. For this to work, all types of networks
need to go through a common return sequence rather than returning
early. To setup for this, a new success: label is added (when
necessary), a new error: label is added which does any cleanup
necessary only for error returns and then does goto cleanup, and early
returns are changed to goto error if it's a failure, or goto success
if it's successful. This way the intent of all the gotos is
unambiguous, and a successful return path never encounters the
"error:" label.
src/network/bridge_driver.c