mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-20 03:25:18 +00:00
events: Don't fail on registering events for two different domains
virConnectDomainEventRegisterAny() takes a domain as an argument. So it should be possible to register the same event (be it VIR_DOMAIN_EVENT_ID_LIFECYCLE for example) for two different domains. That is, we need to take domain into account when searching for duplicate event being already registered. (cherry picked from commit cd15303fd123146b0ba53e387d08ef22b707223c)
This commit is contained in:
parent
8512c27e23
commit
9a5d10efc9
@ -363,7 +363,11 @@ virDomainEventCallbackListAddID(virConnectPtr conn,
|
||||
for (i = 0 ; i < cbList->count ; i++) {
|
||||
if (cbList->callbacks[i]->cb == VIR_DOMAIN_EVENT_CALLBACK(callback) &&
|
||||
cbList->callbacks[i]->eventID == eventID &&
|
||||
cbList->callbacks[i]->conn == conn) {
|
||||
cbList->callbacks[i]->conn == conn &&
|
||||
((dom && cbList->callbacks[i]->dom &&
|
||||
memcmp(cbList->callbacks[i]->dom->uuid,
|
||||
dom->uuid, VIR_UUID_BUFLEN) == 0) ||
|
||||
(!dom && !cbList->callbacks[i]->dom))) {
|
||||
eventReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("event callback already tracked"));
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user