[libvirt] [PATCH] event: clean up client side RPC code

Michal Privoznik mprivozn at redhat.com
Wed Jan 8 17:51:36 UTC 2014


On 08.01.2014 18:23, Eric Blake wrote:
> Commit cfd62c1 was incomplete; I found more cases where error
> messages were being overwritten, and where the code between
> the three registration/deregistration APIs was not consistent.
> 
> Since it is fairly easy to trigger an attempt to register an
> unregistered object, I also changed the error message from
> VIR_ERR_INTERNAL_ERROR to VIR_ERR_INVALID_ARG.
> 
> * src/conf/object_event.c (virObjectEventCallbackListEventID):
> Inline...
> (virObjectEventStateEventID): ...into lone caller, and report
> error on failure.
> (virObjectEventCallbackListAddID, virObjectEventStateCallbackID)
> (virObjectEventCallbackListRemoveID)
> (virObjectEventCallbackListMarkDeleteID): Tweak error category.
> * src/remote/remote_driver.c (remoteConnectDomainEventRegister):
> Don't leak registration on failure.
> (remoteConnectDomainEventDeregisterAny)
> (remoteConnectNetworkEventDeregisterAny): Don't overwrite error.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  src/conf/object_event.c    | 57 ++++++++++++++++++++++------------------------
>  src/remote/remote_driver.c | 56 ++++++++++++++++++++++-----------------------
>  2 files changed, 55 insertions(+), 58 deletions(-)

ACK

Michal




More information about the libvir-list mailing list