VirtualBox

Changeset 30070 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 7, 2010 1:06:51 PM (15 years ago)
Author:
vboxsync
Message:

Main/VirtualBox: handle objects with limited functionality consistently when searching by name or uuid - skip them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r30055 r30070  
    13501350    {
    13511351        ComObjPtr<Machine> &pMachine2 = *it;
    1352         AutoLimitedCaller machCaller(pMachine2);
    1353         AssertComRC(machCaller.rc());
    1354 
     1352        AutoCaller machCaller(pMachine2);
    13551353        /* skip inaccessible machines */
    1356         if (machCaller.state() == Machine::Ready)
    1357         {
    1358             AutoReadLock machLock(pMachine2 COMMA_LOCKVAL_SRC_POS);
    1359             if (pMachine2->getName() == aName)
    1360             {
    1361                 pMachineFound = pMachine2;
    1362                 break;
    1363             }
     1354        if (FAILED(machCaller.rc()))
     1355            continue;
     1356
     1357        AutoReadLock machLock(pMachine2 COMMA_LOCKVAL_SRC_POS);
     1358        if (pMachine2->getName() == aName)
     1359        {
     1360            pMachineFound = pMachine2;
     1361            break;
    13641362        }
    13651363    }
     
    29222920        {
    29232921            ComObjPtr<Machine> pMachine2 = *it;
    2924             /* sanity */
    2925             AutoLimitedCaller machCaller(pMachine2);
    2926             AssertComRC(machCaller.rc());
     2922            AutoCaller machCaller(pMachine2);
     2923            /* skip inaccessible machines */
     2924            if (FAILED(machCaller.rc()))
     2925                continue;
    29272926
    29282927            if (pMachine2->getId() == aId)
     
    29372936
    29382937    if (aSetError && FAILED(rc))
    2939         setError(VBOX_E_OBJECT_NOT_FOUND,
    2940                  tr("Could not find a registered machine with UUID {%RTuuid}"),
    2941                  aId.raw());
     2938        rc = setError(rc,
     2939                      tr("Could not find a registered machine with UUID {%RTuuid}"),
     2940                      aId.raw());
    29422941
    29432942    return rc;
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