]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
util: consolidate duplicated error messages in virnetlink.c
authorLaine Stump <laine@laine.org>
Tue, 6 Mar 2012 17:21:21 +0000 (12:21 -0500)
committerLaine Stump <laine@laine.org>
Thu, 8 Mar 2012 21:58:09 +0000 (16:58 -0500)
commit879bcee08ce0f91f556fddfe452c3fbed5318468
treec8d740187964cb74114981e805455c494167c2c4
parentd403b84cf332e0f4608b8837b2b2e4b342c78abf
util: consolidate duplicated error messages in virnetlink.c

There are special stub versions of all public functions in this file
that are compiled when either libnl isn't available or the platform
isn't linux. Each of these functions had two almost identical message,
differing only in the function name included in the message. Since log
messages already contain the function name, we can just define a const
char* with the common part of the string, and use that same string for
all the log messages.

Also, rather than doing #if defined ... #else ... #endif *inside the
error log macro invocation*, this patch does #if defined ... just
once, using it to decide which single string to define. This turns the
error log in each function from 6 lines, to 1 line.
src/util/virnetlink.c