Changeset 32633 in vbox
- Timestamp:
- Sep 20, 2010 11:26:48 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r30668 r32633 75 75 } 76 76 77 77 78 /** 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. 80 83 * 81 84 * @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.) 84 89 */ 85 90 VBGLR3DECL(int) VbglR3GetSessionId(uint64_t *pu64IdSession) … … 88 93 89 94 vmmdevInitRequest(&Req.header, VMMDevReq_GetSessionId); 95 Req.idSession = 0; 90 96 int rc = vbglR3GRPerform(&Req.header); 91 if ( rc == VINF_SUCCESS)97 if (RT_SUCCESS(rc)) 92 98 *pu64IdSession = Req.idSession; 93 99 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r32628 r32633 77 77 /** The guest property cache. */ 78 78 static VBOXSERVICEVEPROPCACHE g_VMInfoPropCache; 79 /** The session ID. Changes whenever the VM is restored or resetted. */80 static uint64_t g_id Session;79 /** The VM session ID. Changes whenever the VM is restored or reset. */ 80 static uint64_t g_idVMInfoSession; 81 81 82 82 … … 115 115 int rc = RTSemEventMultiCreate(&g_hVMInfoEvent); 116 116 AssertRCReturn(rc, rc); 117 118 rc = VbglR3GetSessionId(&g_idSession);119 /* The errorignored 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. */ 120 120 121 121 rc = VbglR3GuestPropConnect(&g_uVMInfoGuestPropSvcClientID); … … 746 746 * Flush all properties if we were restored. 747 747 */ 748 uint64_t idNewSession = g_id Session;748 uint64_t idNewSession = g_idVMInfoSession; 749 749 VbglR3GetSessionId(&idNewSession); 750 if (idNewSession != g_id Session)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"); 753 753 vboxserviceVMInfoWriteFixedProperties(); 754 754 VBoxServicePropCacheFlush(&g_VMInfoPropCache); 755 g_id Session = idNewSession;755 g_idVMInfoSession = idNewSession; 756 756 } 757 757
Note:
See TracChangeset
for help on using the changeset viewer.