VirtualBox

Ignore:
Timestamp:
Aug 12, 2010 6:12:39 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64743
Message:

Main: Implemenation of per-machine media registries; VirtualBox::openMedium() no longer adds media to the global registry, instead a media are stored in a machine XML registry after Machine::AttachDevice() has been called; Machine::AttachDevice() now takes an IMedium object instead of a UUID; also make Machine::Unregister() work again for inaccessible machines

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r31575 r31615  
    661661                    if (hardDisk)
    662662                    {
    663                         Bstr uuid;
    664                         hardDisk->COMGETTER(Id)(uuid.asOutParam());
    665                         CHECK_ERROR(machine, AttachDevice(bstrController, u1, u2, DeviceType_HardDisk, uuid));
     663                        CHECK_ERROR(machine, AttachDevice(bstrController, u1, u2, DeviceType_HardDisk, hardDisk));
    666664                    }
    667665                    else
     
    757755                    if (hardDisk)
    758756                    {
    759                         Bstr uuid;
    760                         hardDisk->COMGETTER(Id)(uuid.asOutParam());
    761                         rc = machine->AttachDevice(Bstr("LsiLogic"), GetOptState.uIndex, 0, DeviceType_HardDisk, uuid);
     757                        rc = machine->AttachDevice(Bstr("LsiLogic"), GetOptState.uIndex, 0, DeviceType_HardDisk, hardDisk);
    762758                        if (FAILED(rc))
    763759                            CHECK_ERROR(machine,
    764760                                         AttachDevice(Bstr("BusLogic"),
    765761                                                      GetOptState.uIndex, 0,
    766                                                       DeviceType_HardDisk, uuid));
     762                                                      DeviceType_HardDisk, hardDisk));
    767763                    }
    768764                    else
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r31568 r31615  
    287287            /* attach a empty floppy/dvd drive after removing previous attachment */
    288288            machine->DetachDevice(Bstr(pszCtl), port, device);
    289             CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, deviceType, Bstr("")));
     289            CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, deviceType, NULL));
    290290        }
    291291    }
     
    411411                    {
    412412                        machine->DetachDevice(Bstr(pszCtl), port, device);
    413                         rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, Bstr(""));
     413                        rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, NULL);
    414414                    }
    415415                }
    416416                else
    417417                {
    418                     rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, Bstr(""));
     418                    rc = machine->AttachDevice(Bstr(pszCtl), port, device, DeviceType_DVD, NULL);
    419419                }
    420420            }
     
    501501            if (hardDisk)
    502502            {
    503                 Bstr uuid;
    504                 hardDisk->COMGETTER(Id)(uuid.asOutParam());
    505                 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_HardDisk, uuid));
     503                CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_HardDisk, hardDisk));
    506504            }
    507505            else
     
    520518            if (   !fRunTime
    521519                && !floppyAttachment)
    522                 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_Floppy, Bstr("")));
     520                CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_Floppy, NULL));
    523521
    524522            /* host drive? */
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