Bug 980449 - resource leak about event
resource leak about event
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2013-07-02 07:59 EDT by WangYufei
Modified: 2014-04-17 08:03 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-17 08:03:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description WangYufei 2013-07-02 07:59:38 EDT
Description of problem:

In remoteConnectDomainEventDeregisterAny function, the codes are

>>   /*The count here calculated is for a connection, not for an event*/

    if ((count = virDomainEventStateDeregisterID(conn,
                                                 callbackID)) < 0) {
        virReportError(VIR_ERR_RPC, _("unable to find callback ID %d"), callbackID);
        goto done;

>>  /* 
        Here we want a count for an eventID , so there's a situation: we release the resource on the server only once for the whole connection, in which there may be a lot of events registered. At last, we fail to release most resource about events on the server.

    /* If that was the last callback for this eventID, we need to disable
     * events on the server */
    if (count == 0) {
        args.eventID = callbackID;

                 (xdrproc_t) xdr_remote_connect_domain_event_deregister_any_args, (char *) &args,
                 (xdrproc_t) xdr_void, (char *) NULL) == -1)
            goto done;

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:
Comment 1 Ján Tomko 2014-04-17 08:03:42 EDT
Fixed upstream by:
commit 9712c2510ec87a87578576a407768380e250a6a4
Author:     Zhou Yimin <zhouyimin@huawei.com>
AuthorDate: 2013-10-17 15:59:21 +0800
Commit:     Eric Blake <eblake@redhat.com>
CommitDate: 2013-10-18 06:21:29 -0600

    remote: fix regression in event deregistration
    Introduced by 7b87a3
    When I quit the process which only register VIR_DOMAIN_EVENT_ID_REBOOT,
    I got error like:
    "libvirt: XML-RPC error : internal error: domain event 0 not registered".
    Then I add the following code, it fixed.
    Signed-off-by: Zhou Yimin <zhouyimin@huawei.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>

git describe: v1.1.3-185-g9712c25 contains: v1.1.4-rc1~48

Note You need to log in before you can comment on or make changes to this bug.