VirtualBox

Changeset 17939 in vbox


Ignore:
Timestamp:
Mar 16, 2009 2:28:53 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44513
Message:

VBoxManage: Make it possible to specify the SCSI controller type

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk

    r17882 r17939  
    4040        $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
    4141        $(if $(VBOX_WITH_AHCI), VBOX_WITH_AHCI) \
    42         $(if $(VBOX_WITH_AHCI), VBOX_WITH_LSILOGIC) \
     42        $(if $(VBOX_WITH_SCSI), VBOX_WITH_SCSI) \
    4343        $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS) \
    4444        $(if $(VBOX_WITH_HOSTNETIF_API), VBOX_WITH_HOSTNETIF_API)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r17886 r17939  
    158158                 "                            [-sataideemulation<1-4> <1-30>]\n"
    159159#endif
    160 #ifdef VBOX_WITH_LSILOGIC
    161                  "                            [-lsilogic on|off]\n"
    162                  "                            [-lsilogicport<1-16> none|<uuid>|<filename>]\n"
     160#ifdef VBOX_WITH_SCSI
     161                 "                            [-scsi on|off]\n"
     162                 "                            [-scsiport<1-16> none|<uuid>|<filename>]\n"
     163                 "                            [-scsitype LsiLogic|BusLogic]\n"
    163164#endif
    164165                 "                            [-dvd none|<uuid>|<filename>|host:<drive>]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r17843 r17939  
    100100    ULONG guestStatInterval = (ULONG)-1;
    101101    int   fSataEnabled = -1;
    102     int   fLsiLogicEnabled = -1;
     102    int   fScsiEnabled = -1;
     103    int   fScsiLsiLogic = -1;
    103104    int   sataPortCount = -1;
    104105    int   sataBootDevices[4] = {-1,-1,-1,-1};
     
    734735            sataBootDevices[bootDevicePos] = n-1;
    735736        }
    736         else if (strcmp(a->argv[i], "-lsilogic") == 0)
     737        else if (strcmp(a->argv[i], "-scsi") == 0)
    737738        {
    738739            if (a->argc <= i + 1)
     
    740741            i++;
    741742            if (strcmp(a->argv[i], "on") == 0 || strcmp(a->argv[i], "enable") == 0)
    742                 fLsiLogicEnabled = 1;
     743                fScsiEnabled = 1;
    743744            else if (strcmp(a->argv[i], "off") == 0 || strcmp(a->argv[i], "disable") == 0)
    744                 fLsiLogicEnabled = 0;
    745             else
    746                 return errorArgument("Invalid -lsilogic argument '%s'", a->argv[i]);
    747         }
    748         else if (strncmp(a->argv[i], "-lsilogicport", 13) == 0)
    749         {
    750             unsigned n = parseNum(&a->argv[i][13], 16, "LsiLogic");
     745                fScsiEnabled = 0;
     746            else
     747                return errorArgument("Invalid -scsi argument '%s'", a->argv[i]);
     748        }
     749        else if (strncmp(a->argv[i], "-scsiport", 9) == 0)
     750        {
     751            unsigned n = parseNum(&a->argv[i][9], 16, "SCSI");
    751752            if (!n)
    752753                return 1;
     
    755756            i++;
    756757            hdds[n-1+34] = a->argv[i];
     758        }
     759        else if (strcmp(a->argv[i], "-scsitype") == 0)
     760        {
     761            if (a->argc <= i + 1)
     762                return errorArgument("Missing argument to '%s'", a->argv[i]);
     763            i++;
     764            if (strcmp(a->argv[i], "LsiLogic") == 0 )
     765                fScsiLsiLogic = 1;
     766            else if (strcmp(a->argv[i], "BusLogic") == 0)
     767                fScsiLsiLogic = 0;
     768            else
     769                return errorArgument("Invalid -scsitype argument '%s'", a->argv[i]);
    757770        }
    758771        else
     
    18581871
    18591872        /*
    1860          * LsiLogic controller enable/disable
     1873         * SCSI controller enable/disable
    18611874         */
    1862         if (fLsiLogicEnabled != -1)
    1863         {
    1864             if (fLsiLogicEnabled)
     1875        if (fScsiEnabled != -1)
     1876        {
     1877            if (fScsiEnabled)
    18651878            {
    18661879                ComPtr<IStorageController> ctl;
    1867                 CHECK_ERROR(machine, AddStorageController(Bstr("LsiLogic"), StorageBus_SCSI, ctl.asOutParam()));
    1868                 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic));
    1869             }
    1870             else
    1871                 CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic")));
     1880                if (fScsiLsiLogic == 0)
     1881                {
     1882                    CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic"), StorageBus_SCSI, ctl.asOutParam()));
     1883                    CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic));
     1884                }
     1885                else /* LsiLogic is default */
     1886                {
     1887                    CHECK_ERROR(machine, AddStorageController(Bstr("LsiLogic"), StorageBus_SCSI, ctl.asOutParam()));
     1888                    CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic));
     1889                }
     1890            }
     1891            else
     1892            {
     1893                rc = machine->RemoveStorageController(Bstr("LsiLogic"));
     1894                if (!SUCCEEDED(rc))
     1895                    CHECK_ERROR(machine, RemoveStorageController(Bstr("BusLogic")));
     1896            }
    18721897        }
    18731898
     
    18781903                if (strcmp(hdds[i], "none") == 0)
    18791904                {
    1880                     machine->DetachHardDisk(Bstr("LsiLogic"), i-34, 0);
     1905                    rc = machine->DetachHardDisk(Bstr("LsiLogic"), i-34, 0);
     1906                    if (!SUCCEEDED(rc))
     1907                        CHECK_ERROR(machine, DetachHardDisk(Bstr("BusLogic"), i-34, 0));
    18811908                }
    18821909                else
     
    18991926                    {
    19001927                        hardDisk->COMGETTER(Id)(uuid.asOutParam());
    1901                         CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("LsiLogic"), i-34, 0));
     1928                        rc = machine->AttachHardDisk(uuid, Bstr("LsiLogic"), i-34, 0);
     1929                        if (!SUCCEEDED(rc))
     1930                            CHECK_ERROR(machine, AttachHardDisk(uuid, Bstr("BusLogic"), i-34, 0));
    19021931                    }
    19031932                    else
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