Changeset 16587 in vbox
- Timestamp:
- Feb 9, 2009 1:48:57 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 42551
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r16568 r16587 1282 1282 uint64_t ullMemSizeVBox = vsysThis.ullMemorySize / _1M; 1283 1283 /* Check for the constrains */ 1284 if (ullMemSizeVBox != 0 && 1284 if (ullMemSizeVBox != 0 && 1285 1285 (ullMemSizeVBox < static_cast<uint64_t>(SchemaDefs::MinGuestRAM) || 1286 1286 ullMemSizeVBox > static_cast<uint64_t>(SchemaDefs::MaxGuestRAM))) … … 1396 1396 if (cIDEused == 1) 1397 1397 pNewDesc->addWarning(tr("The virtual system claims support for more than one IDE controller, but VirtualBox has support for only one.")); 1398 1398 1399 1399 } 1400 1400 ++cIDEused; … … 1420 1420 if (cSATAused == 1) 1421 1421 pNewDesc->addWarning(tr("The virtual system claims support for more than one SATA controller, but VirtualBox has support for only one.")); 1422 1422 1423 1423 } 1424 1424 ++cSATAused; … … 1449 1449 if (cSCSIused == 1) 1450 1450 pNewDesc->addWarning(tr("The virtual system claims support for more than one SCSI controller, but VirtualBox has support for only one.")); 1451 1451 1452 1452 } 1453 1453 ++cSCSIused; … … 1542 1542 1543 1543 ComObjPtr<Progress> progress; 1544 1545 1544 try 1546 1545 { … … 1880 1879 the machine, so make an extra try/catch block. */ 1881 1880 ComPtr<ISession> session; 1881 ComPtr<IHardDisk2> srcHdVBox; 1882 1882 try 1883 1883 { 1884 // in order to attach hard disks we need to open a session for the new machine 1884 /* In order to attach hard disks we need to open a session 1885 * for the new machine */ 1885 1886 rc = session.createInprocObject(CLSID_Session); 1886 1887 CheckComRCThrowRC(rc); … … 1912 1913 pcszDstFilePath)); 1913 1914 1914 / / find the disk from the OVF's disk list1915 /* Find the disk from the OVF's disk list */ 1915 1916 DiskImagesMap::const_iterator itDiskImage = app->m->mapDisks.find(vsdeHD->strRef); 1916 / / vsdeHD->strRef contains the disk identifier (e.g. "vmdisk1", which should exist1917 // in the virtual system's disks map under that ID and also in the global images map1917 /* vsdeHD->strRef contains the disk identifier (e.g. "vmdisk1"), which should exist 1918 in the virtual system's disks map under that ID and also in the global images map. */ 1918 1919 VirtualDisksMap::const_iterator itVirtualDisk = vsysThis.mapVirtualDisks.find(vsdeHD->strRef); 1919 1920 … … 1933 1934 { 1934 1935 /* @todo: we have to create a new one */ 1936 throw setError(E_FAIL, 1937 tr("Creation of new disk images not supported yet.")); 1935 1938 } 1936 1939 else … … 1943 1946 * attached already from a previous import) */ 1944 1947 /* First open the existing disk image */ 1945 ComPtr<IHardDisk2> srcHdVBox;1946 1948 rc = app->mVirtualBox->OpenHardDisk2(Bstr(strSrcFilePath), srcHdVBox.asOutParam()); 1947 1949 CheckComRCThrowRC(rc); … … 1966 1968 ComPtr<IMachine> sMachine; 1967 1969 rc = session->COMGETTER(Machine)(sMachine.asOutParam()); 1970 CheckComRCThrowRC(rc); 1968 1971 Guid hdId; 1969 1972 rc = dstHdVBox->COMGETTER(Id)(hdId.asOutParam());; … … 1976 1979 case HardDiskController::IDE: sbt = StorageBus_IDE; break; 1977 1980 case HardDiskController::SATA: sbt = StorageBus_SATA; break; 1978 1981 //case HardDiskController::SCSI: sbt = StorageBus_SCSI; break; // @todo: not available yet 1979 1982 default: break; 1980 1983 } … … 1990 1993 catch(HRESULT aRC) 1991 1994 { 1992 /* Unregister/Delete the failed machine */ 1993 /* @todo: Not sure what to do when there are succesfully 1995 /* @todo: Not sure what to do when there are successfully 1994 1996 added disk images. Delete them also? For now we leave 1995 1997 them. */ 1998 if (!srcHdVBox.isNull()) 1999 { 2000 /* Close any open src disks */ 2001 rc = srcHdVBox->Close(); 2002 CheckComRCThrowRC(rc); 2003 } 1996 2004 if (!session.isNull()) 1997 2005 { … … 2001 2009 CheckComRCThrowRC(rc); 2002 2010 } 2011 /* Unregister/Delete the failed machine */ 2003 2012 ComPtr<IMachine> failedMachine; 2004 2013 rc = app->mVirtualBox->UnregisterMachine(newMachineId, failedMachine.asOutParam());
Note:
See TracChangeset
for help on using the changeset viewer.