Changeset 24522 in vbox for trunk/src/VBox/Main
- Timestamp:
- Nov 9, 2009 5:25:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r24511 r24522 1426 1426 } 1427 1427 1428 /// @todo FIXME 1429 #if 0 1430 /* Floppy drive */ 1428 // Floppy support 1431 1429 std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsdescThis->findByType(VirtualSystemDescriptionType_Floppy); 1432 // Floppy support is enabled if there's at least one such entry; to disable floppy support, 1433 // the type of the floppy item would have been changed to "ignore" 1434 bool fFloppyEnabled = vsdeFloppy.size() > 0; 1435 ComPtr<IMedium> floppyDrive; 1436 rc = pNewMachine->COMGETTER(FloppyDrive)(floppyDrive.asOutParam()); 1437 if (FAILED(rc)) throw rc; 1438 rc = floppyDrive->COMSETTER(Enabled)(fFloppyEnabled); 1439 if (FAILED(rc)) throw rc; 1440 1441 /* CDROM drive */ 1442 /* @todo: I can't disable the CDROM. So nothing to do for now */ 1443 // std::list<VirtualSystemDescriptionEntry*> vsdeFloppy = vsd->findByType(VirtualSystemDescriptionType_CDROM); 1444 #endif 1430 if (vsdeFloppy.size() > 1) 1431 throw setError(VBOX_E_FILE_ERROR, 1432 tr("Too many floppy controllers in OVF; import facility only supports one")); 1433 if (vsdeFloppy.size() == 1) 1434 { 1435 ComPtr<IStorageController> pController; 1436 rc = pNewMachine->AddStorageController(Bstr("Floppy Controller"), StorageBus_Floppy, pController.asOutParam()); 1437 if (FAILED(rc)) throw rc; 1438 1439 Bstr bstrName; 1440 rc = pController->COMGETTER(Name)(bstrName.asOutParam()); 1441 if (FAILED(rc)) throw rc; 1442 1443 rc = pNewMachine->AttachDevice(bstrName.raw(), (PRInt32)0, (PRInt32)0, (ULONG)DeviceType_Floppy, Bstr("").raw()); 1444 if (FAILED(rc)) throw rc; 1445 } 1445 1446 1446 1447 /* Hard disk controller IDE */ … … 1448 1449 if (vsdeHDCIDE.size() > 1) 1449 1450 throw setError(VBOX_E_FILE_ERROR, 1450 tr("Too many IDE controllers in OVF; VirtualBoxonly supports one"));1451 tr("Too many IDE controllers in OVF; import facility only supports one")); 1451 1452 if (vsdeHDCIDE.size() == 1) 1452 1453 { … … 1760 1761 } 1761 1762 } 1763 1764 #if 0 // @todo Implement CD-ROM import for 3.1 final 1765 // Add CD-ROMs to the appropriate controllers. 1766 std::list<VirtualSystemDescriptionEntry*> vsdeCDROM = vsdescThis->findByType(VirtualSystemDescriptionType_CDROM); 1767 if (avsdeHDs.size() > 0) 1768 { 1769 /* If in the next block an error occur we have to deregister 1770 the machine, so make an extra try/catch block. */ 1771 ComPtr<IMedium> srcHdVBox; 1772 bool fSourceHdNeedsClosing = false; 1773 1774 try 1775 { 1776 /* In order to attach hard disks we need to open a session 1777 * for the new machine */ 1778 rc = mVirtualBox->OpenSession(session, newMachineId_); 1779 if (FAILED(rc)) throw rc; 1780 fSessionOpen = true; 1781 1782 for (std::list<VirtualSystemDescriptionEntry*>::const_iterator it = vsdeCDROM.begin(); 1783 it != vsdeCDROM.end(); 1784 ++it) 1785 { 1786 VirtualSystemDescriptionEntry *pVSDE = *it; 1787 1788 // @@todo 1789 1790 } // end for (itHD = avsdeHDs.begin(); 1791 1792 // only now that we're done with all disks, close the session 1793 rc = session->Close(); 1794 if (FAILED(rc)) throw rc; 1795 fSessionOpen = false; 1796 } 1797 catch(HRESULT /* aRC */) 1798 { 1799 if (fSourceHdNeedsClosing) 1800 srcHdVBox->Close(); 1801 1802 if (fSessionOpen) 1803 session->Close(); 1804 1805 throw; 1806 } 1807 } 1808 #endif 1762 1809 } 1763 1810 catch(HRESULT aRC)
Note:
See TracChangeset
for help on using the changeset viewer.