Changeset 43927 in vbox
- Timestamp:
- Nov 21, 2012 10:29:18 AM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r43793 r43927 262 262 263 263 #if defined(VBOX_WITH_DBUS) && defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */ 264 /* 264 /* 265 265 * Simple wrapper to work around compiler-specific va_list madness. 266 266 */ … … 388 388 char **ppszSessions; int cSessions; 389 389 if ( (dbus_message_get_type(pMsgSessions) == DBUS_MESSAGE_TYPE_METHOD_CALL) 390 && vboxService_dbus_message_get_args(pReplySessions, &dbErr, DBUS_TYPE_ARRAY, 391 DBUS_TYPE_OBJECT_PATH, &ppszSessions, &cSessions, 390 && vboxService_dbus_message_get_args(pReplySessions, &dbErr, DBUS_TYPE_ARRAY, 391 DBUS_TYPE_OBJECT_PATH, &ppszSessions, &cSessions, 392 392 DBUS_TYPE_INVALID /* Termination */)) 393 393 { … … 429 429 && ppwEntry->pw_name) 430 430 { 431 VBoxServiceVerbose(4, "ConsoleKit: session '%s' -> %s (uid: %RU32)\n", 431 VBoxServiceVerbose(4, "ConsoleKit: session '%s' -> %s (uid: %RU32)\n", 432 432 *ppszCurSession, ppwEntry->pw_name, uid); 433 433 … … 471 471 { 472 472 VBoxServiceError("ConsoleKit: unable to retrieve session parameters (msg type=%d): %s", 473 dbus_message_get_type(pMsgSessions), 473 dbus_message_get_type(pMsgSessions), 474 474 dbus_error_is_set(&dbErr) ? dbErr.message : "No error information available\n"); 475 475 } … … 566 566 567 567 if (pszUserList && cUsersInList > 0) 568 VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", "%s", pszUserList);568 rc = VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", "%s", pszUserList); 569 569 else 570 VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", NULL); 571 VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsers", "%u", cUsersInList); 570 rc = VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsersList", NULL); 571 if (RT_FAILURE(rc)) 572 { 573 VBoxServiceError("VMInfo: Error writing logged on users list, rc=%Rrc\n", rc); 574 cUsersInList = 0; /* Reset user count on error. */ 575 } 576 577 rc = VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/LoggedInUsers", "%u", cUsersInList); 578 if (RT_FAILURE(rc)) 579 { 580 VBoxServiceError("VMInfo: Error writing logged on users count, rc=%Rrc\n", rc); 581 cUsersInList = 0; /* Reset user count on error. */ 582 } 583 572 584 if (g_cVMInfoLoggedInUsers != cUsersInList) 573 585 { 574 VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/NoLoggedInUsers", 575 cUsersInList == 0 ? "true" : "false"); 586 rc = VBoxServicePropCacheUpdate(&g_VMInfoPropCache, "/VirtualBox/GuestInfo/OS/NoLoggedInUsers", 587 cUsersInList == 0 ? "true" : "false"); 588 if (RT_FAILURE(rc)) 589 VBoxServiceError("VMInfo: Error writing no logged in users beacon, rc=%Rrc\n", rc); 576 590 g_cVMInfoLoggedInUsers = cUsersInList; 577 591 } 578 579 if (RT_SUCCESS(rc) && pszUserList) 592 if (pszUserList) 580 593 RTStrFree(pszUserList); 581 594 return rc; -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r42476 r43927 168 168 Assert(gpcev); 169 169 170 Bstr aKey; 171 gpcev->COMGETTER(Name)(aKey.asOutParam()); 172 173 if (aKey == Bstr("/VirtualBox/GuestInfo/OS/NoLoggedInUsers")) 170 Bstr strKey; 171 gpcev->COMGETTER(Name)(strKey.asOutParam()); 172 173 Utf8Str utf8Key = strKey; 174 LogRelFlow(("Guest property \"%s\" has been changed\n", utf8Key.c_str())); 175 176 if (utf8Key.equals("/VirtualBox/GuestInfo/OS/NoLoggedInUsers")) 174 177 { 178 LogRelFlow(("Guest indicates that there %s logged in users (anymore)\n", 179 utf8Key.equals("true") ? "are no" : "are")); 180 175 181 /* Check if this is our machine and the "disconnect on logout feature" is enabled. */ 176 182 BOOL fProcessDisconnectOnGuestLogout = FALSE; … … 188 194 if (id == machineId) 189 195 { 190 Bstr value1;196 Bstr strDiscon; 191 197 hrc = machine->GetExtraData(Bstr("VRDP/DisconnectOnGuestLogout").raw(), 192 value1.asOutParam());193 if (SUCCEEDED(hrc) && value1 == "1")198 strDiscon.asOutParam()); 199 if (SUCCEEDED(hrc)) 194 200 { 195 fProcessDisconnectOnGuestLogout = TRUE; 201 Utf8Str utf8Discon = strDiscon; 202 fProcessDisconnectOnGuestLogout = utf8Discon.equals("1") 203 ? TRUE : FALSE; 204 205 LogRelFlow(("VRDE: ExtraData VRDP/DisconnectOnGuestLogout=%s\n", 206 utf8Discon.c_str())); 196 207 } 197 208 } 198 209 } 199 210 } 211 else 212 LogRel(("VRDE: No console available, skipping disconnect on guest logout check\n")); 213 214 LogRelFlow(("VRDE: hrc=%Rhrc: Host %s disconnecting clients (current host state known: %s)\n", 215 hrc, fProcessDisconnectOnGuestLogout ? "will handle" : "does not handle", 216 mfNoLoggedInUsers ? "No users logged in" : "Users logged in")); 200 217 201 218 if (fProcessDisconnectOnGuestLogout) … … 226 243 fDropConnection = true; 227 244 245 LogRelFlow(("VRDE: szNoLoggedInUsers=%s, mfNoLoggedInUsers=%RTbool, fDropConnection=%RTbool\n", 246 utf8Value.c_str(), mfNoLoggedInUsers, fDropConnection)); 247 228 248 if (fDropConnection) 229 249 { … … 235 255 ULONG cClients = 0; 236 256 hrc = info->COMGETTER(NumberOfClients)(&cClients); 257 258 LogRelFlow(("VRDE: connected clients=%RU32\n", cClients)); 237 259 if (SUCCEEDED(hrc) && cClients > 0) 238 260 { … … 249 271 } 250 272 } 273 274 LogRelFlow(("VRDE: returned with=%Rhrc\n", hrc)); 251 275 } 252 276 break;
Note:
See TracChangeset
for help on using the changeset viewer.