Changeset 37695 in vbox
- Timestamp:
- Jun 29, 2011 6:53:37 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r37671 r37695 773 773 for (ULONG k = 0; k < cDevices; ++ k) 774 774 { 775 ComPtr<IMediumAttachment> mediumAttach; 776 machine->GetMediumAttachment(storageCtlName.raw(), 777 i, k, 778 mediumAttach.asOutParam()); 779 BOOL fIsEjected = FALSE; 780 DeviceType_T devType = DeviceType_Null; 781 if (mediumAttach) 782 { 783 mediumAttach->COMGETTER(IsEjected)(&fIsEjected); 784 mediumAttach->COMGETTER(Type)(&devType); 785 } 775 786 rc = machine->GetMedium(storageCtlName.raw(), i, k, 776 787 medium.asOutParam()); 777 788 if (SUCCEEDED(rc) && medium) 778 789 { 779 BOOL fPassthrough; 780 ComPtr<IMediumAttachment> mediumAttach; 781 782 rc = machine->GetMediumAttachment(storageCtlName.raw(), 783 i, k, 784 mediumAttach.asOutParam()); 785 if (SUCCEEDED(rc) && mediumAttach) 790 BOOL fPassthrough = FALSE; 791 792 if (mediumAttach) 786 793 mediumAttach->COMGETTER(Passthrough)(&fPassthrough); 787 794 … … 798 805 RTPrintf("\"%lS-dvdpassthrough\"=\"%s\"\n", storageCtlName.raw(), 799 806 fPassthrough ? "on" : "off"); 807 if (devType == DeviceType_DVD) 808 RTPrintf("\"%lS-IsEjected\"=\"%s\"\n", storageCtlName.raw(), 809 fIsEjected ? "on" : "off"); 800 810 } 801 811 else … … 806 816 if (fPassthrough) 807 817 RTPrintf(" (passthrough enabled)"); 818 if (fIsEjected) 819 RTPrintf(" (ejected)"); 808 820 RTPrintf("\n"); 809 821 } … … 812 824 { 813 825 if (details == VMINFO_MACHINEREADABLE) 826 { 814 827 RTPrintf("\"%lS-%d-%d\"=\"emptydrive\"\n", storageCtlName.raw(), i, k); 815 else 816 RTPrintf("%lS (%d, %d): Empty\n", storageCtlName.raw(), i, k); 828 if (devType == DeviceType_DVD) 829 RTPrintf("\"%lS-IsEjected\"=\"%s\"\n", storageCtlName.raw(), 830 fIsEjected ? "on" : "off"); 831 } 832 else 833 { 834 RTPrintf("%lS (%d, %d): Empty", storageCtlName.raw(), i, k); 835 if (fIsEjected) 836 RTPrintf(" (ejected)"); 837 RTPrintf("\n"); 838 } 817 839 } 818 840 else -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r37687 r37695 9572 9572 <interface 9573 9573 name="IMediumAttachment" extends="$unknown" 9574 uuid=" aa4b4840-934f-454d-9a28-23e8f4235edf"9574 uuid="8d48f68f-807a-4e4e-9449-827fe9ea8498" 9575 9575 wsmap="struct" 9576 9576 > … … 9783 9783 <attribute name="passthrough" type="boolean" readonly="yes"> 9784 9784 <desc>Pass I/O requests through to a device on the host.</desc> 9785 </attribute> 9786 9787 <attribute name="isEjected" type="boolean" readonly="yes"> 9788 <desc>Signals that the removable medium has been ejected. This is not 9789 necessarily equivalent to having a @c null medium association.</desc> 9785 9790 </attribute> 9786 9791 -
trunk/src/VBox/Main/include/MediumAttachmentImpl.h
r36181 r37695 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 61 61 STDMETHOD(COMGETTER(Type))(DeviceType_T *aType); 62 62 STDMETHOD(COMGETTER(Passthrough))(BOOL *aPassthrough); 63 STDMETHOD(COMGETTER(IsEjected))(BOOL *aIsEjected); 63 64 STDMETHOD(COMGETTER(BandwidthGroup))(IBandwidthGroup **aBwGroup); 64 65 … … 89 90 90 91 /** Must be called from under this object's write lock. */ 92 void updateEjected(); 93 94 /** Must be called from under this object's write lock. */ 91 95 void updateBandwidthGroup(const Utf8Str &aBandwidthGroup); 92 96 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r37687 r37695 11691 11691 11692 11692 pAttach->updateMedium(NULL); 11693 pAttach->updateEjected(); 11693 11694 11694 11695 pAttach.queryInterfaceTo(aNewAttachment); -
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r36181 r37695 5 5 6 6 /* 7 * Copyright (C) 2006-20 09Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 62 62 { 63 63 Data() 64 : pMachine(NULL) 64 : pMachine(NULL), 65 fIsEjected(false) 65 66 { } 66 67 … … 68 69 Machine * const pMachine; 69 70 /* later: const ComObjPtr<MediumAttachment> mPeer; */ 71 72 bool fIsEjected; 70 73 71 74 Backupable<BackupableMediumAttachmentData> bd; … … 279 282 } 280 283 284 STDMETHODIMP 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 281 301 STDMETHODIMP MediumAttachment::COMGETTER(BandwidthGroup) (IBandwidthGroup **aBwGroup) 282 302 { … … 406 426 m->bd->pMedium = aMedium; 407 427 m->bd->fImplicit = false; 428 m->fIsEjected = false; 408 429 } 409 430 … … 417 438 } 418 439 440 /** Must be called from under this object's write lock. */ 441 void MediumAttachment::updateEjected() 442 { 443 Assert(isWriteLockOnCurrentThread()); 444 445 m->fIsEjected = true; 446 } 447 419 448 void MediumAttachment::updateBandwidthGroup(const Utf8Str &aBandwidthGroup) 420 449 {
Note:
See TracChangeset
for help on using the changeset viewer.