VirtualBox

Ignore:
Timestamp:
May 28, 2020 12:14:17 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138315
Message:

Main + FE/VBoxManage: Fixes / better logging for reboot / shutdown support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r84576 r84585  
    681681                 || !strcmp(a->argv[1], "shutdown")) /* With shutdown we mean gracefully powering off the VM by letting the guest OS do its thing. */
    682682        {
    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            }
    685691
    686692            const bool fReboot = !strcmp(a->argv[1], "reboot");
    687693
    688694            com::SafeArray<GuestShutdownFlag_T> aShutdownFlags;
     695            aShutdownFlags.resize(1);
     696
    689697            if (fReboot)
    690698                aShutdownFlags.push_back(GuestShutdownFlag_Reboot);
    691699            else
    692700                aShutdownFlags.push_back(GuestShutdownFlag_PowerOff);
    693             CHECK_ERROR(guest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags)));
     701            CHECK_ERROR(pGuest, Shutdown(ComSafeArrayAsInParam(aShutdownFlags)));
    694702            if (FAILED(rc))
    695703            {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette