VirtualBox

Ignore:
Timestamp:
Aug 4, 2008 8:27:27 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34000
Message:

FE/VBoxManage: we need a mutable machine session to get and enumerate properties

File:
1 edited

Legend:

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

    r11079 r11088  
    5353
    5454static int handleGetGuestProperty(int argc, char *argv[],
    55                                   ComPtr<IVirtualBox> virtualBox,
    56                                   ComPtr<ISession> session)
     55                                  ComPtr<IVirtualBox> aVirtualBox,
     56                                  ComPtr<ISession> aSession)
    5757{
    5858    HRESULT rc = S_OK;
     
    6666    ComPtr<IMachine> machine;
    6767    /* assume it's a UUID */
    68     rc = virtualBox->GetMachine(Guid(argv[0]), machine.asOutParam());
     68    rc = aVirtualBox->GetMachine(Guid(argv[0]), machine.asOutParam());
    6969    if (FAILED(rc) || !machine)
    7070    {
    7171        /* must be a name */
    72         CHECK_ERROR(virtualBox, FindMachine(Bstr(argv[0]), machine.asOutParam()));
     72        CHECK_ERROR(aVirtualBox, FindMachine(Bstr(argv[0]), machine.asOutParam()));
    7373    }
    7474    if (machine)
    7575    {
     76        Guid uuid;
     77        machine->COMGETTER(Id)(uuid.asOutParam());
     78
     79        /* open a session for the VM */
     80        CHECK_ERROR_RET (aVirtualBox, OpenSession(aSession, uuid), 1);
     81
     82        /* get the mutable session machine */
     83        aSession->COMGETTER(Machine)(machine.asOutParam());
     84
    7685        Bstr value;
    7786        uint64_t u64Timestamp;
     
    222231    if (machine)
    223232    {
     233        Guid uuid;
     234        machine->COMGETTER(Id)(uuid.asOutParam());
     235
     236        /* open a session for the VM */
     237        CHECK_ERROR_RET (aVirtualBox, OpenSession(aSession, uuid), 1);
     238
     239        /* get the mutable session machine */
     240        aSession->COMGETTER(Machine)(machine.asOutParam());
     241
    224242        com::SafeArray <BSTR> names;
    225243        com::SafeArray <BSTR> values;
Note: See TracChangeset for help on using the changeset viewer.

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