VirtualBox

Changeset 58484 in vbox


Ignore:
Timestamp:
Oct 29, 2015 1:48:32 PM (9 years ago)
Author:
vboxsync
Message:

Main/Machine+Medium: for diff images keep the variant of the parent if possible (helpful with VMs on FAT32 disks when using snapshots)

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MediumImpl.h

    r55872 r58484  
    169169                                bool aWait);
    170170    Utf8Str i_getPreferredDiffFormat();
     171    MediumVariant_T i_getPreferredDiffVariant();
    171172
    172173    HRESULT i_close(AutoCaller &autoCaller);
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r58437 r58484  
    41924192
    41934193                rc = medium->i_createDiffStorage(diff,
    4194                                                  MediumVariant_Standard,
     4194                                                 medium->i_getPreferredDiffVariant(),
    41954195                                                 pMediumLockList,
    41964196                                                 NULL /* aProgress */,
     
    1082310823            /* release the locks before the potentially lengthy operation */
    1082410824            alock.release();
    10825             rc = pMedium->i_createDiffStorage(diff, MediumVariant_Standard,
     10825            rc = pMedium->i_createDiffStorage(diff,
     10826                                              pMedium->i_getPreferredDiffVariant(),
    1082610827                                              pMediumLockList,
    1082710828                                              NULL /* aProgress */,
  • trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp

    r57425 r58484  
    725725
    726726        /* this already registers the new diff image */
    727         rc = pParent->i_createDiffStorage(diff, MediumVariant_Standard,
     727        rc = pParent->i_createDiffStorage(diff,
     728                                          pParent->i_getPreferredDiffVariant(),
    728729                                          pMediumLockList,
    729730                                          NULL /* aProgress */,
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r57413 r58484  
    45104510    /* m->strFormat is const, no need to lock */
    45114511    return m->strFormat;
     4512}
     4513
     4514/**
     4515 * Returns a preferred variant for differencing media.
     4516 */
     4517MediumVariant_T Medium::i_getPreferredDiffVariant()
     4518{
     4519    AutoCaller autoCaller(this);
     4520    AssertComRCReturn(autoCaller.rc(), MediumVariant_Standard);
     4521
     4522    /* check that our own format supports diffs */
     4523    if (!(m->formatObj->i_getCapabilities() & MediumFormatCapabilities_Differencing))
     4524        return MediumVariant_Standard;
     4525
     4526    /* m->variant is const, no need to lock */
     4527    return m->variant;
    45124528}
    45134529
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