- Timestamp:
- Jan 28, 2013 9:56:52 AM (12 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r44365 r44409 12451 12451 12452 12452 <note> 12453 Reading this property on a differencing medium will return the size12454 of its <link to="#base"/> medium.12455 </note>12456 <note>12457 12453 For media whose state is <link to="#state"/> is <link 12458 12454 to="MediumState_Inaccessible"/>, the value of this property is the -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r44395 r44409 1894 1894 CheckComArgOutPointerValid(aLogicalSize); 1895 1895 1896 { 1897 AutoCaller autoCaller(this); 1898 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1899 1900 /* we access mParent */ 1901 AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 1902 1903 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1904 1905 if (m->pParent.isNull()) 1906 { 1907 *aLogicalSize = m->logicalSize; 1908 1909 return S_OK; 1910 } 1911 } 1912 1913 /* We assume that some backend may decide to return a meaningless value in 1914 * response to VDGetSize() for differencing media and therefore always 1915 * ask the base medium ourselves. */ 1916 1917 /* base() will do callers/locking */ 1918 1919 return getBase()->COMGETTER(LogicalSize)(aLogicalSize); 1896 AutoCaller autoCaller(this); 1897 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1898 1899 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1900 1901 *aLogicalSize = m->logicalSize; 1902 1903 return S_OK; 1920 1904 } 1921 1905 … … 5741 5725 else 5742 5726 { 5743 5727 Assert(!mediumId.isZero()); 5744 5728 5745 5729 if (mediumId != uuid) … … 7993 7977 HRESULT rc = S_OK; 7994 7978 7995 /* Lock all in {parent,child} order. The lock is also used as a 7996 * signal from the task initiator (which releases it only after 7997 * RTThreadCreate()) that we can start the job. */ 7998 AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS); 7979 uint64_t size = 0, logicalSize = 0; 7999 7980 8000 7981 try 8001 7982 { 7983 /* The lock is also used as a signal from the task initiator (which 7984 * releases it only after RTThreadCreate()) that we can start the job */ 7985 AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS); 7986 8002 7987 PVBOXHDD hdd; 8003 7988 int vrc = VDCreate(m->vdDiskIfaces, convertDeviceType(), &hdd); … … 8068 8053 vdError(vrc).c_str()); 8069 8054 } 8055 size = VDGetFileSize(hdd, VD_LAST_IMAGE); 8056 logicalSize = VDGetSize(hdd, VD_LAST_IMAGE); 8070 8057 } 8071 8058 catch (HRESULT aRC) { rc = aRC; } … … 8074 8061 } 8075 8062 catch (HRESULT aRC) { rc = aRC; } 8063 8064 if (SUCCEEDED(rc)) 8065 { 8066 AutoWriteLock thisLock(this COMMA_LOCKVAL_SRC_POS); 8067 m->size = size; 8068 m->logicalSize = logicalSize; 8069 } 8076 8070 8077 8071 /* Everything is explicitly unlocked when the task exits,
Note:
See TracChangeset
for help on using the changeset viewer.