Bug 980449 - resource leak about event
Summary: resource leak about event
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-02 11:59 UTC by WangYufei
Modified: 2014-04-17 12:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-17 12:03:42 UTC
Embargoed:


Attachments (Terms of Use)

Description WangYufei 2013-07-02 11:59:38 UTC
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,
                                                 priv->domainEventState,
                                                 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;

        if (call(conn, priv, 0, REMOTE_PROC_CONNECT_DOMAIN_EVENT_DEREGISTER_ANY,
                 (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:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ján Tomko 2014-04-17 12:03:42 UTC
Fixed upstream by:
commit 9712c2510ec87a87578576a407768380e250a6a4
Author:     Zhou Yimin <zhouyimin>
AuthorDate: 2013-10-17 15:59:21 +0800
Commit:     Eric Blake <eblake>
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>
    Signed-off-by: Eric Blake <eblake>

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.