VirtualBox

Changeset 37695 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Jun 29, 2011 6:53:37 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72555
Message:

Main/MediumAttachment+Machine: maintain a flag whether the medium was ejected, and add a method to query this information

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r37687 r37695  
    1169111691
    1169211692        pAttach->updateMedium(NULL);
     11693        pAttach->updateEjected();
    1169311694
    1169411695        pAttach.queryInterfaceTo(aNewAttachment);
  • trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp

    r36181 r37695  
    55
    66/*
    7  * Copyright (C) 2006-2009 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6262{
    6363    Data()
    64         : pMachine(NULL)
     64        : pMachine(NULL),
     65          fIsEjected(false)
    6566    { }
    6667
     
    6869    Machine * const pMachine;
    6970    /* later: const ComObjPtr<MediumAttachment> mPeer; */
     71
     72    bool                fIsEjected;
    7073
    7174    Backupable<BackupableMediumAttachmentData> bd;
     
    279282}
    280283
     284STDMETHODIMP MediumAttachment::COMGETTER(IsEjected)(BOOL *aEjected)
     285{
     286    LogFlowThisFuncEnter();
     287
     288    CheckComArgOutPointerValid(aEjected);
     289
     290    AutoCaller autoCaller(this);
     291    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     292
     293    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     294
     295    *aEjected = m->fIsEjected;
     296
     297    LogFlowThisFuncLeave();
     298    return S_OK;
     299}
     300
    281301STDMETHODIMP MediumAttachment::COMGETTER(BandwidthGroup) (IBandwidthGroup **aBwGroup)
    282302{
     
    406426    m->bd->pMedium = aMedium;
    407427    m->bd->fImplicit = false;
     428    m->fIsEjected = false;
    408429}
    409430
     
    417438}
    418439
     440/** Must be called from under this object's write lock. */
     441void MediumAttachment::updateEjected()
     442{
     443    Assert(isWriteLockOnCurrentThread());
     444
     445    m->fIsEjected = true;
     446}
     447
    419448void MediumAttachment::updateBandwidthGroup(const Utf8Str &aBandwidthGroup)
    420449{
Note: See TracChangeset for help on using the changeset viewer.

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