mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
event: don't overwrite registration error message
Prior to this patch, an attempt to register an event without an event loop started results in the vague: libvirt: Remote Driver error : adding cb to list Now it gives the much nicer: libvirt: error : internal error: could not initialize domain event timer This also avoids hiding other reasonable error messages, such as attempts to register a duplicate callback or OOM errors. * src/remote/remote_driver.c (remoteConnectNetworkEventRegisterAny) (remoteConnectDomainEventRegister) (remoteConnectDomainEventRegisterAny): Preserve more detailed error. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
53e3f9e46e
commit
cfd62c1f61
@ -2,7 +2,7 @@
|
|||||||
* remote_driver.c: driver to provide access to libvirtd running
|
* remote_driver.c: driver to provide access to libvirtd running
|
||||||
* on a remote machine
|
* on a remote machine
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2013 Red Hat, Inc.
|
* Copyright (C) 2007-2014 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -2932,10 +2932,8 @@ remoteConnectNetworkEventRegisterAny(virConnectPtr conn,
|
|||||||
net, eventID,
|
net, eventID,
|
||||||
VIR_OBJECT_EVENT_CALLBACK(callback),
|
VIR_OBJECT_EVENT_CALLBACK(callback),
|
||||||
opaque, freecb,
|
opaque, freecb,
|
||||||
&callbackID)) < 0) {
|
&callbackID)) < 0)
|
||||||
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
|
|
||||||
/* If this is the first callback for this eventID, we need to enable
|
/* If this is the first callback for this eventID, we need to enable
|
||||||
* events on the server */
|
* events on the server */
|
||||||
@ -4424,10 +4422,8 @@ static int remoteConnectDomainEventRegister(virConnectPtr conn,
|
|||||||
remoteDriverLock(priv);
|
remoteDriverLock(priv);
|
||||||
|
|
||||||
if ((count = virDomainEventStateRegister(conn, priv->domainEventState,
|
if ((count = virDomainEventStateRegister(conn, priv->domainEventState,
|
||||||
callback, opaque, freecb)) < 0) {
|
callback, opaque, freecb)) < 0)
|
||||||
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
|
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
/* Tell the server when we are the first callback deregistering */
|
/* Tell the server when we are the first callback deregistering */
|
||||||
@ -5234,10 +5230,8 @@ static int remoteConnectDomainEventRegisterAny(virConnectPtr conn,
|
|||||||
priv->domainEventState,
|
priv->domainEventState,
|
||||||
dom, eventID,
|
dom, eventID,
|
||||||
callback, opaque, freecb,
|
callback, opaque, freecb,
|
||||||
&callbackID)) < 0) {
|
&callbackID)) < 0)
|
||||||
virReportError(VIR_ERR_RPC, "%s", _("adding cb to list"));
|
|
||||||
goto done;
|
goto done;
|
||||||
}
|
|
||||||
|
|
||||||
/* If this is the first callback for this eventID, we need to enable
|
/* If this is the first callback for this eventID, we need to enable
|
||||||
* events on the server */
|
* events on the server */
|
||||||
|
Loading…
Reference in New Issue
Block a user