VirtualBox

Ignore:
Timestamp:
Nov 14, 2008 5:55:28 PM (16 years ago)
Author:
vboxsync
Message:

Main: Use the parent's hard disk format when implicitly creating differencing hard disks (or the default hard disk format if the parent format doesn't support differencing).

File:
1 edited

Legend:

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

    r14224 r14225  
    602602}
    603603
     604/**
     605 * Rerurns a hard disk format object corresponding to the given format
     606 * identifier or null if no such format.
     607 *
     608 * @param aFormat   Format identifier.
     609 *
     610 * @return ComObjPtr<HardDiskFormat>
     611 */
     612ComObjPtr <HardDiskFormat> SystemProperties::hardDiskFormat (const BSTR aFormat)
     613{
     614    ComObjPtr <HardDiskFormat> format;
     615
     616    AutoCaller autoCaller (this);
     617    AssertComRCReturn (autoCaller.rc(), format);
     618
     619    AutoReadLock alock (this);
     620
     621    for (HardDiskFormatList::const_iterator it = mHardDiskFormats.begin();
     622         it != mHardDiskFormats.end(); ++ it)
     623    {
     624        /* HardDiskFormat is all const, no need to lock */
     625
     626        if ((*it)->id() == aFormat)
     627        {
     628            format = *it;
     629            break;
     630        }
     631    }
     632
     633    return format;
     634}
     635
    604636// private methods
    605637/////////////////////////////////////////////////////////////////////////////
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