]> xenbits.xensource.com Git - libvirt.git/commit
network: log error for unknown virNetworkUpdate command codes
authorLaine Stump <laine@laine.org>
Fri, 21 Sep 2012 16:11:51 +0000 (12:11 -0400)
committerLaine Stump <laine@laine.org>
Sat, 22 Sep 2012 00:10:43 +0000 (20:10 -0400)
commit5cdcb75d459f2fe42255fef4338816f7088dd0b5
tree4e429d89ac06e76b2d979d208b35097482891da0
parentf59e25e012001911f565b1fb60d5353cd72d78e4
network: log error for unknown virNetworkUpdate command codes

Every level of the code for virNetworkUpdate was assuming that some
other level was checking for validity of the "command" arg, but none
actually were. The result was that an invalid command code would do
nothing, but also report success.

Since the command code isn't used until the very lowest level backend
functions, that's where I put the check. I made a separate one-line
function to log the error. The compiler would have combined the
identical strings used by multiple calls if I'd just called
virReportError directly in each location, but sending them all to the
same string in the source guards against inadvertant divergence (which
would lead to extra work for translators.)
src/conf/network_conf.c