Changeset 17313 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 3, 2009 7:53:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImpl.cpp
r17291 r17313 2210 2210 default: 2211 2211 throw setError(VBOX_E_NOT_SUPPORTED, 2212 tr("Invalid channel %RI16 specified; IDE con rollers support only 0, 1 or 2"), vd.ulAddressOnParent);2212 tr("Invalid channel %RI16 specified; IDE controllers support only 0, 1 or 2"), vd.ulAddressOnParent); 2213 2213 break; 2214 2214 } … … 2738 2738 2739 2739 uint32_t uControllerId = 1; 2740 Utf8Str strIdeControllerID;2741 Utf8Str strSataControllerID;2740 uint32_t uidIdeController; 2741 uint32_t uidSataController; 2742 2742 2743 2743 // <const name="HardDiskControllerIDE" value="6" /> … … 2757 2757 if (strVbox.length()) 2758 2758 { 2759 strIdeControllerID = Utf8StrFmt("%RI32", uControllerId++);2760 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, strIdeControllerID, strVbox, "");2759 uidIdeController = uControllerId++; 2760 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerIDE, Utf8StrFmt("%d", uidIdeController), strVbox, ""); 2761 2761 } 2762 2762 … … 2770 2770 if (fSataEnabled) 2771 2771 { 2772 strSataControllerID = Utf8StrFmt("%RI32", uControllerId++);2773 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, strSataControllerID, strVbox, "");2772 uidSataController = uControllerId++; 2773 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskControllerSATA, Utf8StrFmt("%d", uidSataController), strVbox, ""); 2774 2774 } 2775 2775 #endif // VBOX_WITH_AHCI … … 2788 2788 ComObjPtr<HardDiskAttachment> pHDA = *itA; 2789 2789 2790 // getthe attachment's data2790 // the attachment's data 2791 2791 ComPtr<IHardDisk> pHardDisk; 2792 2792 StorageBus_T storageBus; … … 2794 2794 LONG lDevice; 2795 2795 2796 // and how this translates to the virtual system 2797 LONG lChannelVsys; 2798 2796 2799 rc = pHDA->COMGETTER(HardDisk)(pHardDisk.asOutParam()); 2797 2800 if (FAILED(rc)) throw rc; … … 2806 2809 if (FAILED(rc)) throw rc; 2807 2810 2811 Bstr bstrLocation; 2812 rc = pHardDisk->COMGETTER(Location)(bstrLocation.asOutParam()); 2808 2813 Bstr bstrName; 2809 2814 rc = pHardDisk->COMGETTER(Name)(bstrName.asOutParam()); 2810 2815 2816 uint32_t uidControllerVsys; 2817 2818 switch (storageBus) 2819 { 2820 case HardDiskController::IDE: 2821 // this is the exact reverse to what we're doing in Appliance::taskThreadImportMachines, 2822 // and it must be updated when that is changed! 2823 2824 if (lChannel == 0 && lDevice == 0) // primary master 2825 lChannelVsys = 0; 2826 else if (lChannel == 0 && lDevice == 1) // primary slave 2827 lChannelVsys = 1; 2828 else if (lChannel == 1 && lDevice == 1) // secondary slave; secondary master is always CDROM 2829 lChannelVsys = 2; 2830 else 2831 throw setError(VBOX_E_NOT_SUPPORTED, 2832 tr("Cannot handle hard disk attachment: channel is %d, device is %d"), lChannel, lDevice); 2833 break; 2834 2835 uidControllerVsys = uidIdeController; 2836 break; 2837 2838 case HardDiskController::SATA: 2839 lChannelVsys = lChannel; // should be between 0 and 29 2840 uidControllerVsys = uidSataController; 2841 break; 2842 2843 case HardDiskController::SCSI: 2844 // mhda.busType = StorageBus_SCSI; 2845 throw setError(VBOX_E_NOT_SUPPORTED, 2846 tr("SCSI controller support is not available yet in VirtualBox")); 2847 // @todo 2848 break; 2849 2850 default: break; 2851 } 2852 2811 2853 pNewDesc->addEntry(VirtualSystemDescriptionType_HardDiskImage, 2812 Utf8Str(bstrName), // hd.strDiskId,2813 "", // di.strHref,2814 "",2815 ""); // strExtraConfig2854 Utf8Str(bstrName), // disk ID: let's use the name 2855 "", // OVF value: unknown as of now 2856 Utf8Str(bstrLocation), // vbox value: media path 2857 Utf8StrFmt("controller=%d;channel=%d", uidControllerVsys, lChannelVsys)); 2816 2858 } 2817 2859
Note:
See TracChangeset
for help on using the changeset viewer.