VirtualBox

Changeset 32633 in vbox


Ignore:
Timestamp:
Sep 20, 2010 11:26:48 AM (14 years ago)
Author:
vboxsync
Message:

VbglR3GetSessionId,VBoxServiceVMInfo: Documented VbglR3GetSessionId behavior used in VBoxServiceVMInfoWorker. Some nits in VBoxServiceVMInfo.

Location:
trunk/src/VBox/Additions/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp

    r30668 r32633  
    7575}
    7676
     77
    7778/**
    78  * Query the session id of this VM; this is a unique id that gets changed for each VM start, reset or restore.
    79  * Useful for detection a VM restore.
     79 * Query the session ID of this VM.
     80 *
     81 * The session id is an unique identifier that gets changed for each VM start,
     82 * reset or restore.  Useful for detection a VM restore.
    8083 *
    8184 * @returns IPRT status code.
    82  * pu64IdSession    Session id (out)
    83  *
     85 * @param   pu64IdSession       Session id (out).  This is NOT changed on
     86 *                              failure, so the caller can depend on this to
     87 *                              deal with backward compatability (see
     88 *                              VBoxServiceVMInfoWorker() for an example.)
    8489 */
    8590VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession)
     
    8893
    8994    vmmdevInitRequest(&Req.header, VMMDevReq_GetSessionId);
     95    Req.idSession = 0;
    9096    int rc = vbglR3GRPerform(&Req.header);
    91     if (rc == VINF_SUCCESS)
     97    if (RT_SUCCESS(rc))
    9298        *pu64IdSession = Req.idSession;
    9399
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r32628 r32633  
    7777/** The guest property cache. */
    7878static VBOXSERVICEVEPROPCACHE   g_VMInfoPropCache;
    79 /** The session ID. Changes whenever the VM is restored or resetted. */
    80 static uint64_t                 g_idSession;
     79/** The VM session ID. Changes whenever the VM is restored or reset. */
     80static uint64_t                 g_idVMInfoSession;
    8181
    8282
     
    115115    int rc = RTSemEventMultiCreate(&g_hVMInfoEvent);
    116116    AssertRCReturn(rc, rc);
    117    
    118     rc = VbglR3GetSessionId(&g_idSession);
    119     /* The error ignored as this information is not available with VBox < 3.2.10. */
     117
     118    VbglR3GetSessionId(&g_idVMInfoSession);
     119    /* The status code is ignored as this information is not available with VBox < 3.2.10. */
    120120
    121121    rc = VbglR3GuestPropConnect(&g_uVMInfoGuestPropSvcClientID);
     
    746746         * Flush all properties if we were restored.
    747747         */
    748         uint64_t idNewSession = g_idSession;
     748        uint64_t idNewSession = g_idVMInfoSession;
    749749        VbglR3GetSessionId(&idNewSession);
    750         if (idNewSession != g_idSession)
    751         {
    752             VBoxServiceVerbose(3, "VMInfo: Session ID changed, flushing all properties.\n");
     750        if (idNewSession != g_idVMInfoSession)
     751        {
     752            VBoxServiceVerbose(3, "VMInfo: The VM session ID changed, flushing all properties.\n");
    753753            vboxserviceVMInfoWriteFixedProperties();
    754754            VBoxServicePropCacheFlush(&g_VMInfoPropCache);
    755             g_idSession = idNewSession;
     755            g_idVMInfoSession = idNewSession;
    756756        }
    757757
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette