Changeset 31287 in vbox for trunk/src/VBox/Main/MediumAttachmentImpl.cpp
- Timestamp:
- Aug 2, 2010 12:13:00 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 64314
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumAttachmentImpl.cpp
r30681 r31287 52 52 const LONG lDevice; 53 53 const DeviceType_T type; 54 bool fPassthrough : 1; 55 bool fImplicit : 1; 54 bool fPassthrough; 55 bool fImplicit; 56 ULONG mBandwidthLimit; 56 57 }; 57 58 … … 132 133 m->bd->fImplicit = false; 133 134 135 /* Default is no limit. */ 136 m->bd->mBandwidthLimit = 0; 137 134 138 /* Confirm a successful initialization when it's the case */ 135 139 autoInitSpan.setSucceeded(); … … 272 276 } 273 277 278 STDMETHODIMP MediumAttachment::COMGETTER(BandwidthLimit) (ULONG *aLimit) 279 { 280 CheckComArgOutPointerValid(aLimit); 281 282 AutoCaller autoCaller(this); 283 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 284 285 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 286 287 *aLimit = m->bd->mBandwidthLimit; 288 return S_OK; 289 } 290 291 STDMETHODIMP MediumAttachment::COMSETTER(BandwidthLimit) (ULONG aLimit) 292 { 293 AutoCaller autoCaller(this); 294 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 295 296 /* the machine doesn't need to be mutable */ 297 298 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 299 300 if (aLimit != m->bd->mBandwidthLimit) 301 { 302 m->bd.backup(); 303 m->bd->mBandwidthLimit = aLimit; 304 305 /* todo: not all storage attachments will support this. */ 306 } 307 return S_OK; 308 } 309 274 310 /** 275 311 * @note Locks this object for writing.
Note:
See TracChangeset
for help on using the changeset viewer.