Changeset 84585 in vbox
- Timestamp:
- May 28, 2020 12:14:17 PM (4 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
-
Frontends/VBoxManage/VBoxManageControlVM.cpp (modified) (1 diff)
-
Main/src-client/GuestCtrlImpl.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r84576 r84585 681 681 || !strcmp(a->argv[1], "shutdown")) /* With shutdown we mean gracefully powering off the VM by letting the guest OS do its thing. */ 682 682 { 683 ComPtr<IGuest> guest; 684 CHECK_ERROR_BREAK(console, COMGETTER(Guest)(guest.asOutParam())); 683 ComPtr<IGuest> pGuest; 684 CHECK_ERROR_BREAK(console, COMGETTER(Guest)(pGuest.asOutParam())); 685 if (!pGuest) 686 { 687 RTMsgError("Guest not running"); 688 rc = E_FAIL; 689 break; 690 } 685 691 686 692 const bool fReboot = !strcmp(a->argv[1], "reboot"); 687 693 688 694 com::SafeArray<GuestShutdownFlag_T> aShutdownFlags; 695 aShutdownFlags.resize(1); 696 689 697 if (fReboot) 690 698 aShutdownFlags.push_back(GuestShutdownFlag_Reboot); 691 699 else 692 700 aShutdownFlags.push_back(GuestShutdownFlag_PowerOff); 693 CHECK_ERROR( guest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags)));701 CHECK_ERROR(pGuest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags))); 694 702 if (FAILED(rc)) 695 703 { -
trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
r84555 r84585 513 513 return setError(E_INVALIDARG, tr("Invalid combination of flags (%#x)"), fFlags); 514 514 515 Utf8Str strAction = (fFlags & GuestShutdownFlag_Reboot) ? tr("Rebooting") : tr("Shutting down"); 516 515 517 /* 516 518 * Create an anonymous session. This is required to run shutting down / rebooting … … 518 520 */ 519 521 GuestSessionStartupInfo startupInfo; 520 startupInfo.mName = "Shutting downguest";522 startupInfo.mName = strAction + " guest"; 521 523 522 524 GuestCredentials guestCreds; … … 541 543 case VERR_NOT_SUPPORTED: 542 544 hrc = setErrorBoth(VBOX_E_NOT_SUPPORTED, vrc, 543 tr(" Shutting down not supported by installed Guest Additions"), vrc);545 tr("%s not supported by installed Guest Additions"), strAction.c_str()); 544 546 break; 545 547 … … 548 550 if (vrc == VERR_GSTCTL_GUEST_ERROR) 549 551 vrc = rcGuest; 550 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr(" Could not shut down guest: %Rrc"), vrc);552 hrc = setErrorBoth(VBOX_E_IPRT_ERROR, vrc, tr("Error %s guest: %Rrc"), strAction.c_str(), vrc); 551 553 break; 552 554 }
Note:
See TracChangeset
for help on using the changeset viewer.

