VirtualBox

Ignore:
Timestamp:
Sep 20, 2010 9:21:27 AM (14 years ago)
Author:
vboxsync
Message:

Additions/VM Info: use the session to determine if we have to flush all properties after the VM was restored

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r32535 r32628  
    7777/** The guest property cache. */
    7878static VBOXSERVICEVEPROPCACHE   g_VMInfoPropCache;
     79/** The session ID. Changes whenever the VM is restored or resetted. */
     80static uint64_t                 g_idSession;
    7981
    8082
     
    113115    int rc = RTSemEventMultiCreate(&g_hVMInfoEvent);
    114116    AssertRCReturn(rc, rc);
     117   
     118    rc = VbglR3GetSessionId(&g_idSession);
     119    /* The error ignored as this information is not available with VBox < 3.2.10. */
    115120
    116121    rc = VbglR3GuestPropConnect(&g_uVMInfoGuestPropSvcClientID);
     
    737742        if (RT_FAILURE(rc))
    738743            break;
     744
     745        /*
     746         * Flush all properties if we were restored.
     747         */
     748        uint64_t idNewSession = g_idSession;
     749        VbglR3GetSessionId(&idNewSession);
     750        if (idNewSession != g_idSession)
     751        {
     752            VBoxServiceVerbose(3, "VMInfo: Session ID changed, flushing all properties.\n");
     753            vboxserviceVMInfoWriteFixedProperties();
     754            VBoxServicePropCacheFlush(&g_VMInfoPropCache);
     755            g_idSession = idNewSession;
     756        }
    739757
    740758        /*
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