VirtualBox

Ignore:
Timestamp:
Oct 21, 2010 10:45:26 AM (14 years ago)
Author:
vboxsync
Message:

Main: API change, merge IVirtualBox::getMachine() with findMachine()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r33004 r33294  
    793793        ComPtr<IMachine> m;
    794794
    795         /* find ID by name */
    796         if (id.isEmpty())
    797         {
    798             rc = virtualBox->FindMachine(Bstr(name).raw(), m.asOutParam());
    799             if (FAILED(rc))
    800             {
    801                 LogError("Invalid machine name!\n", rc);
    802                 break;
    803             }
    804             m->COMGETTER(Id)(id.asOutParam());
    805             AssertComRC(rc);
    806             if (FAILED(rc))
    807                 break;
    808         }
    809         else
    810         {
    811             /* Use the GUID. */
    812             rc = virtualBox->GetMachine(id.raw(), m.asOutParam());
    813             if (FAILED(rc))
    814             {
    815                 LogError("Invalid machine uid!\n", rc);
    816                 break;
    817             }
    818         }
     795        rc = virtualBox->FindMachine(Bstr(name).raw(), m.asOutParam());
     796        if (FAILED(rc))
     797        {
     798            LogError("Invalid machine name or UUID!\n", rc);
     799            break;
     800        }
     801        m->COMGETTER(Id)(id.asOutParam());
     802        AssertComRC(rc);
     803        if (FAILED(rc))
     804            break;
    819805
    820806        Log(("VBoxHeadless: Opening a session with machine (id={%s})...\n",
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