[libvirt] [PATCH v2] Use virGetLastErrorMessage() rather than open code it
Cole Robinson
crobinso at redhat.com
Mon Apr 11 11:39:33 UTC 2016
On 04/10/2016 10:40 PM, 惠轶群 wrote:
> 2016-04-08 23:12 GMT+08:00 Cole Robinson <crobinso at redhat.com>:
>> When sending a v2, please give a description of what changed compared to the
>> previous patch version, after the --- break so it doesn't show up in the
>> commit message. For example:
>
> Nice proposal. Thanks.
>>
>> On 04/04/2016 06:49 AM, Hui Yiqun wrote:
>>> getting err using virGetLastError() and then retrieving
>>> message from err asks developers to test the value
>>> of err and err->message and default to self-defined
>>> unkown error message.
>>>
>>> It's better to avoid it and use uniform
>>> virGetLastErrorMessage
>>> ---
>>
>> v2:
>> * Fixed the FOO
>> * Replaces the BAZ
>> * etc
>>
>>> daemon/libvirtd.c | 8 +---
>>> examples/object-events/event-test.c | 9 ++---
>>> src/bhyve/bhyve_driver.c | 3 +-
>>> src/libvirt.c | 3 +-
>>> src/libxl/libxl_domain.c | 3 +-
>>> src/libxl/libxl_driver.c | 3 +-
>>> src/locking/lock_daemon.c | 8 +---
>>> src/logging/log_daemon.c | 8 +---
>>> src/lxc/lxc_container.c | 8 +---
>>> src/lxc/lxc_controller.c | 8 +---
>>> src/lxc/lxc_domain.c | 3 +-
>>> src/lxc/lxc_process.c | 6 +--
>>> src/network/bridge_driver.c | 3 +-
>>> src/node_device/node_device_hal.c | 3 +-
>>> src/rpc/virnettlscontext.c | 3 +-
>>> src/secret/secret_driver.c | 6 +--
>>> src/storage/storage_driver.c | 16 ++------
>>> src/uml/uml_driver.c | 3 +-
>>> src/util/iohelper.c | 10 +----
>>> src/util/virhook.c | 3 +-
>>> src/util/virhostdev.c | 20 ++++-----
>>> tests/commandtest.c | 81 +++++++++++++------------------------
>>> tests/libvirtdconftest.c | 3 +-
>>> tests/openvzutilstest.c | 7 +---
>>> tests/securityselinuxlabeltest.c | 9 ++---
>>> tests/securityselinuxtest.c | 6 +--
>>> tests/virnettlscontexttest.c | 3 +-
>>> 27 files changed, 77 insertions(+), 169 deletions(-)
>>
>> There's still at least one build error 'error: unused
>> variable 'err'' in here. Please review the code carefully, or only send the
>> patch targetting the drivers that you can actually build test.
>
> It's strange that it could be build on my machine and `make syntax-check` also
> passed.
Make sure you configured with --enable-werror, otherwise it might just be a
non-fatal warning that is lost in the compiler output
- Cole
More information about the libvir-list
mailing list