Changeset 67139 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- May 30, 2017 11:17:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
r65188 r67139 2975 2975 * @param argc The number of arguments. 2976 2976 * @param argv The argument vector. 2977 * @param cSecsCdWait Number of seconds to wait on the CD. 2977 2978 * @param pfExit For indicating exit when the exit code is zero. 2978 2979 */ 2979 static RTEXITCODE txsAutoUpdateStage1(int argc, char **argv, bool *pfExit)2980 static RTEXITCODE txsAutoUpdateStage1(int argc, char **argv, uint32_t cSecsCdWait, bool *pfExit) 2980 2981 { 2981 2982 /* … … 3001 3002 /* 3002 3003 * Query information about the two images and read the entire potential source file. 3003 */ 3004 * Because the CD may take a little time to be mounted when the system boots, we 3005 * need to do some fudging here. 3006 */ 3007 uint64_t nsStart = RTTimeNanoTS(); 3004 3008 RTFSOBJINFO UpgradeInfo; 3005 rc = RTPathQueryInfo(szUpgradePath, &UpgradeInfo, RTFSOBJATTRADD_NOTHING); 3006 if ( rc == VERR_FILE_NOT_FOUND 3007 || rc == VERR_PATH_NOT_FOUND 3008 || rc == VERR_MEDIA_NOT_PRESENT 3009 || rc == VERR_MEDIA_NOT_RECOGNIZED) 3010 return RTEXITCODE_SUCCESS; 3011 if (RT_FAILURE(rc)) 3012 { 3013 RTMsgError("RTPathQueryInfo(\"%s\"): %Rrc (upgrade)\n", szUpgradePath, rc); 3014 return RTEXITCODE_SUCCESS; 3009 for (;;) 3010 { 3011 rc = RTPathQueryInfo(szUpgradePath, &UpgradeInfo, RTFSOBJATTRADD_NOTHING); 3012 if (RT_SUCCESS(rc)) 3013 break; 3014 if ( rc != VERR_FILE_NOT_FOUND 3015 && rc != VERR_PATH_NOT_FOUND 3016 && rc != VERR_MEDIA_NOT_PRESENT 3017 && rc != VERR_MEDIA_NOT_RECOGNIZED) 3018 { 3019 RTMsgError("RTPathQueryInfo(\"%s\"): %Rrc (upgrade)\n", szUpgradePath, rc); 3020 return RTEXITCODE_SUCCESS; 3021 } 3022 uint64_t cNsElapsed = RTTimeNanoTS() - nsStart; 3023 if (cNsElapsed >= cSecsCdWait * RT_NS_1SEC_64) 3024 return RTEXITCODE_SUCCESS; 3025 RTThreadSleep(500); 3015 3026 } 3016 3027 … … 3222 3233 " version found on the CD-ROM on startup will replace the initial copy.\n" 3223 3234 " Default: --auto-upgrade\n" 3235 " --wait-cdrom <secs>\n" 3236 " Number of seconds to wait for the CD-ROM to be mounted before giving up\n" 3237 " on automatic upgrading.\n" 3238 " Default: --wait-cdrom 1; solaris: --wait-cdrom 8\n" 3224 3239 " --upgrading <org-path>\n" 3225 3240 " Internal use only.\n"); … … 3265 3280 bool fDaemonized = false; 3266 3281 const char *pszUpgrading = NULL; 3282 #ifdef RT_OS_SOLARIS 3283 uint32_t cSecsCdWait = 8; 3284 #else 3285 uint32_t cSecsCdWait = 1; 3286 #endif 3267 3287 3268 3288 /* … … 3273 3293 { "--transport", 't', RTGETOPT_REQ_STRING }, 3274 3294 { "--cdrom", 'c', RTGETOPT_REQ_STRING }, 3295 { "--wait-cdrom", 'w', RTGETOPT_REQ_UINT32 }, 3275 3296 { "--scratch", 's', RTGETOPT_REQ_STRING }, 3276 3297 { "--auto-upgrade", 'a', RTGETOPT_REQ_NOTHING }, 3277 3298 { "--no-auto-upgrade", 'A', RTGETOPT_REQ_NOTHING }, 3278 3299 { "--upgrading", 'U', RTGETOPT_REQ_STRING }, 3279 { "--display-output", 'd', RTGETOPT_REQ_NOTHING 3280 { "--no-display-output",'D', RTGETOPT_REQ_NOTHING 3281 { "--foreground", 'f', RTGETOPT_REQ_NOTHING 3282 { "--daemonized", 'Z', RTGETOPT_REQ_NOTHING 3300 { "--display-output", 'd', RTGETOPT_REQ_NOTHING }, 3301 { "--no-display-output",'D', RTGETOPT_REQ_NOTHING }, 3302 { "--foreground", 'f', RTGETOPT_REQ_NOTHING }, 3303 { "--daemonized", 'Z', RTGETOPT_REQ_NOTHING }, 3283 3304 }; 3284 3305 … … 3366 3387 case 'U': 3367 3388 pszUpgrading = Val.psz; 3389 break; 3390 3391 case 'w': 3392 cSecsCdWait = Val.u32; 3368 3393 break; 3369 3394 … … 3412 3437 rcExit = txsAutoUpdateStage2(argc, argv, pfExit, pszUpgrading); 3413 3438 else 3414 rcExit = txsAutoUpdateStage1(argc, argv, pfExit);3439 rcExit = txsAutoUpdateStage1(argc, argv, cSecsCdWait, pfExit); 3415 3440 if ( *pfExit 3416 3441 || rcExit != RTEXITCODE_SUCCESS)
Note:
See TracChangeset
for help on using the changeset viewer.