Changeset 18306 in vbox
- Timestamp:
- Mar 26, 2009 11:57:52 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
-
ApplianceImpl.cpp (modified) (8 diffs)
-
ProgressImpl.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r18304 r18306 51 51 int64_t iCapacity; // value from DiskSection/Disk/@capacity; 52 52 // (maximum size for dynamic images, I guess; we always translate this to bytes) 53 int64_t iPopulatedSize; // value from DiskSection/Disk/@populatedSize53 int64_t iPopulatedSize; // optional value from DiskSection/Disk/@populatedSize 54 54 // (actual used size of disk, always in bytes; can be an estimate of used disk 55 // space, but cannot be larger than iCapacity )55 // space, but cannot be larger than iCapacity; -1 if not set) 56 56 Utf8Str strFormat; // value from DiskSection/Disk/@format 57 57 // typically http://www.vmware.com/specifications/vmdk.html#sparse … … 1551 1551 pController->ulIndex, 1552 1552 hd.ulAddressOnParent); 1553 ULONG ulSize = 0; 1554 if (di.iPopulatedSize != -1) 1555 ulSize = (ULONG)(di.iPopulatedSize / _1M); 1556 else if (di.iSize != -1) 1557 ulSize = (ULONG)(di.iSize / _1M); 1558 else if (di.iCapacity != -1) 1559 ulSize = (ULONG)(di.iCapacity / _1M); 1560 if (ulSize == 0) 1561 ulSize = 10000; // assume 10 GB, this is for the progress bar only anyway 1553 1562 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage, 1554 1563 hd.strDiskId, 1555 1564 di.strHref, 1556 1565 strPath, 1557 (uint32_t)(di.iPopulatedSize / _1M),1566 ulSize, 1558 1567 strExtraConfig); 1559 1568 } … … 1745 1754 } 1746 1755 1747 if (!task->progress.isNull())1748 rc = task->progress->setCurrentOperationProgress(20); // let's say 1/5 of the XML is done here1749 1750 1756 /* CPU count (ignored for now) */ 1751 1757 // EntriesList vsdeCPU = vsd->findByType (VirtualSystemDescriptionType_CPU); … … 1768 1774 rc = pNewMachine->COMSETTER(VRAMSize)(vramVBox); 1769 1775 if (FAILED(rc)) throw rc; 1770 1771 if (!task->progress.isNull())1772 rc = task->progress->setCurrentOperationProgress(40); // let's say 2/5 of the XML is done here1773 1776 1774 1777 /* Audio Adapter */ … … 1804 1807 if (FAILED(rc)) throw rc; 1805 1808 #endif /* VBOX_WITH_USB */ 1806 1807 if (!task->progress.isNull())1808 rc = task->progress->setCurrentOperationProgress(60); // let's say 3/5 of the XML is done here1809 1809 1810 1810 /* Change the network adapters */ … … 1918 1918 if (FAILED(rc)) throw rc; 1919 1919 1920 if (!task->progress.isNull())1921 rc = task->progress->setCurrentOperationProgress(80); // let's say 4/5 of the XML is done here1922 1923 1920 /* CDROM drive */ 1924 1921 /* @todo: I can't disable the CDROM. So nothing to do for now */ … … 2004 2001 if (FAILED(rc)) throw rc; 2005 2002 2006 if (!task->progress.isNull())2007 rc = task->progress->setCurrentOperationProgress(90);2008 2009 2003 // store new machine for roll-back in case of errors 2010 2004 llMachinesRegistered.push_back(newMachineId); … … 3160 3154 std::list<VirtualSystemDescriptionEntry*>::const_iterator itH; 3161 3155 for (itH = avsdeHDs.begin(); 3162 itH != avsdeHDs.end();3163 ++itH)3156 itH != avsdeHDs.end(); 3157 ++itH) 3164 3158 { 3165 ulTotalMB += (**itH).ulSizeMB; 3159 const VirtualSystemDescriptionEntry *pHD = *itH; 3160 ulTotalMB += pHD->ulSizeMB; 3166 3161 ++cDisks; 3167 3162 } -
trunk/src/VBox/Main/ProgressImpl.cpp
r18277 r18306 859 859 m_ulOperationPercent = 0; 860 860 861 Log(("Progress::setNextOperation(%ls): ulNextOperationsWeight = %d; m_ulCurrentOperation is now %d, m_ulOperationsCompletedWeight is now %d\n",861 Log(("Progress::setNextOperation(%ls): ulNextOperationsWeight = %d; m_ulCurrentOperation is now %d, m_ulOperationsCompletedWeight is now %d\n", 862 862 m_bstrOperationDescription.raw(), ulNextOperationsWeight, m_ulCurrentOperation, m_ulOperationsCompletedWeight)); 863 863
Note:
See TracChangeset
for help on using the changeset viewer.

