Changeset 50810 in vbox for trunk/src/VBox
- Timestamp:
- Mar 18, 2014 2:53:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r49349 r50810 5 5 6 6 /* 7 * Copyright (C) 2012-201 3Oracle Corporation7 * Copyright (C) 2012-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 208 208 ctxHost.uProtocol = 1; 209 209 210 int cRetrievalFailed = 0; /* Number of failed message retrievals in a row. */ 210 211 for (;;) 211 212 { … … 217 218 { 218 219 #ifdef DEBUG 219 VBoxServiceVerbose(4, "Message requires %ld parameters, but only 2 supplied -- retrying request (no error!)...\n", cParms); 220 VBoxServiceVerbose(4, "Message requires %ld parameters, but only 2 supplied -- retrying request (no error!)...\n", 221 cParms); 220 222 #endif 221 223 rc = VINF_SUCCESS; /* Try to get "real" message in next block below. */ 222 224 } 223 225 else if (RT_FAILURE(rc)) 224 VBoxServiceVerbose(3, "Getting host message failed with %Rrc\n", rc); /* VERR_GEN_IO_FAILURE seems to be normal if ran into timeout. */ 226 { 227 /* Note: VERR_GEN_IO_FAILURE seems to be normal if ran into timeout. */ 228 VBoxServiceError("Getting host message failed with %Rrc\n", rc); 229 230 /* Check for VM session change. */ 231 uint64_t idNewSession = g_idControlSession; 232 int rc2 = VbglR3GetSessionId(&idNewSession); 233 if ( RT_SUCCESS(rc2) 234 && (idNewSession != g_idControlSession)) 235 { 236 VBoxServiceVerbose(1, "The VM session ID changed\n"); 237 g_idControlSession = idNewSession; 238 239 /* Close all opened guest sessions -- all context IDs, sessions etc. 240 * are now invalid. */ 241 rc2 = GstCntlSessionClose(&g_Session); 242 AssertRC(rc2); 243 244 /* Do a reconnect. */ 245 VBoxServiceVerbose(1, "Reconnecting to HGCM service ...\n"); 246 rc2 = VbglR3GuestCtrlConnect(&g_uControlSvcClientID); 247 if (RT_SUCCESS(rc2)) 248 { 249 VBoxServiceVerbose(3, "Guest control service client ID=%RU32\n", 250 g_uControlSvcClientID); 251 cRetrievalFailed = 0; 252 continue; /* Skip waiting. */ 253 } 254 else 255 { 256 VBoxServiceError("Unable to re-connect to HGCM service, rc=%Rrc, bailing out\n", rc); 257 break; 258 } 259 } 260 261 if (++cRetrievalFailed > 16) /** @todo Make this configurable? */ 262 { 263 VBoxServiceError("Too many failed attempts in a row to get next message, bailing out\n"); 264 break; 265 } 266 267 RTThreadSleep(1000); /* Wait a bit before retrying. */ 268 } 269 225 270 if (RT_SUCCESS(rc)) 226 271 { 227 272 VBoxServiceVerbose(4, "Msg=%RU32 (%RU32 parms) retrieved\n", uMsg, cParms); 273 cRetrievalFailed = 0; /* Reset failed retrieval count. */ 228 274 229 275 /* Set number of parameters for current host context. */
Note:
See TracChangeset
for help on using the changeset viewer.