Changeset 91320 in vbox
- Timestamp:
- Sep 20, 2021 10:08:15 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageCloudMachine.cpp
r91319 r91320 72 72 static RTEXITCODE handleCloudMachineStart(HandlerArg *a, int iFirst, 73 73 const ComPtr<ICloudClient> &pClient); 74 static RTEXITCODE handleCloudMachineReboot(HandlerArg *a, int iFirst, 75 const ComPtr<ICloudClient> &pClient); 74 76 static RTEXITCODE handleCloudMachineShutdown(HandlerArg *a, int iFirst, 75 77 const ComPtr<ICloudClient> &pClient); 78 static RTEXITCODE handleCloudMachinePowerdown(HandlerArg *a, int iFirst, 79 const ComPtr<ICloudClient> &pClient); 80 static RTEXITCODE handleCloudMachineTerminate(HandlerArg *a, int iFirst, 81 const ComPtr<ICloudClient> &pClient); 76 82 77 83 static RTEXITCODE handleCloudMachineConsoleHistory(HandlerArg *a, int iFirst, … … 613 619 kMachine_Info, 614 620 kMachine_List, 621 kMachine_Powerdown, 622 kMachine_Reboot, 615 623 kMachine_Shutdown, 616 624 kMachine_Start, 625 kMachine_Terminate, 617 626 }; 618 627 619 628 // setCurrentSubcommand(HELP_SCOPE_CLOUD_MACHINE); 620 629 static const RTGETOPTDEF s_aOptions[] = 621 {630 { 622 631 { "console-history", kMachine_ConsoleHistory, RTGETOPT_REQ_NOTHING }, 623 632 { "consolehistory", kMachine_ConsoleHistory, RTGETOPT_REQ_NOTHING }, 624 633 { "info", kMachine_Info, RTGETOPT_REQ_NOTHING }, 625 634 { "list", kMachine_List, RTGETOPT_REQ_NOTHING }, 635 { "powerdown", kMachine_Powerdown, RTGETOPT_REQ_NOTHING }, 636 { "reboot", kMachine_Reboot, RTGETOPT_REQ_NOTHING }, 626 637 { "shutdown", kMachine_Shutdown, RTGETOPT_REQ_NOTHING }, 627 638 { "start", kMachine_Start, RTGETOPT_REQ_NOTHING }, 639 { "terminate", kMachine_Terminate, RTGETOPT_REQ_NOTHING }, 628 640 CLOUD_MACHINE_RTGETOPTDEF_HELP 629 641 }; … … 651 663 return listCloudMachinesImpl(a, OptState.iNext, pClient); 652 664 665 case kMachine_Powerdown: 666 return handleCloudMachinePowerdown(a, OptState.iNext, pClient); 667 668 case kMachine_Reboot: 669 return handleCloudMachineReboot(a, OptState.iNext, pClient); 670 653 671 case kMachine_Shutdown: 654 672 return handleCloudMachineShutdown(a, OptState.iNext, pClient); … … 656 674 case kMachine_Start: 657 675 return handleCloudMachineStart(a, OptState.iNext, pClient); 676 677 case kMachine_Terminate: 678 return handleCloudMachineTerminate(a, OptState.iNext, pClient); 658 679 659 680 … … 1254 1275 1255 1276 /* 1277 * cloud machine reboot "id" 1278 * "Press" ACPI power button, then power the instance back up. 1279 */ 1280 static RTEXITCODE 1281 handleCloudMachineReboot(HandlerArg *a, int iFirst, 1282 const ComPtr<ICloudClient> &pClient) 1283 { 1284 ComPtr<ICloudMachine> pMachine; 1285 HRESULT hrc; 1286 1287 RTEXITCODE status 1288 = getMachineFromArgs(pMachine, 1289 /* HELP_SCOPE_CLOUD_MACHINE_REBOOT */ 0, 1290 a, iFirst, pClient); 1291 if (status != RTEXITCODE_SUCCESS) 1292 return status; 1293 1294 1295 ComPtr<IProgress> pProgress; 1296 CHECK_ERROR2_RET(hrc, pMachine, 1297 Reboot(pProgress.asOutParam()), 1298 RTEXITCODE_FAILURE); 1299 1300 hrc = showProgress(pProgress, SHOW_PROGRESS_NONE); 1301 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1302 } 1303 1304 1305 /* 1256 1306 * cloud machine shutdown "id" 1307 * "Press" ACPI power button. 1257 1308 */ 1258 1309 static RTEXITCODE … … 1282 1333 1283 1334 /* 1335 * cloud machine powerdown "id" 1336 * Yank the power cord. 1337 */ 1338 static RTEXITCODE 1339 handleCloudMachinePowerdown(HandlerArg *a, int iFirst, 1340 const ComPtr<ICloudClient> &pClient) 1341 { 1342 ComPtr<ICloudMachine> pMachine; 1343 HRESULT hrc; 1344 1345 RTEXITCODE status 1346 = getMachineFromArgs(pMachine, 1347 /* HELP_SCOPE_CLOUD_MACHINE_POWERDOWN */ 0, 1348 a, iFirst, pClient); 1349 if (status != RTEXITCODE_SUCCESS) 1350 return status; 1351 1352 1353 ComPtr<IProgress> pProgress; 1354 CHECK_ERROR2_RET(hrc, pMachine, 1355 PowerDown(pProgress.asOutParam()), 1356 RTEXITCODE_FAILURE); 1357 1358 hrc = showProgress(pProgress, SHOW_PROGRESS_NONE); 1359 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1360 } 1361 1362 1363 /* 1364 * cloud machine terminate "id" 1365 * Discard the instance running this machine. 1366 */ 1367 static RTEXITCODE 1368 handleCloudMachineTerminate(HandlerArg *a, int iFirst, 1369 const ComPtr<ICloudClient> &pClient) 1370 { 1371 ComPtr<ICloudMachine> pMachine; 1372 HRESULT hrc; 1373 1374 RTEXITCODE status 1375 = getMachineFromArgs(pMachine, 1376 /* HELP_SCOPE_CLOUD_MACHINE_TERMINATE */ 0, 1377 a, iFirst, pClient); 1378 if (status != RTEXITCODE_SUCCESS) 1379 return status; 1380 1381 1382 ComPtr<IProgress> pProgress; 1383 CHECK_ERROR2_RET(hrc, pMachine, 1384 Terminate(pProgress.asOutParam()), 1385 RTEXITCODE_FAILURE); 1386 1387 hrc = showProgress(pProgress, SHOW_PROGRESS_NONE); 1388 return SUCCEEDED(hrc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE; 1389 } 1390 1391 1392 /* 1284 1393 * cloud machine console-history "id" 1285 1394 */
Note:
See TracChangeset
for help on using the changeset viewer.

