VirtualBox

Changeset 7442 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Mar 13, 2008 2:33:18 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28880
Message:

Main: Applied SATA changes from #2406. Increased XML settings version format from 1.2 to 1.3.pre.

Location:
trunk/src/VBox/Main
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r7418 r7442  
    61316131    ComPtr<IHardDisk> hardDisk;
    61326132    hrc = hda->COMGETTER(HardDisk)(hardDisk.asOutParam());                      H();
    6133     DiskControllerType_T enmCtl;
    6134     hrc = hda->COMGETTER(Controller)(&enmCtl);                                  H();
     6133    StorageBus_T enmBus;
     6134    hrc = hda->COMGETTER(Bus)(&enmBus);                                         H();
    61356135    LONG lDev;
    6136     hrc = hda->COMGETTER(DeviceNumber)(&lDev);                                  H();
    6137 
    6138     int i;
    6139     switch (enmCtl)
    6140     {
    6141         case DiskControllerType_IDE0:
    6142             i = 0;
    6143             break;
    6144         case DiskControllerType_IDE1:
    6145             i = 2;
     6136    hrc = hda->COMGETTER(Device)(&lDev);                                        H();
     6137    LONG lChannel;
     6138    hrc = hda->COMGETTER(Channel)(&lChannel);                                   H();
     6139
     6140    int iLUN;
     6141    switch (enmBus)
     6142    {
     6143        case StorageBus_IDE:
     6144        {
     6145            if (lChannel >= 2)
     6146            {
     6147                AssertMsgFailed(("invalid controller channel number: %d\n", lChannel));
     6148                return VERR_GENERAL_FAILURE;
     6149            }
     6150
     6151            if (lDev >= 2)
     6152            {
     6153                AssertMsgFailed(("invalid controller device number: %d\n", lDev));
     6154                return VERR_GENERAL_FAILURE;
     6155            }
     6156            iLUN = 2*lChannel + lDev;
     6157        }
     6158        break;
     6159        case StorageBus_SATA:
     6160            iLUN = lChannel;
    61466161            break;
    61476162        default:
    6148             AssertMsgFailed(("invalid disk controller type: %d\n", enmCtl));
     6163            AssertMsgFailed(("invalid disk controller type: %d\n", enmBus));
    61496164            return VERR_GENERAL_FAILURE;
    61506165    }
    6151 
    6152     if (lDev < 0 || lDev >= 2)
    6153     {
    6154         AssertMsgFailed(("invalid controller device number: %d\n", lDev));
    6155         return VERR_GENERAL_FAILURE;
    6156     }
    6157 
    6158     i = i + lDev;
    61596166
    61606167    /*
     
    61636170     */
    61646171    PCFGMNODE pCfg;
    6165     PCFGMNODE pLunL1 = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "Devices/piix3ide/0/LUN#%d/AttachedDriver/", i);
     6172    PCFGMNODE pLunL1 = CFGMR3GetChildF(CFGMR3GetRoot(pVM), "Devices/piix3ide/0/LUN#%d/AttachedDriver/", iLUN);
    61666173    if (!pLunL1)
    61676174    {
     
    61706177
    61716178        PCFGMNODE pLunL0;
    6172         rc = CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%d", i);                        RC_CHECK();
     6179        rc = CFGMR3InsertNodeF(pInst, &pLunL0, "LUN#%d", iLUN);                     RC_CHECK();
    61736180        rc = CFGMR3InsertString(pLunL0, "Driver",              "Block");            RC_CHECK();
    61746181        rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
     
    62486255        }
    62496256        else
    6250             LogFlowFunc (("LUN#%d: old leaf image '%s'\n", i, pszPath));
     6257            LogFlowFunc (("LUN#%d: old leaf image '%s'\n", iLUN, pszPath));
    62516258
    62526259        MMR3HeapFree(pszPath);
     
    62566263         * Detach the driver and replace the config node.
    62576264         */
    6258         rc = PDMR3DeviceDetach(pVM, "piix3ide", 0, i);                              RC_CHECK();
     6265        rc = PDMR3DeviceDetach(pVM, "piix3ide", 0, iLUN);                           RC_CHECK();
    62596266        CFGMR3RemoveNode(pCfg);
    62606267        rc = CFGMR3InsertNode(pLunL1, "Config", &pCfg);                             RC_CHECK();
     
    62716278    hrc = hardDisk->COMGETTER(Location)(&str);                                  H();
    62726279    STR_CONV();
    6273     LogFlowFunc (("LUN#%d: leaf image '%s'\n", i, psz));
     6280    LogFlowFunc (("LUN#%d: leaf image '%s'\n", iLUN, psz));
    62746281    rc = CFGMR3InsertString(pCfg, "Path", psz);                                 RC_CHECK();
    62756282    STR_FREE();
     
    63036310     * Attach the new driver.
    63046311     */
    6305     rc = PDMR3DeviceAttach(pVM, "piix3ide", 0, i, NULL);                        RC_CHECK();
     6312    rc = PDMR3DeviceAttach(pVM, "piix3ide", 0, iLUN, NULL);                     RC_CHECK();
    63066313
    63076314    LogFlowFunc (("Returns success\n"));
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r7418 r7442  
    9696    char           *psz = NULL;
    9797    BSTR            str = NULL;
    98     unsigned        i;
    9998
    10099#define STR_CONV()  do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0)
     
    224223    PCFGMNODE pLunL1 = NULL;        /* /Devices/Dev/0/LUN#0/AttachedDriver/ */
    225224    PCFGMNODE pLunL2 = NULL;        /* /Devices/Dev/0/LUN#0/AttachedDriver/Config/ */
     225    PCFGMNODE pIdeInst = NULL;      /* /Devices/piix3ide/0/ */
     226    PCFGMNODE pSataInst = NULL;     /* /Devices/ahci/0/ */
    226227
    227228    rc = CFGMR3InsertNode(pRoot, "Devices", &pDevices);                             RC_CHECK();
     
    573574     */
    574575    rc = CFGMR3InsertNode(pDevices, "piix3ide", &pDev); /* piix3 */                 RC_CHECK();
    575     rc = CFGMR3InsertNode(pDev,     "0", &pInst);                                   RC_CHECK();
    576     rc = CFGMR3InsertInteger(pInst, "Trusted",              1);     /* boolean */   RC_CHECK();
    577     rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo",          1);                     RC_CHECK();
     576    rc = CFGMR3InsertNode(pDev,     "0", &pIdeInst);                                RC_CHECK();
     577    rc = CFGMR3InsertInteger(pIdeInst, "Trusted",              1);  /* boolean */   RC_CHECK();
     578    rc = CFGMR3InsertInteger(pIdeInst, "PCIDeviceNo",          1);                  RC_CHECK();
    578579    Assert(!afPciDeviceNo[1]);
    579580    afPciDeviceNo[1] = true;
    580     rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",        1);                     RC_CHECK();
    581     rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                               RC_CHECK();
     581    rc = CFGMR3InsertInteger(pIdeInst, "PCIFunctionNo",        1);                  RC_CHECK();
     582    rc = CFGMR3InsertNode(pIdeInst,    "Config", &pCfg);                            RC_CHECK();
    582583    rc = CFGMR3InsertInteger(pCfg,  "PIIX4", fPIIX4);               /* boolean */   RC_CHECK();
    583584
    584585    /* Attach the status driver */
    585     rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                            RC_CHECK();
     586    rc = CFGMR3InsertNode(pIdeInst,    "LUN#999", &pLunL0);                         RC_CHECK();
    586587    rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");          RC_CHECK();
    587588    rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                               RC_CHECK();
     
    590591    rc = CFGMR3InsertInteger(pCfg,  "Last",     3);                                 RC_CHECK();
    591592
     593    /*
     594     * SATA controller
     595     */
     596    ComPtr<ISATAController> sataController;
     597    hrc = pMachine->COMGETTER(SATAController)(sataController.asOutParam());
     598    BOOL enabled = FALSE;
     599
     600    if (sataController)
     601    {
     602        hrc = sataController->COMGETTER(Enabled)(&enabled);                         H();
     603
     604        if (enabled)
     605        {
     606            rc = CFGMR3InsertNode(pDevices, "ahci", &pDev);                             RC_CHECK();
     607            rc = CFGMR3InsertNode(pDev,     "0", &pSataInst);                           RC_CHECK();
     608            rc = CFGMR3InsertInteger(pIdeInst, "Trusted",              1);              RC_CHECK();
     609            rc = CFGMR3InsertInteger(pIdeInst, "PCIDeviceNo",          13);             RC_CHECK();
     610            Assert(!afPciDeviceNo[13]);
     611            afPciDeviceNo[13] = true;
     612            rc = CFGMR3InsertInteger(pIdeInst, "PCIFunctionNo",        1);              RC_CHECK();
     613            rc = CFGMR3InsertNode(pIdeInst,    "Config", &pCfg);                        RC_CHECK();
     614
     615            for (uint32_t i = 0; i < 4; i++)
     616            {
     617                const char *g_apszConfig[] =
     618                    { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" };
     619                LONG aPortNumber;
     620
     621                hrc = sataController->GetIDEEmulationPort(i, &aPortNumber);             H();
     622                rc = CFGMR3InsertInteger(pCfg, g_apszConfig[i], aPortNumber);           RC_CHECK();
     623            }
     624        }
     625    }
     626
    592627    /* Attach the harddisks */
    593628    ComPtr<IHardDiskAttachmentCollection> hdaColl;
     
    600635           &&   fMore)
    601636    {
     637        PCFGMNODE pHardDiskCtl;
    602638        ComPtr<IHardDiskAttachment> hda;
    603639        hrc = hdaEnum->GetNext(hda.asOutParam());                                   H();
    604640        ComPtr<IHardDisk> hardDisk;
    605641        hrc = hda->COMGETTER(HardDisk)(hardDisk.asOutParam());                      H();
    606         DiskControllerType_T enmCtl;
    607         hrc = hda->COMGETTER(Controller)(&enmCtl);                                  H();
     642        StorageBus_T enmBus;
     643        hrc = hda->COMGETTER(Bus)(&enmBus);                                         H();
    608644        LONG lDev;
    609         hrc = hda->COMGETTER(DeviceNumber)(&lDev);                                  H();
    610 
    611         switch (enmCtl)
    612         {
    613             case DiskControllerType_IDE0:
    614                 i = 0;
    615                 break;
    616             case DiskControllerType_IDE1:
    617                 i = 2;
     645        hrc = hda->COMGETTER(Device)(&lDev);                                        H();
     646        LONG lChannel;
     647        hrc = hda->COMGETTER(Channel)(&lChannel);                                   H();
     648
     649        int iLUN;
     650        switch (enmBus)
     651        {
     652            case StorageBus_IDE:
     653            {
     654                if (lChannel >= 2 || lChannel < 0)
     655                {
     656                    AssertMsgFailed(("invalid controller channel number: %d\n", lChannel));
     657                    return VERR_GENERAL_FAILURE;
     658                }
     659
     660                if (lDev >= 2 || lDev < 0)
     661                {
     662                    AssertMsgFailed(("invalid controller device number: %d\n", lDev));
     663                    return VERR_GENERAL_FAILURE;
     664                }
     665                iLUN = 2*lChannel + lDev;
     666                pHardDiskCtl = pIdeInst;
     667            }
     668            break;
     669            case StorageBus_SATA:
     670                iLUN = lChannel;
     671                pHardDiskCtl = enabled ? pSataInst : NULL;
    618672                break;
    619673            default:
    620                 AssertMsgFailed(("invalid disk controller type: %d\n", enmCtl));
     674                AssertMsgFailed(("invalid disk controller type: %d\n", enmBus));
    621675                return VERR_GENERAL_FAILURE;
    622676        }
    623677
    624         if (lDev < 0 || lDev >= 2)
    625         {
    626             AssertMsgFailed(("invalid controller device number: %d\n", lDev));
    627             return VERR_GENERAL_FAILURE;
    628         }
    629 
    630         i = i + lDev;
    631 
    632         char szLUN[16];
    633         RTStrPrintf(szLUN, sizeof(szLUN), "LUN#%d", i);
    634         rc = CFGMR3InsertNode(pInst,    szLUN, &pLunL0);                            RC_CHECK();
    635         rc = CFGMR3InsertString(pLunL0, "Driver",               "Block");           RC_CHECK();
    636         rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
    637         rc = CFGMR3InsertString(pCfg,   "Type",                 "HardDisk");        RC_CHECK();
    638         rc = CFGMR3InsertInteger(pCfg,  "Mountable",            0);                 RC_CHECK();
    639 
    640         HardDiskStorageType_T hddType;
    641         hardDisk->COMGETTER(StorageType)(&hddType);
    642         if (hddType == HardDiskStorageType_VirtualDiskImage)
    643         {
    644             ComPtr<IVirtualDiskImage> vdiDisk = hardDisk;
    645             AssertBreak (!vdiDisk.isNull(), hrc = E_FAIL);
    646 
    647             rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
    648             rc = CFGMR3InsertString(pLunL1, "Driver",         "VBoxHDD");               RC_CHECK();
    649             rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
    650             hrc = vdiDisk->COMGETTER(FilePath)(&str);                                   H();
    651             STR_CONV();
    652             rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
    653             STR_FREE();
    654 
    655             /* Create an inversed tree of parents. */
    656             ComPtr<IHardDisk> parentHardDisk = hardDisk;
    657             for (PCFGMNODE pParent = pCfg;;)
    658             {
    659                 ComPtr<IHardDisk> curHardDisk;
    660                 hrc = parentHardDisk->COMGETTER(Parent)(curHardDisk.asOutParam());      H();
    661                 if (!curHardDisk)
    662                     break;
    663 
    664                 vdiDisk = curHardDisk;
     678        /* Can be NULL if SATA controller is not enabled and current hard disk is attached to SATA controller. */
     679        if (pHardDiskCtl)
     680        {
     681            char szLUN[16];
     682            RTStrPrintf(szLUN, sizeof(szLUN), "LUN#%d", iLUN);
     683            rc = CFGMR3InsertNode(pHardDiskCtl,    szLUN, &pLunL0);                     RC_CHECK();
     684            rc = CFGMR3InsertString(pLunL0, "Driver",               "Block");           RC_CHECK();
     685            rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
     686            rc = CFGMR3InsertString(pCfg,   "Type",                 "HardDisk");        RC_CHECK();
     687            rc = CFGMR3InsertInteger(pCfg,  "Mountable",            0);                 RC_CHECK();
     688
     689            HardDiskStorageType_T hddType;
     690            hardDisk->COMGETTER(StorageType)(&hddType);
     691            if (hddType == HardDiskStorageType_VirtualDiskImage)
     692            {
     693                ComPtr<IVirtualDiskImage> vdiDisk = hardDisk;
    665694                AssertBreak (!vdiDisk.isNull(), hrc = E_FAIL);
    666695
    667                 PCFGMNODE pCur;
    668                 rc = CFGMR3InsertNode(pParent, "Parent", &pCur);                        RC_CHECK();
    669                 hrc = vdiDisk->COMGETTER(FilePath)(&str);                               H();
     696                rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
     697                rc = CFGMR3InsertString(pLunL1, "Driver",         "VBoxHDD");               RC_CHECK();
     698                rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
     699                hrc = vdiDisk->COMGETTER(FilePath)(&str);                                   H();
    670700                STR_CONV();
    671                 rc = CFGMR3InsertString(pCur,  "Path", psz);                            RC_CHECK();
     701                rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
    672702                STR_FREE();
    673                 rc = CFGMR3InsertInteger(pCur, "ReadOnly", 1);                          RC_CHECK();
    674 
    675                 /* next */
    676                 pParent = pCur;
    677                 parentHardDisk = curHardDisk;
    678             }
    679         }
    680         else if (hddType == HardDiskStorageType_ISCSIHardDisk)
    681         {
    682             ComPtr<IISCSIHardDisk> iSCSIDisk = hardDisk;
    683             AssertBreak (!iSCSIDisk.isNull(), hrc = E_FAIL);
    684 
    685             rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
    686             rc = CFGMR3InsertString(pLunL1, "Driver",         "iSCSI");                 RC_CHECK();
    687             rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
    688 
    689             /* Set up the iSCSI initiator driver configuration. */
    690             hrc = iSCSIDisk->COMGETTER(Target)(&str);                                   H();
    691             STR_CONV();
    692             rc = CFGMR3InsertString(pCfg,   "TargetName",   psz);                       RC_CHECK();
    693             STR_FREE();
    694 
    695             // @todo currently there is no Initiator name config.
    696             rc = CFGMR3InsertString(pCfg,   "InitiatorName", "iqn.2006-02.de.innotek.initiator"); RC_CHECK();
    697 
    698             ULONG64 lun;
    699             hrc = iSCSIDisk->COMGETTER(Lun)(&lun);                                      H();
    700             rc = CFGMR3InsertInteger(pCfg,   "LUN",         lun);                       RC_CHECK();
    701 
    702             hrc = iSCSIDisk->COMGETTER(Server)(&str);                                   H();
    703             STR_CONV();
    704             USHORT port;
    705             hrc = iSCSIDisk->COMGETTER(Port)(&port);                                    H();
    706             if (port != 0)
    707             {
    708                 char *pszTN;
    709                 RTStrAPrintf(&pszTN, "%s:%u", psz, port);
    710                 rc = CFGMR3InsertString(pCfg,   "TargetAddress",    pszTN);             RC_CHECK();
    711                 RTStrFree(pszTN);
     703
     704                /* Create an inversed tree of parents. */
     705                ComPtr<IHardDisk> parentHardDisk = hardDisk;
     706                for (PCFGMNODE pParent = pCfg;;)
     707                {
     708                    ComPtr<IHardDisk> curHardDisk;
     709                    hrc = parentHardDisk->COMGETTER(Parent)(curHardDisk.asOutParam());      H();
     710                    if (!curHardDisk)
     711                        break;
     712
     713                    vdiDisk = curHardDisk;
     714                    AssertBreak (!vdiDisk.isNull(), hrc = E_FAIL);
     715
     716                    PCFGMNODE pCur;
     717                    rc = CFGMR3InsertNode(pParent, "Parent", &pCur);                        RC_CHECK();
     718                    hrc = vdiDisk->COMGETTER(FilePath)(&str);                               H();
     719                    STR_CONV();
     720                    rc = CFGMR3InsertString(pCur,  "Path", psz);                            RC_CHECK();
     721                    STR_FREE();
     722                    rc = CFGMR3InsertInteger(pCur, "ReadOnly", 1);                          RC_CHECK();
     723
     724                    /* next */
     725                    pParent = pCur;
     726                    parentHardDisk = curHardDisk;
     727                }
     728            }
     729            else if (hddType == HardDiskStorageType_ISCSIHardDisk)
     730            {
     731                ComPtr<IISCSIHardDisk> iSCSIDisk = hardDisk;
     732                AssertBreak (!iSCSIDisk.isNull(), hrc = E_FAIL);
     733
     734                rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
     735                rc = CFGMR3InsertString(pLunL1, "Driver",         "iSCSI");                 RC_CHECK();
     736                rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
     737
     738                /* Set up the iSCSI initiator driver configuration. */
     739                hrc = iSCSIDisk->COMGETTER(Target)(&str);                                   H();
     740                STR_CONV();
     741                rc = CFGMR3InsertString(pCfg,   "TargetName",   psz);                       RC_CHECK();
     742                STR_FREE();
     743
     744                // @todo currently there is no Initiator name config.
     745                rc = CFGMR3InsertString(pCfg,   "InitiatorName", "iqn.2006-02.de.innotek.initiator"); RC_CHECK();
     746
     747                ULONG64 lun;
     748                hrc = iSCSIDisk->COMGETTER(Lun)(&lun);                                      H();
     749                rc = CFGMR3InsertInteger(pCfg,   "LUN",         lun);                       RC_CHECK();
     750
     751                hrc = iSCSIDisk->COMGETTER(Server)(&str);                                   H();
     752                STR_CONV();
     753                USHORT port;
     754                hrc = iSCSIDisk->COMGETTER(Port)(&port);                                    H();
     755                if (port != 0)
     756                {
     757                    char *pszTN;
     758                    RTStrAPrintf(&pszTN, "%s:%u", psz, port);
     759                    rc = CFGMR3InsertString(pCfg,   "TargetAddress",    pszTN);             RC_CHECK();
     760                    RTStrFree(pszTN);
     761                }
     762                else
     763                {
     764                    rc = CFGMR3InsertString(pCfg,   "TargetAddress",    psz);               RC_CHECK();
     765                }
     766                STR_FREE();
     767
     768                hrc = iSCSIDisk->COMGETTER(UserName)(&str);                                 H();
     769                if (str)
     770                {
     771                    STR_CONV();
     772                    rc = CFGMR3InsertString(pCfg,   "InitiatorUsername",    psz);           RC_CHECK();
     773                    STR_FREE();
     774                }
     775
     776                hrc = iSCSIDisk->COMGETTER(Password)(&str);                                 H();
     777                if (str)
     778                {
     779                    STR_CONV();
     780                    rc = CFGMR3InsertString(pCfg,   "InitiatorSecret",      psz);           RC_CHECK();
     781                    STR_FREE();
     782                }
     783
     784                // @todo currently there is no target username config.
     785                //rc = CFGMR3InsertString(pCfg,   "TargetUsername",   "");                    RC_CHECK();
     786
     787                // @todo currently there is no target password config.
     788                //rc = CFGMR3InsertString(pCfg,   "TargetSecret",     "");                    RC_CHECK();
     789
     790                /* The iSCSI initiator needs an attached iSCSI transport driver. */
     791                rc = CFGMR3InsertNode(pLunL1,   "AttachedDriver", &pLunL2);                 RC_CHECK();
     792                rc = CFGMR3InsertString(pLunL2, "Driver",           "iSCSITCP");            RC_CHECK();
     793                /* Currently the transport driver has no config options. */
     794            }
     795            else if (hddType == HardDiskStorageType_VMDKImage)
     796            {
     797                ComPtr<IVMDKImage> vmdkDisk = hardDisk;
     798                AssertBreak (!vmdkDisk.isNull(), hrc = E_FAIL);
     799
     800                rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
     801#if 1 /* Enable new VD container code (and new VMDK), as the bugs are fixed. */
     802                rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");               RC_CHECK();
     803#else
     804                rc = CFGMR3InsertString(pLunL1, "Driver",         "VmdkHDD");               RC_CHECK();
     805#endif
     806                rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
     807                hrc = vmdkDisk->COMGETTER(FilePath)(&str);                                  H();
     808                STR_CONV();
     809                rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
     810                STR_FREE();
     811                rc = CFGMR3InsertString(pCfg,   "Format",           "VMDK");                RC_CHECK();
     812            }
     813            else if (hddType == HardDiskStorageType_CustomHardDisk)
     814            {
     815                ComPtr<ICustomHardDisk> customHardDisk = hardDisk;
     816                AssertBreak (!customHardDisk.isNull(), hrc = E_FAIL);
     817
     818                rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
     819                rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");                    RC_CHECK();
     820                rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
     821                hrc = customHardDisk->COMGETTER(Location)(&str);                            H();
     822                STR_CONV();
     823                rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
     824                STR_FREE();
     825                hrc = customHardDisk->COMGETTER(Format)(&str);                              H();
     826                STR_CONV();
     827                rc = CFGMR3InsertString(pCfg,   "Format",           psz);                   RC_CHECK();
     828                STR_FREE();
     829            }
     830            else if (hddType == HardDiskStorageType_VHDImage)
     831            {
     832                ComPtr<IVHDImage> vhdDisk = hardDisk;
     833                AssertBreak (!vhdDisk.isNull(), hrc = E_FAIL);
     834
     835                rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
     836                rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");                    RC_CHECK();
     837                rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
     838                hrc = vhdDisk->COMGETTER(FilePath)(&str);                                   H();
     839                STR_CONV();
     840                rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
     841                rc = CFGMR3InsertString(pCfg,   "Format",           "VHD");                 RC_CHECK();
     842                STR_FREE();
    712843            }
    713844            else
    714             {
    715                 rc = CFGMR3InsertString(pCfg,   "TargetAddress",    psz);               RC_CHECK();
    716             }
    717             STR_FREE();
    718 
    719             hrc = iSCSIDisk->COMGETTER(UserName)(&str);                                 H();
    720             if (str)
    721             {
    722                 STR_CONV();
    723                 rc = CFGMR3InsertString(pCfg,   "InitiatorUsername",    psz);           RC_CHECK();
    724                 STR_FREE();
    725             }
    726 
    727             hrc = iSCSIDisk->COMGETTER(Password)(&str);                                 H();
    728             if (str)
    729             {
    730                 STR_CONV();
    731                 rc = CFGMR3InsertString(pCfg,   "InitiatorSecret",      psz);           RC_CHECK();
    732                 STR_FREE();
    733             }
    734 
    735             // @todo currently there is no target username config.
    736             //rc = CFGMR3InsertString(pCfg,   "TargetUsername",   "");                    RC_CHECK();
    737 
    738             // @todo currently there is no target password config.
    739             //rc = CFGMR3InsertString(pCfg,   "TargetSecret",     "");                    RC_CHECK();
    740 
    741             /* The iSCSI initiator needs an attached iSCSI transport driver. */
    742             rc = CFGMR3InsertNode(pLunL1,   "AttachedDriver", &pLunL2);                 RC_CHECK();
    743             rc = CFGMR3InsertString(pLunL2, "Driver",           "iSCSITCP");            RC_CHECK();
    744             /* Currently the transport driver has no config options. */
    745         }
    746         else if (hddType == HardDiskStorageType_VMDKImage)
    747         {
    748             ComPtr<IVMDKImage> vmdkDisk = hardDisk;
    749             AssertBreak (!vmdkDisk.isNull(), hrc = E_FAIL);
    750 
    751             rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
    752 #if 1 /* Enable new VD container code (and new VMDK), as the bugs are fixed. */
    753             rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");               RC_CHECK();
    754 #else
    755             rc = CFGMR3InsertString(pLunL1, "Driver",         "VmdkHDD");               RC_CHECK();
    756 #endif
    757             rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
    758             hrc = vmdkDisk->COMGETTER(FilePath)(&str);                                  H();
    759             STR_CONV();
    760             rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
    761             STR_FREE();
    762             rc = CFGMR3InsertString(pCfg,   "Format",           "VMDK");                RC_CHECK();
    763         }
    764         else if (hddType == HardDiskStorageType_CustomHardDisk)
    765         {
    766             ComPtr<ICustomHardDisk> customHardDisk = hardDisk;
    767             AssertBreak (!customHardDisk.isNull(), hrc = E_FAIL);
    768 
    769             rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
    770             rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");                    RC_CHECK();
    771             rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
    772             hrc = customHardDisk->COMGETTER(Location)(&str);                            H();
    773             STR_CONV();
    774             rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
    775             STR_FREE();
    776             hrc = customHardDisk->COMGETTER(Format)(&str);                              H();
    777             STR_CONV();
    778             rc = CFGMR3InsertString(pCfg,   "Format",           psz);                   RC_CHECK();
    779             STR_FREE();
    780         }
    781         else if (hddType == HardDiskStorageType_VHDImage)
    782         {
    783             ComPtr<IVHDImage> vhdDisk = hardDisk;
    784             AssertBreak (!vhdDisk.isNull(), hrc = E_FAIL);
    785 
    786             rc = CFGMR3InsertNode(pLunL0,   "AttachedDriver", &pLunL1);                 RC_CHECK();
    787             rc = CFGMR3InsertString(pLunL1, "Driver",         "VD");                    RC_CHECK();
    788             rc = CFGMR3InsertNode(pLunL1,   "Config", &pCfg);                           RC_CHECK();
    789             hrc = vhdDisk->COMGETTER(FilePath)(&str);                                   H();
    790             STR_CONV();
    791             rc = CFGMR3InsertString(pCfg,   "Path",             psz);                   RC_CHECK();
    792             rc = CFGMR3InsertString(pCfg,   "Format",           "VHD");                 RC_CHECK();
    793             STR_FREE();
    794         }
    795         else
    796            AssertFailed();
     845               AssertFailed();
     846        }
    797847    }
    798848    H();
     
    803853    {
    804854        // ASSUME: DVD drive is always attached to LUN#2 (i.e. secondary IDE master)
    805         rc = CFGMR3InsertNode(pInst,    "LUN#2", &pLunL0);                          RC_CHECK();
     855        rc = CFGMR3InsertNode(pIdeInst,    "LUN#2", &pLunL0);                       RC_CHECK();
    806856        ComPtr<IHostDVDDrive> hostDvdDrive;
    807857        hrc = dvdDrive->GetHostDrive(hostDvdDrive.asOutParam());                    H();
     
    12881338    ComPtr<IAudioAdapter> audioAdapter;
    12891339    hrc = pMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam());             H();
    1290     BOOL enabled = FALSE;
    12911340    if (audioAdapter)
    12921341        hrc = audioAdapter->COMGETTER(Enabled)(&enabled);                           H();
  • trunk/src/VBox/Main/HardDiskAttachmentImpl.cpp

    r7207 r7442  
    2828HRESULT HardDiskAttachment::FinalConstruct()
    2929{
    30     mController = DiskControllerType_Null;
    31     mDeviceNumber = 0;
     30    mBus = StorageBus_Null;
     31    mChannel = 0;
     32    mDevice = 0;
    3233
    3334    return S_OK;
     
    4647 *
    4748 *  @param aHD      hard disk object
    48  *  @param aCtl     controller type
    49  *  @param aDev     device number on the controller
     49 *  @param aBus     bus type
     50 *  @param aChannel channel number
     51 *  @param aDevice  device number on the channel
    5052 *  @param aDirty   whether the attachment is initially dirty or not
    5153 */
    52 HRESULT HardDiskAttachment::init (HardDisk *aHD, DiskControllerType_T aCtl, LONG aDev,
     54HRESULT HardDiskAttachment::init (HardDisk *aHD, StorageBus_T aBus, LONG aChannel, LONG aDevice,
    5355                                  BOOL aDirty)
    5456{
    5557    ComAssertRet (aHD, E_INVALIDARG);
     58
     59    if (aBus == StorageBus_IDE)
     60    {
     61        if (aChannel < 0 || aChannel > 1)
     62            return setError (E_FAIL,
     63                tr ("Invalid IDE channel for hard disk '%ls': %d. "
     64                    "IDE channel number must be in range [0,1]"),
     65                aHD->toString().raw(), aChannel);
     66        if (aDevice < 0 || aDevice > 1 || (aChannel == 1 && aDevice == 0))
     67            return setError (E_FAIL,
     68                tr ("Invalid IDE device slot for hard disk '%ls': %d. "
     69                    "IDE device slot number must be in range [0,1] for "
     70                    "channel 0 and always 1 for channel 1"),
     71                aHD->toString().raw(), aDevice);
     72    }
    5673
    5774    AutoLock alock (this);
     
    6077
    6178    mHardDisk = aHD;
    62     mController = aCtl;
    63     mDeviceNumber = aDev;
     79    mBus = aBus;
     80    mChannel = aChannel;
     81    mDevice = aDevice;
    6482
    6583    setReady (true);
     
    84102}
    85103
    86 STDMETHODIMP HardDiskAttachment::COMGETTER(Controller) (DiskControllerType_T *aController)
     104STDMETHODIMP HardDiskAttachment::COMGETTER(Bus) (StorageBus_T *aBus)
    87105{
    88     if (!aController)
     106    if (!aBus)
    89107        return E_POINTER;
    90108
     
    92110    CHECK_READY();
    93111
    94     *aController = mController;
     112    *aBus = mBus;
    95113    return S_OK;
    96114}
    97115
    98 STDMETHODIMP HardDiskAttachment::COMGETTER(DeviceNumber) (LONG *aDeviceNumber)
     116STDMETHODIMP HardDiskAttachment::COMGETTER(Channel) (LONG *aChannel)
    99117{
    100     if (!aDeviceNumber)
     118    if (!aChannel)
    101119        return E_INVALIDARG;
    102120
     
    104122    CHECK_READY();
    105123
    106     *aDeviceNumber = mDeviceNumber;
     124    *aChannel = mChannel;
    107125    return S_OK;
    108126}
    109127
     128STDMETHODIMP HardDiskAttachment::COMGETTER(Device) (LONG *aDevice)
     129{
     130    if (!aDevice)
     131        return E_INVALIDARG;
     132
     133    AutoLock alock (this);
     134    CHECK_READY();
     135
     136    *aDevice = mDevice;
     137    return S_OK;
     138}
     139
  • trunk/src/VBox/Main/MachineImpl.cpp

    r7349 r7442  
    4040#include "VirtualBoxErrorInfoImpl.h"
    4141#include "GuestImpl.h"
     42#include "SATAControllerImpl.h"
    4243
    4344#include "USBProxyService.h"
     
    278279        while (thatIt != thatAtts.end())
    279280        {
    280             if ((*it)->deviceNumber() == (*thatIt)->deviceNumber() &&
    281                 (*it)->controller() == (*thatIt)->controller() &&
     281            if ((*it)->bus() == (*thatIt)->bus() &&
     282                (*it)->channel() == (*thatIt)->channel() &&
     283                (*it)->device() == (*thatIt)->device() &&
    282284                (*it)->hardDisk().equalsTo ((*thatIt)->hardDisk()))
    283285            {
     
    12851287}
    12861288
     1289STDMETHODIMP Machine::COMGETTER(SATAController) (ISATAController **aSATAController)
     1290{
     1291#ifdef VBOX_WITH_AHCI
     1292    if (!aSATAController)
     1293        return E_POINTER;
     1294
     1295    AutoCaller autoCaller (this);
     1296    CheckComRCReturnRC (autoCaller.rc());
     1297
     1298    AutoReaderLock alock (this);
     1299
     1300    return mSATAController.queryInterfaceTo (aSATAController);
     1301#else
     1302    /* Note: The GUI depends on this method returning E_NOTIMPL with no
     1303     * extended error info to indicate that SATA is simply not available
     1304     * (w/o treting it as a failure), for example, as in OSE */
     1305    return E_NOTIMPL;
     1306#endif
     1307}
     1308
    12871309STDMETHODIMP Machine::COMGETTER(SettingsFilePath) (BSTR *aFilePath)
    12881310{
     
    16021624
    16031625STDMETHODIMP Machine::AttachHardDisk (INPTR GUIDPARAM aId,
    1604                                       DiskControllerType_T aCtl, LONG aDev)
     1626                                      StorageBus_T aBus, LONG aChannel, LONG aDevice)
    16051627{
    16061628    Guid id = aId;
    16071629
    1608     if (id.isEmpty() ||
    1609         aCtl == DiskControllerType_Null ||
    1610         aDev < 0 || aDev > 1)
     1630    if (id.isEmpty() || aBus == StorageBus_Null)
    16111631        return E_INVALIDARG;
    1612 
     1632 
    16131633    AutoCaller autoCaller (this);
    16141634    CheckComRCReturnRC (autoCaller.rc());
     
    16351655    {
    16361656        ComObjPtr <HardDiskAttachment> hda = *it;
    1637         if (hda->controller() == aCtl && hda->deviceNumber() == aDev)
     1657        if (hda->bus() == aBus && hda->channel() == aChannel && hda->device() == aDevice)
    16381658        {
    16391659            ComObjPtr <HardDisk> hd = hda->hardDisk();
    16401660            AutoLock hdLock (hd);
    16411661            return setError (E_FAIL,
    1642                 tr ("Hard disk '%ls' is already attached to device slot %d "
    1643                     "on controller %d"),
    1644                 hd->toString().raw(), aDev, aCtl);
     1662                tr ("Hard disk '%ls' is already attached to device slot %d on "
     1663                    "channel %d of bus %d"),
     1664                hd->toString().raw(), aDevice, aChannel, aBus);
    16451665        }
    16461666    }
     
    16491669    ComObjPtr <HardDisk> hd;
    16501670    rc = mParent->getHardDisk (id, hd);
     1671    CheckComRCReturnRC (rc);
     1672
     1673    /* create an attachment object early to let it check argiuments */
     1674    ComObjPtr <HardDiskAttachment> attachment;
     1675    attachment.createObject();
     1676    rc = attachment->init (hd, aBus, aChannel, aDevice, false /* aDirty */);
    16511677    CheckComRCReturnRC (rc);
    16521678
     
    17121738                                return setError (E_FAIL,
    17131739                                    tr ("Normal/Writethrough hard disk '%ls' is "
    1714                                         "currently attached to device slot %d "
    1715                                         "on controller %d of this machine"),
     1740                                        "currently attached to device slot %d on channel %d "
     1741                                        "of bus %d of this machine"),
    17161742                                    hd->toString().raw(),
    1717                                     (*it)->deviceNumber(), (*it)->controller());
     1743                                    (*it)->device(),
     1744                                    (*it)->channel(), (*it)->bus());
    17181745                            }
    17191746                        }
     
    17571784    }
    17581785
    1759     ComObjPtr <HardDiskAttachment> attachment;
    1760     attachment.createObject();
    1761     attachment->init (hd, aCtl, aDev, dirty);
     1786    attachment->setDirty (dirty);
    17621787
    17631788    mHDData.backup();
     
    17701795}
    17711796
    1772 STDMETHODIMP Machine::GetHardDisk (DiskControllerType_T aCtl,
    1773                                    LONG aDev, IHardDisk **aHardDisk)
    1774 {
    1775     if (aCtl == DiskControllerType_Null ||
    1776         aDev < 0 || aDev > 1)
     1797STDMETHODIMP Machine::GetHardDisk (StorageBus_T aBus, LONG aChannel,
     1798                                   LONG aDevice, IHardDisk **aHardDisk)
     1799{
     1800    if (aBus == StorageBus_Null)
    17771801        return E_INVALIDARG;
    1778 
     1802 
    17791803    AutoCaller autoCaller (this);
    17801804    CheckComRCReturnRC (autoCaller.rc());
     
    17881812    {
    17891813        ComObjPtr <HardDiskAttachment> hda = *it;
    1790         if (hda->controller() == aCtl && hda->deviceNumber() == aDev)
     1814        if (hda->bus() == aBus && hda->channel() == aChannel && hda->device() == aDevice)
    17911815        {
    17921816            hda->hardDisk().queryInterfaceTo (aHardDisk);
     
    17961820
    17971821    return setError (E_INVALIDARG,
    1798         tr ("No hard disk attached to device slot %d on controller %d"),
    1799             aDev, aCtl);
    1800 }
    1801 
    1802 STDMETHODIMP Machine::DetachHardDisk (DiskControllerType_T aCtl, LONG aDev)
    1803 {
    1804     if (aCtl == DiskControllerType_Null ||
    1805         aDev < 0 || aDev > 1)
     1822        tr ("No hard disk attached to device slot %d on channel %d of bus %d"),
     1823            aDevice, aChannel, aBus);
     1824}
     1825
     1826STDMETHODIMP Machine::DetachHardDisk (StorageBus_T aBus, LONG aChannel, LONG aDevice)
     1827{
     1828    if (aBus == StorageBus_Null)
    18061829        return E_INVALIDARG;
    18071830
     
    18241847    {
    18251848        ComObjPtr <HardDiskAttachment> hda = *it;
    1826         if (hda->controller() == aCtl && hda->deviceNumber() == aDev)
     1849        if (hda->bus() == aBus && hda->channel() == aChannel && hda->device() == aDevice)
    18271850        {
    18281851            ComObjPtr <HardDisk> hd = hda->hardDisk();
     
    18891912
    18901913    return setError (E_INVALIDARG,
    1891         tr ("No hard disk attached to device slot %d on controller %d"),
    1892         aDev, aCtl);
     1914        tr ("No hard disk attached to device slot %d on channel %d of bus %d"),
     1915        aDevice, aChannel, aBus);
    18931916}
    18941917
     
    36383661    mUSBController->init (this);
    36393662
     3663    /* create the SATA controller object (always present, default is disabled) */
     3664    unconst (mSATAController).createObject();
     3665    mSATAController->init (this);
     3666
    36403667    /* create associated network adapter objects */
    36413668    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     
    36833710        mUSBController->uninit();
    36843711        unconst (mUSBController).setNull();
     3712    }
     3713
     3714    if (mSATAController)
     3715    {
     3716        mSATAController->uninit();
     3717        unconst (mSATAController).setNull();
    36853718    }
    36863719
     
    42824315    CheckComRCReturnRC (rc);
    42834316
     4317    /* SATA Controller */
     4318    rc = mSATAController->loadSettings (aNode);
     4319    CheckComRCReturnRC (rc);
     4320
    42844321    /* Network node (required) */
    42854322    {
     
    44604497        Guid uuid = (*it).value <Guid> ("hardDisk");
    44614498        /* bus (controller) type (required) */
    4462         const char *bus = (*it).stringValue ("bus");
     4499        const char *busStr = (*it).stringValue ("bus");
     4500        /* channel (required) */
     4501        LONG channel = (*it).value <LONG> ("channel");
    44634502        /* device (required) */
    4464         const char *device = (*it).stringValue ("device");
     4503        LONG device = (*it).value <LONG> ("device");
    44654504
    44664505        /* find a hard disk by UUID */
     
    44914530
    44924531        /* attach the device */
    4493         DiskControllerType_T ctl = DiskControllerType_Null;
    4494         LONG dev = -1;
    4495 
    4496         if (strcmp (bus, "ide0") == 0)
    4497         {
    4498             ctl = DiskControllerType_IDE0;
    4499             if (strcmp (device, "master") == 0)
    4500                 dev = 0;
    4501             else if (strcmp (device, "slave") == 0)
    4502                 dev = 1;
    4503             else
    4504                 ComAssertMsgFailedRet (("Invalid device '%s'\n", device),
    4505                                        E_FAIL);
    4506         }
    4507         else if (strcmp (bus, "ide1") == 0)
    4508         {
    4509             ctl = DiskControllerType_IDE1;
    4510             if (strcmp (device, "master") == 0)
    4511                 rc = setError (E_FAIL, tr("Could not attach a disk as a master "
    4512                                           "device on the secondary controller"));
    4513             else if (strcmp (device, "slave") == 0)
    4514                 dev = 1;
    4515             else
    4516                 ComAssertMsgFailedRet (("Invalid device '%s'\n", device),
    4517                                        E_FAIL);
     4532        StorageBus_T bus = StorageBus_Null;
     4533
     4534        if (strcmp (busStr, "IDE") == 0)
     4535        {
     4536            bus = StorageBus_IDE;
     4537        }
     4538        else if (strcmp (busStr, "SATA") == 0)
     4539        {
     4540            bus = StorageBus_SATA;
    45184541        }
    45194542        else
     
    45234546        ComObjPtr <HardDiskAttachment> attachment;
    45244547        attachment.createObject();
    4525         rc = attachment->init (hd, ctl, dev, false /* aDirty */);
     4548        rc = attachment->init (hd, bus, channel, device, false /* aDirty */);
    45264549        CheckComRCBreakRC (rc);
    45274550
     
    45364559    }
    45374560
    4538     return S_OK;
     4561    return rc;
    45394562}
    45404563
     
    56595682    CheckComRCReturnRC (rc);
    56605683
     5684    /* SATA Controller (required) */
     5685    rc = mSATAController->saveSettings (aNode);
     5686    CheckComRCReturnRC (rc);
     5687
    56615688    /* Network adapters (required) */
    56625689    {
     
    57935820        {
    57945821            const char *bus = NULL;
    5795             switch (att->controller())
     5822            switch (att->bus())
    57965823            {
    5797                 case DiskControllerType_IDE0: bus = "ide0"; break;
    5798                 case DiskControllerType_IDE1: bus = "ide1"; break;
     5824                case StorageBus_IDE:  bus = "IDE"; break;
     5825                case StorageBus_SATA: bus = "SATA"; break;
    57995826                default:
    58005827                    ComAssertFailedRet (E_FAIL);
    58015828            }
    58025829
    5803             const char *dev = NULL;
    5804             switch (att->deviceNumber())
    5805             {
    5806                 case 0: dev = "master"; break;
    5807                 case 1: dev = "slave"; break;
    5808                 default:
    5809                     ComAssertFailedRet (E_FAIL);
    5810             }
    5811 
    58125830            hdNode.setValue <Guid> ("hardDisk", att->hardDisk()->id());
    58135831            hdNode.setStringValue ("bus", bus);
    5814             hdNode.setStringValue ("device", dev);
     5832            hdNode.setValue <LONG> ("channel", att->channel());
     5833            hdNode.setValue <LONG> ("device", att->device());
    58155834        }
    58165835    }
     
    60736092                         *  be used
    60746093                         */
    6075                         if ((*it)->deviceNumber() == hda->deviceNumber() &&
    6076                             (*it)->controller() == hda->controller())
     6094                        if ((*it)->device() == hda->device() &&
     6095                            (*it)->channel() == hda->channel() &&
     6096                            (*it)->bus() == hda->bus())
    60776097                        {
    60786098                            foundIt = it;
     
    60956115                                 ++ it2)
    60966116                            {
    6097                                 if ((*it2)->deviceNumber() == (*it)->deviceNumber() &&
    6098                                     (*it2)->controller() == (*it)->controller() &&
     6117                                if ((*it2)->device() == (*it)->device() &&
     6118                                    (*it2)->channel() == (*it)->channel() &&
     6119                                    (*it2)->bus() == (*it)->bus() &&
    60996120                                    (*it2)->hardDisk()->root().equalsTo (hd))
    61006121                                {
     
    61656186                                 *  be used
    61666187                                 */
    6167                                 if ((*it)->deviceNumber() == hda->deviceNumber() &&
    6168                                     (*it)->controller() == hda->controller())
     6188                                if ((*it)->device() == hda->device() &&
     6189                                    (*it)->channel() == hda->channel() &&
     6190                                    (*it)->bus() == hda->bus())
    61696191                                {
    61706192                                    foundIt = it;
     
    64826504            ComObjPtr <HardDiskAttachment> newHda;
    64836505            newHda.createObject();
    6484             rc = newHda->init (newHd, hda->controller(), hda->deviceNumber(),
     6506            rc = newHda->init (newHd, hda->bus(), hda->channel(), hda->device(),
    64856507                               false /* aDirty */);
    64866508
     
    67046726        (mAudioAdapter && mAudioAdapter->isModified()) ||
    67056727        (mUSBController && mUSBController->isModified()) ||
     6728        (mSATAController && mSATAController->isModified()) ||
    67066729        (mBIOSSettings && mBIOSSettings->isModified());
    67076730}
     
    67466769        (mAudioAdapter && mAudioAdapter->isReallyModified()) ||
    67476770        (mUSBController && mUSBController->isReallyModified()) ||
     6771        (mSATAController && mSATAController->isReallyModified()) ||
    67486772        (mBIOSSettings && mBIOSSettings->isReallyModified());
    67496773}
     
    68056829
    68066830    bool vrdpChanged = false, dvdChanged = false, floppyChanged = false,
    6807          usbChanged = false;
     6831         usbChanged = false, sataChanged = false;
    68086832
    68096833    ComPtr <INetworkAdapter> networkAdapters [ELEMENTS (mNetworkAdapters)];
     
    68306854    if (mUSBController)
    68316855        usbChanged = mUSBController->rollback();
     6856
     6857    if (mSATAController)
     6858        sataChanged = mSATAController->rollback();
    68326859
    68336860    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     
    68646891        if (usbChanged)
    68656892            that->onUSBControllerChange();
     6893        if (sataChanged)
     6894            that->onSATAControllerChange();
    68666895
    68676896        for (ULONG slot = 0; slot < ELEMENTS (networkAdapters); slot ++)
     
    69176946    mAudioAdapter->commit();
    69186947    mUSBController->commit();
     6948    mSATAController->commit();
    69196949
    69206950    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     
    69827012    mAudioAdapter->copyFrom (aThat->mAudioAdapter);
    69837013    mUSBController->copyFrom (aThat->mUSBController);
     7014    mSATAController->copyFrom (aThat->mSATAController);
    69847015
    69857016    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     
    71847215    unconst (mUSBController).createObject();
    71857216    mUSBController->init (this, aMachine->mUSBController);
     7217    /* create another SATA controller object that will be mutable */
     7218    unconst (mSATAController).createObject();
     7219    mSATAController->init (this, aMachine->mSATAController);
    71867220    /* create a list of network adapters that will be mutable */
    71877221    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
     
    97839817    mUSBController->initCopy (this, mPeer->mUSBController);
    97849818
     9819    unconst (mSATAController).createObject();
     9820    mSATAController->initCopy (this, mPeer->mSATAController);
     9821
    97859822    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
    97869823    {
     
    98829919    mUSBController->init (this);
    98839920
     9921    unconst (mSATAController).createObject();
     9922    mSATAController->init (this);
     9923
    98849924    for (ULONG slot = 0; slot < ELEMENTS (mNetworkAdapters); slot ++)
    98859925    {
  • trunk/src/VBox/Main/Makefile.kmk

    r7309 r7442  
    137137ifdef VBOX_WITH_E1000
    138138VBoxSVC_DEFS += VBOX_WITH_E1000
     139endif
     140ifdef VBOX_WITH_AHCI
     141VBoxSVC_DEFS += VBOX_WITH_AHCI
    139142endif
    140143ifdef VBOX_WITHOUT_LINUX_COMPILER_H
     
    195198        ParallelPortImpl.cpp \
    196199        USBControllerImpl.cpp \
     200        SATAControllerImpl.cpp \
    197201        AudioAdapterImpl.cpp \
    198202        SharedFolderImpl.cpp \
  • trunk/src/VBox/Main/VirtualBoxImplExtra.cpp

    r7387 r7442  
    3131#include "xml_SettingsConverter_xsl.h"
    3232
     33static const unsigned char g_ab_xml_VirtualBox_settings_root_xsd[] =
     34"<xsd:schema"
     35"  xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""
     36"  xmlns=\"http://www.innotek.de/VirtualBox-settings\""
     37"  xmlns:vb=\"http://www.innotek.de/VirtualBox-settings\""
     38"  targetNamespace=\"http://www.innotek.de/VirtualBox-settings\""
     39"  elementFormDefault=\"qualified\""
     40">"
     41"<xsd:element name=\"VirtualBox\">"
     42"  <xsd:complexType>"
     43"    <xsd:complexContent>"
     44"      <xsd:extension base=\"TVirtualBox\">"
     45"        <xsd:attribute name=\"version\" type=\"xsd:token\" fixed=\"" VBOX_XML_VERSION_FULL "\" use=\"required\"/>"
     46"      </xsd:extension>"
     47"    </xsd:complexContent>"
     48"  </xsd:complexType>"
     49"</xsd:element>"
     50"</xsd:schema>";
     51
     52static const unsigned g_cb_xml_VirtualBox_settings_root_xsd =
     53    sizeof (g_ab_xml_VirtualBox_settings_root_xsd);
     54
    3355/**
    3456 * Resolves external entities while parting and validating XML settings files.
     
    4870            MemoryBuf ((const char *) g_ab_xml_VirtualBox_settings_common_xsd,
    4971                       g_cb_xml_VirtualBox_settings_common_xsd, aURI);
     72    }
     73
     74    if (strcmp (aURI, VBOX_XML_SCHEMA_ROOT) == 0)
     75    {
     76        return new settings::
     77            MemoryBuf ((const char *) g_ab_xml_VirtualBox_settings_root_xsd,
     78                       g_cb_xml_VirtualBox_settings_root_xsd, aURI);
    5079    }
    5180
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r7434 r7442  
    385385
    386386  <enum
    387     name="DiskControllerType"
    388     uuid="1115b810-2ee7-4ebd-8b39-92e98c9a2b48"
     387    name="StorageBus"
     388    uuid="715984a5-093c-43bb-aa42-a16ed16828dd"
    389389  >
    390     <desc>
    391       Disk controller type for hard disk attachments.
    392     </desc>
     390    <desc>Interface bus type for storage devices.</desc>
    393391
    394392    <const name="Null"              value="0">
    395393      <desc><tt>null</tt> value. Never used by the API.</desc>
    396394    </const>
    397     <const name="IDE0"              value="1"/>
    398     <const name="IDE1"              value="2"/>
     395
     396    <const name="IDE"      value="1"/>
     397    <const name="SATA"     value="2"/>
    399398  </enum>
    400399
     
    27722771    </attribute>
    27732772
     2773    <attribute name="SATAController" type="ISATAController" readonly="yes">
     2774      <desc>
     2775        Associated SATA controller object.
     2776      </desc>
     2777    </attribute>
     2778
    27742779    <attribute name="settingsFilePath" type="wstring" readonly="yes">
    27752780      <desc>
     
    30293034
    30303035        Attaches a virtual hard disk identified by the given UUID to the
    3031         given device slot of the given controller. The specified device
    3032         must not have another disk attached and the given hard disk must
    3033         not be already attached to this machine.
     3036        given device slot of the given channel on the given bus. The
     3037        specified device slot must not have another disk attached and the
     3038        given hard disk must not be already attached to this machine.
    30343039
    30353040        See <link to="IHardDisk"/> for detailed information about
     
    30463051
    30473052      </desc>
    3048       <param name="diskID" type="uuid" dir="in">
     3053      <param name="id" type="uuid" dir="in">
    30493054        <desc>UUID of the hard disk to attach.</desc>
    30503055      </param>
    3051       <param name="controller" type="DiskControllerType" dir="in">
     3056      <param name="bus" type="StorageBus" dir="in">
    30523057        <desc>Controller to attach the hard disk to.</desc>
     3058      </param>
     3059      <param name="channel" type="long" dir="in">
     3060        <desc>Device slot to attach the hard disk to.</desc>
    30533061      </param>
    30543062      <param name="device" type="long" dir="in">
     
    30623070        given controller under the specified device number.
    30633071      </desc>
    3064       <param name="controller" type="DiskControllerType" dir="in"/>
    3065       <param name="deviceNumber" type="long" dir="in"/>
     3072      <param name="bus" type="StorageBus" dir="in"/>
     3073      <param name="channel" type="long" dir="in"/>
     3074      <param name="device" type="long" dir="in"/>
    30663075      <param name="hardDisk" type="IHardDisk" dir="return"/>
    30673076    </method>
     
    30903099
    30913100      </desc>
    3092       <param name="controller" type="DiskControllerType" dir="in">
    3093         <desc>Controller to dettach the hard disk from.</desc>
     3101      <param name="bus" type="StorageBus" dir="in">
     3102        <desc>Bus to dettach the hard disk from.</desc>
     3103      </param>
     3104      <param name="channel" type="long" dir="in">
     3105        <desc>Channel number to dettach the hard disk from.</desc>
    30943106      </param>
    30953107      <param name="device" type="long" dir="in">
    3096         <desc>Device slot to dettach the hard disk from.</desc>
     3108        <desc>Device slot number to dettach the hard disk from.</desc>
    30973109      </param>
    30983110    </method>
     
    57115723    </attribute>
    57125724
    5713     <attribute name="controller" type="DiskControllerType" readonly="yes">
     5725    <attribute name="bus" type="StorageBus" readonly="yes">
    57145726      <desc>Disk controller ID of this attachment.</desc>
    57155727    </attribute>
    57165728
    5717     <attribute name="deviceNumber" type="long" readonly="yes">
    5718       <desc>Device number of the attachment.</desc>
     5729    <attribute name="channel" type="long" readonly="yes">
     5730      <desc>Channel number of the attachment.</desc>
     5731    </attribute>
     5732
     5733    <attribute name="device" type="long" readonly="yes">
     5734      <desc>Device slot number of the attachment.</desc>
    57195735    </attribute>
    57205736
     
    97399755  </interface>
    97409756
     9757  <!--
     9758  // ISATAController
     9759  /////////////////////////////////////////////////////////////////////////
     9760  -->
     9761
     9762  <interface
     9763    name="ISATAController" extends="$unknown"
     9764    uuid="9a4b868b-1376-4533-8ef5-065b8e8cedff"
     9765    wsmap="managed"
     9766  >
     9767    <attribute name="enabled" type="boolean">
     9768      <desc>
     9769        Flag whether the SATA controller is present in the
     9770        guest system. If disabled, the virtual guest hardware will
     9771        not contain any SATA controller. Can only be changed when
     9772        the VM is powered off.
     9773      </desc>
     9774    </attribute>
     9775
     9776    <method name="GetIDEEmulationPort">
     9777      <desc>Gets the corresponding port number which is emulated as an IDE device.</desc>
     9778      <param name="devicePosition" type="long" dir="in"/>
     9779      <param name="portNumber" type="long" dir="return"/>
     9780    </method>
     9781
     9782    <method name="SetIDEEmulationPort">
     9783      <desc>Sets the port number which is emulated as an IDE device.</desc>
     9784      <param name="devicePosition" type="long" dir="in"/>
     9785      <param name="portNumber" type="long" dir="in"/>
     9786    </method>
     9787
     9788  </interface>
     9789
    97419790<if target="wsdl">
    97429791
  • trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h

    r5999 r7442  
    4949
    5050    // public initializer/uninitializer for internal purposes only
    51     HRESULT init (HardDisk *aHD, DiskControllerType_T aCtl, LONG aDev, BOOL aDirty);
     51    HRESULT init (HardDisk *aHD, StorageBus_T aBus, LONG aChannel, LONG aDevice, BOOL aDirty);
    5252
    5353    // IHardDiskAttachment properties
    54     STDMETHOD(COMGETTER(HardDisk)) (IHardDisk **aHardDisk);
    55     STDMETHOD(COMGETTER(Controller)) (DiskControllerType_T *aController);
    56     STDMETHOD(COMGETTER(DeviceNumber)) (LONG *aDeviceNumber);
     54    STDMETHOD(COMGETTER(HardDisk))   (IHardDisk **aHardDisk);
     55    STDMETHOD(COMGETTER(Bus))        (StorageBus_T *aBus);
     56    STDMETHOD(COMGETTER(Channel))    (LONG *aChannel);
     57    STDMETHOD(COMGETTER(Device))     (LONG *aDevice);
    5758
    5859    // public methods for internal purposes only
     60    // (ensure there is a caller and a read or write lock before calling them!)
    5961
    6062    BOOL isDirty() const { return mDirty; }
     63    void setDirty (BOOL aDirty) { mDirty = aDirty; }
    6164
    6265    const ComObjPtr <HardDisk> &hardDisk() const { return mHardDisk; }
    63     DiskControllerType_T controller() const { return mController; }
    64     LONG deviceNumber() const { return mDeviceNumber; }
     66    StorageBus_T bus() const { return mBus; }
     67    LONG channel() const { return mChannel; }
     68    LONG device() const { return mDevice; }
    6569
    66     /** @note Don't forget to lock this object! */
    6770    void updateHardDisk (const ComObjPtr <HardDisk> &aHardDisk, BOOL aDirty)
    6871    {
     
    7881    BOOL mDirty;
    7982    ComObjPtr <HardDisk> mHardDisk;
    80     DiskControllerType_T mController;
    81     LONG mDeviceNumber;
     83    StorageBus_T mBus;
     84    LONG mChannel;
     85    LONG mDevice;
    8286};
    8387
  • trunk/src/VBox/Main/include/MachineImpl.h

    r7349 r7442  
    3434#include "ParallelPortImpl.h"
    3535#include "BIOSSettingsImpl.h"
     36#include "SATAControllerImpl.h"
    3637
    3738// generated header
     
    466467    STDMETHOD(COMGETTER(AudioAdapter))(IAudioAdapter **audioAdapter);
    467468    STDMETHOD(COMGETTER(USBController)) (IUSBController * *aUSBController);
     469    STDMETHOD(COMGETTER(SATAController)) (ISATAController **aSATAController);
    468470    STDMETHOD(COMGETTER(SettingsFilePath)) (BSTR *aFilePath);
    469471    STDMETHOD(COMGETTER(SettingsFileVersion)) (BSTR *aSettingsFileVersion);
     
    486488    STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice);
    487489    STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice);
    488     STDMETHOD(AttachHardDisk)(INPTR GUIDPARAM aId, DiskControllerType_T aCtl, LONG aDev);
    489     STDMETHOD(GetHardDisk)(DiskControllerType_T aCtl, LONG aDev, IHardDisk **aHardDisk);
    490     STDMETHOD(DetachHardDisk) (DiskControllerType_T aCtl, LONG aDev);
     490    STDMETHOD(AttachHardDisk)(INPTR GUIDPARAM aId, StorageBus_T aBus, LONG aChannel, LONG aDevice);
     491    STDMETHOD(GetHardDisk)(StorageBus_T aBus, LONG aChannel, LONG aDevice, IHardDisk **aHardDisk);
     492    STDMETHOD(DetachHardDisk) (StorageBus_T aBus, LONG aChannel, LONG aDevice);
    491493    STDMETHOD(GetSerialPort) (ULONG slot, ISerialPort **port);
    492494    STDMETHOD(GetParallelPort) (ULONG slot, IParallelPort **port);
     
    560562    virtual HRESULT onVRDPServerChange() { return S_OK; }
    561563    virtual HRESULT onUSBControllerChange() { return S_OK; }
     564    virtual HRESULT onSATAControllerChange() { return S_OK; }
    562565    virtual HRESULT onSharedFolderChange() { return S_OK; }
    563566
     
    719722    const ComObjPtr <AudioAdapter> mAudioAdapter;
    720723    const ComObjPtr <USBController> mUSBController;
     724    const ComObjPtr <SATAController> mSATAController;
    721725    const ComObjPtr <BIOSSettings> mBIOSSettings;
    722726    const ComObjPtr <NetworkAdapter>
  • trunk/src/VBox/Main/include/VirtualBoxXMLUtil.h

    r7341 r7442  
    2525
    2626/** VirtualBox XML settings version number substring ("x.y")  */
    27 #define VBOX_XML_VERSION "1.2"
     27#define VBOX_XML_VERSION        "1.3.pre"
    2828
    2929/** VirtualBox XML settings version platform substring */
     
    5151#define VBOX_XML_VERSION_FULL   VBOX_XML_VERSION "-" VBOX_XML_PLATFORM
    5252
    53 /** VirtualBox XML common settings version string */
    54 #define VBOX_XML_PLATFORM_COMMON  "common"
    55 
    56 /** VirtualBox XML settings schema file */
     53/** VirtualBox XML settings platform-specific (main) schema file */
    5754#define VBOX_XML_SCHEMA         "VirtualBox-settings-" VBOX_XML_PLATFORM ".xsd"
    58 #define VBOX_XML_SCHEMA_COMMON  "VirtualBox-settings-" VBOX_XML_PLATFORM_COMMON ".xsd"
     55/** VirtualBox XML settings common schema include file */
     56#define VBOX_XML_SCHEMA_COMMON  "VirtualBox-settings-common.xsd"
     57/** VirtualBox XML settings root element schema include file */
     58#define VBOX_XML_SCHEMA_ROOT    "VirtualBox-settings-root.xsd"
    5959
    6060/** VirtualBox XML settings converter file */
  • trunk/src/VBox/Main/linux/server.cpp

    r6828 r7442  
    9797#include <USBControllerImpl.h>
    9898#include <USBDeviceImpl.h>
     99#include <SATAControllerImpl.h>
    99100#include <AudioAdapterImpl.h>
    100101#include <SystemPropertiesImpl.h>
     
    160161NS_DECL_CLASSINFO(USBController)
    161162NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBController, IUSBController)
     163NS_DECL_CLASSINFO(SATAController)
     164NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SATAController, ISATAController)
    162165NS_DECL_CLASSINFO(USBDeviceFilter)
    163166NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilter, IUSBDeviceFilter)
  • trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp

    r7207 r7442  
    366366                    hardDisk->GetId(&vdiUUID);
    367367                    rc = machine->AttachHardDisk(*vdiUUID,
    368                                                 DiskControllerType::IDE0, // controler identifier
    369                                                 0);                       // device number on the controller
     368                                                StorageBus::IDE, // controler identifier
     369                                                0,               // channel number on the controller
     370                                                0);              // device number on the controller
    370371                    nsMemory::Free(vdiUUID);
    371372                    if (NS_FAILED(rc))
  • trunk/src/VBox/Main/xml/SchemaDefs.xsl

    r6597 r7442  
    9292  <!-- process include statements -->
    9393  <xsl:for-each select="xsd:include">
    94     <xsl:apply-templates select="document(@schemaLocation)/xsd:schema"/>
     94    <!-- skip VirtualBox-settings-root.xsd inclusion as it is computed at runtime -->
     95    <xsl:if test="not(@schemaLocation='VirtualBox-settings-root.xsd')">
     96      <xsl:apply-templates select="document(@schemaLocation)/xsd:schema"/>
     97    </xsl:if>
    9598  </xsl:for-each>
    9699
    97100  <xsl:call-template name="defineEnumMember">
    98       <xsl:with-param name="member" select="'        MinGuestRAM'"/>
    99       <xsl:with-param name="select" select="
    100         xsd:complexType[@name='TMemory']/xsd:attribute[@name='RAMSize']//xsd:minInclusive/@value
    101       "/>
     101    <xsl:with-param name="member" select="'        MinGuestRAM'"/>
     102    <xsl:with-param name="select" select="
     103      xsd:complexType[@name='TMemory']/xsd:attribute[@name='RAMSize']//xsd:minInclusive/@value
     104    "/>
    102105  </xsl:call-template>
    103106  <xsl:call-template name="defineEnumMember">
    104       <xsl:with-param name="member" select="'        MaxGuestRAM'"/>
    105       <xsl:with-param name="select" select="
    106         xsd:complexType[@name='TMemory']/xsd:attribute[@name='RAMSize']//xsd:maxInclusive/@value
    107       "/>
     107    <xsl:with-param name="member" select="'        MaxGuestRAM'"/>
     108    <xsl:with-param name="select" select="
     109      xsd:complexType[@name='TMemory']/xsd:attribute[@name='RAMSize']//xsd:maxInclusive/@value
     110    "/>
    108111  </xsl:call-template>
    109112
    110113  <xsl:call-template name="defineEnumMember">
    111       <xsl:with-param name="member" select="'        MinGuestVRAM'"/>
    112       <xsl:with-param name="select" select="
    113         xsd:complexType[@name='TDisplay']/xsd:attribute[@name='VRAMSize']//xsd:minInclusive/@value
    114       "/>
     114    <xsl:with-param name="member" select="'        MinGuestVRAM'"/>
     115    <xsl:with-param name="select" select="
     116      xsd:complexType[@name='TDisplay']/xsd:attribute[@name='VRAMSize']//xsd:minInclusive/@value
     117    "/>
    115118  </xsl:call-template>
    116119  <xsl:call-template name="defineEnumMember">
    117       <xsl:with-param name="member" select="'        MaxGuestVRAM'"/>
    118       <xsl:with-param name="select" select="
    119         xsd:complexType[@name='TDisplay']/xsd:attribute[@name='VRAMSize']//xsd:maxInclusive/@value
    120       "/>
     120    <xsl:with-param name="member" select="'        MaxGuestVRAM'"/>
     121    <xsl:with-param name="select" select="
     122      xsd:complexType[@name='TDisplay']/xsd:attribute[@name='VRAMSize']//xsd:maxInclusive/@value
     123    "/>
    121124  </xsl:call-template>
    122125  <xsl:call-template name="defineEnumMember">
    123       <xsl:with-param name="member" select="'        MaxGuestMonitors'"/>
    124       <xsl:with-param name="select" select="
    125         xsd:complexType[@name='TDisplay']/xsd:attribute[@name='MonitorCount']//xsd:maxInclusive/@value
    126       "/>
     126    <xsl:with-param name="member" select="'        MaxGuestMonitors'"/>
     127    <xsl:with-param name="select" select="
     128      xsd:complexType[@name='TDisplay']/xsd:attribute[@name='MonitorCount']//xsd:maxInclusive/@value
     129    "/>
    127130  </xsl:call-template>
    128131  <xsl:call-template name="defineEnumMember">
    129       <xsl:with-param name="member" select="'        NetworkAdapterCount'"/>
    130       <xsl:with-param name="select" select="
    131         xsd:complexType[@name='TNetworkAdapter']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
    132       "/>
     132    <xsl:with-param name="member" select="'        NetworkAdapterCount'"/>
     133    <xsl:with-param name="select" select="
     134      xsd:complexType[@name='TNetworkAdapter']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
     135    "/>
    133136  </xsl:call-template>
    134137  <xsl:call-template name="defineEnumMember">
    135       <xsl:with-param name="member" select="'        SerialPortCount'"/>
    136       <xsl:with-param name="select" select="
    137         xsd:complexType[@name='TUartPort']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
    138       "/>
     138    <xsl:with-param name="member" select="'        SerialPortCount'"/>
     139    <xsl:with-param name="select" select="
     140      xsd:complexType[@name='TUartPort']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
     141    "/>
    139142  </xsl:call-template>
    140143  <xsl:call-template name="defineEnumMember">
    141       <xsl:with-param name="member" select="'        ParallelPortCount'"/>
    142       <xsl:with-param name="select" select="
    143         xsd:complexType[@name='TLptPort']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
    144       "/>
     144    <xsl:with-param name="member" select="'        ParallelPortCount'"/>
     145    <xsl:with-param name="select" select="
     146      xsd:complexType[@name='TLptPort']/xsd:attribute[@name='slot']//xsd:maxExclusive/@value
     147    "/>
    145148  </xsl:call-template>
    146149  <xsl:call-template name="defineEnumMember">
    147       <xsl:with-param name="member" select="'        MaxBootPosition'"/>
    148       <xsl:with-param name="select" select="
    149         xsd:complexType[@name='TBoot']//xsd:element[@name='Order']//xsd:attribute[@name='position']//xsd:maxInclusive/@value
    150       "/>
     150    <xsl:with-param name="member" select="'        MaxBootPosition'"/>
     151    <xsl:with-param name="select" select="
     152      xsd:complexType[@name='TBoot']//xsd:element[@name='Order']//xsd:attribute[@name='position']//xsd:maxInclusive/@value
     153    "/>
    151154  </xsl:call-template>
    152155
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r7218 r7442  
    498498    <xsd:simpleType>
    499499      <xsd:restriction base="xsd:token">
    500         <xsd:enumeration value="ide0"/>
    501         <xsd:enumeration value="ide1"/>
    502       </xsd:restriction>
    503     </xsd:simpleType>
    504   </xsd:attribute>
    505   <xsd:attribute name="device" use="required">
    506     <xsd:simpleType>
    507       <xsd:restriction base="xsd:token">
    508         <xsd:enumeration value="master"/>
    509         <xsd:enumeration value="slave"/>
    510       </xsd:restriction>
    511     </xsd:simpleType>
    512   </xsd:attribute>
     500        <xsd:enumeration value="IDE"/>
     501        <xsd:enumeration value="SATA"/>
     502      </xsd:restriction>
     503    </xsd:simpleType>
     504  </xsd:attribute>
     505  <xsd:attribute name="channel" type="xsd:unsignedInt" use="required"/>
     506  <xsd:attribute name="device" type="xsd:unsignedInt" default="0"/>
    513507</xsd:complexType>
    514508
     
    658652  <xsd:attribute name="MemoryBalloonSize"        type="xsd:unsignedInt" default="0"/>
    659653  <xsd:attribute name="StatisticsUpdateInterval" type="xsd:unsignedInt" default="0"/>
     654</xsd:complexType>
     655
     656<xsd:complexType name="TSATAController">
     657  <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
     658  <xsd:attribute name="IDE0MasterEmulationPort" type="xsd:unsignedInt" default="0"/>
     659  <xsd:attribute name="IDE0SlaveEmulationPort" type="xsd:unsignedInt" default="1"/>
     660  <xsd:attribute name="IDE1MasterEmulationPort" type="xsd:unsignedInt" default="2"/>
     661  <xsd:attribute name="IDE1SlaveEmulationPort" type="xsd:unsignedInt" default="3"/>
    660662</xsd:complexType>
    661663
     
    676678    <xsd:element name="FloppyDrive" type="TFloppyDrive"/>
    677679    <xsd:element name="USBController" type="TUSBController"/>
     680    <xsd:element name="SATAController" type="TSATAController"/>
    678681    <xsd:element name="Network" type="TNetwork">
    679682      <xsd:unique name="THardware-Network-Adapter">
  • trunk/src/VBox/Main/xml/VirtualBox-settings-freebsd.xsd

    r6606 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-freebsd.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (freebsd).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    102109</xsd:complexType>
    103110
    104 <!--
    105 // Root element
    106 /////////////////////////////////////////////////////////////////////////
    107 -->
    108 
    109 <xsd:element name="VirtualBox">
    110   <xsd:complexType>
    111     <xsd:complexContent>
    112       <xsd:extension base="TVirtualBox">
    113         <xsd:attribute name="version" type="xsd:token" fixed="1.2-freebsd" use="required"/>
    114       </xsd:extension>
    115     </xsd:complexContent>
    116   </xsd:complexType>
    117 </xsd:element>
    118 
    119111</xsd:schema>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-linux.xsd

    r6597 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-linux.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (linux).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    103110</xsd:complexType>
    104111
    105 <!--
    106 // Root element
    107 /////////////////////////////////////////////////////////////////////////
    108 -->
    109 
    110 <xsd:element name="VirtualBox">
    111   <xsd:complexType>
    112     <xsd:complexContent>
    113       <xsd:extension base="TVirtualBox">
    114         <xsd:attribute name="version" type="xsd:token" fixed="1.2-linux" use="required"/>
    115       </xsd:extension>
    116     </xsd:complexContent>
    117   </xsd:complexType>
    118 </xsd:element>
    119 
    120112</xsd:schema>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-macosx.xsd

    r6606 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-macosx.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (macosx).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    101108</xsd:complexType>
    102109
    103 <!--
    104 // Root element
    105 /////////////////////////////////////////////////////////////////////////
    106 -->
    107 
    108 <xsd:element name="VirtualBox">
    109   <xsd:complexType>
    110     <xsd:complexContent>
    111       <xsd:extension base="TVirtualBox">
    112         <xsd:attribute name="version" type="xsd:token" fixed="1.2-macosx" use="required"/>
    113       </xsd:extension>
    114     </xsd:complexContent>
    115   </xsd:complexType>
    116 </xsd:element>
    117 
    118110</xsd:schema>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-os2.xsd

    r6606 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-os2.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (os2).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    101108</xsd:complexType>
    102109
    103 <!--
    104 // Root element
    105 /////////////////////////////////////////////////////////////////////////
    106 -->
    107 
    108 <xsd:element name="VirtualBox">
    109   <xsd:complexType>
    110     <xsd:complexContent>
    111       <xsd:extension base="TVirtualBox">
    112         <xsd:attribute name="version" type="xsd:token" fixed="1.2-os2" use="required"/>
    113       </xsd:extension>
    114     </xsd:complexContent>
    115   </xsd:complexType>
    116 </xsd:element>
    117 
    118110</xsd:schema>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-solaris.xsd

    r6606 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-solaris.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (solaris).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    101108</xsd:complexType>
    102109
    103 <!--
    104 // Root element
    105 /////////////////////////////////////////////////////////////////////////
    106 -->
    107 
    108 <xsd:element name="VirtualBox">
    109   <xsd:complexType>
    110     <xsd:complexContent>
    111       <xsd:extension base="TVirtualBox">
    112         <xsd:attribute name="version" type="xsd:token" fixed="1.2-solaris" use="required"/>
    113       </xsd:extension>
    114     </xsd:complexContent>
    115   </xsd:complexType>
    116 </xsd:element>
    117 
    118110</xsd:schema>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-windows.xsd

    r6606 r7442  
    2727<xsd:annotation>
    2828  <xsd:documentation xml:lang="en">
    29     innotek VirtualBox Settings Schema Version 1.0-windows.
    30     Copyright (c) 2004-2007 innotek GmbH.
     29    innotek VirtualBox Settings Schema (windows).
     30    Copyright (c) 2004-2008 innotek GmbH.
    3131  </xsd:documentation>
    3232</xsd:annotation>
    3333
    3434<xsd:include schemaLocation="VirtualBox-settings-common.xsd"/>
     35
     36<!--
     37  this includes a computed VirtualBox element definition that contains
     38  a proper 'version' attribute constraint (e.g. recent verison number
     39  and platform suffix)
     40-->
     41<xsd:include schemaLocation="VirtualBox-settings-root.xsd"/>
    3542
    3643<!--
     
    100107</xsd:complexType>
    101108
    102 <!--
    103 // Root element
    104 /////////////////////////////////////////////////////////////////////////
    105 -->
    106 
    107 <xsd:element name="VirtualBox">
    108   <xsd:complexType>
    109     <xsd:complexContent>
    110       <xsd:extension base="TVirtualBox">
    111         <xsd:attribute name="version" type="xsd:token" fixed="1.2-windows" use="required"/>
    112       </xsd:extension>
    113     </xsd:complexContent>
    114   </xsd:complexType>
    115 </xsd:element>
    116 
    117109</xsd:schema>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette