VirtualBox

儲存庫 vbox 的更動 42538


忽略:
時間撮記:
2012-8-2 下午01:28:40 (12 年 以前)
作者:
vboxsync
訊息:

added 3 extra methods for 6124

位置:
trunk/src/VBox
檔案:
修改 7 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r42445 r42538  
    10251025                    /* enable the controller */
    10261026                    if (!floppyAttachment)
    1027                         CHECK_ERROR(machine, AttachDevice(Bstr("Floppy Controller").raw(),
    1028                                                           0, 0,
    1029                                                           DeviceType_Floppy, NULL));
     1027                        CHECK_ERROR(machine, AttachDeviceWithoutMedium(Bstr("Floppy Controller").raw(),
     1028                                                                            0, 0,
     1029                                                                            DeviceType_Floppy));
    10301030
    10311031                    /* unmount? */
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r42442 r42538  
    407407                     * Main will complain if the controller doesn't support hotplugging.
    408408                     */
    409                     CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl).raw(), port, device,
    410                                                       devTypeRequested, NULL));
     409                    CHECK_ERROR(machine, AttachDeviceWithoutMedium(Bstr(pszCtl).raw(), port, device,
     410                                                                   devTypeRequested));
    411411                    deviceType = DeviceType_DVD; /* To avoid the error message below. */
    412412                }
     
    445445                /* attach a empty floppy/dvd drive after removing previous attachment */
    446446                machine->DetachDevice(Bstr(pszCtl).raw(), port, device);
    447                 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl).raw(), port, device,
    448                                                   deviceType, NULL));
     447                CHECK_ERROR(machine, AttachDeviceWithoutMedium(Bstr(pszCtl).raw(), port, device,
     448                                                            deviceType));
    449449            }
    450450        } // end if (!RTStrICmp(pszMedium, "emptydrive"))
     
    690690                                {
    691691                                    machine->DetachDevice(Bstr(pszCtl).raw(), port, device);
    692                                     rc = machine->AttachDevice(Bstr(pszCtl).raw(),
    693                                                                port,
    694                                                                device,
    695                                                                devTypeRequested,    // DeviceType_DVD or DeviceType_Floppy
    696                                                                NULL);
     692                                    rc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(),
     693                                                                            port,
     694                                                                            device,
     695                                                                            devTypeRequested);    // DeviceType_DVD or DeviceType_Floppy
    697696                                }
    698697                            }
    699698                            else
    700699                            {
    701                                 rc = machine->AttachDevice(Bstr(pszCtl).raw(),
    702                                                            port,
    703                                                            device,
    704                                                            devTypeRequested,    // DeviceType_DVD or DeviceType_Floppy
    705                                                            NULL);
     700                                rc = machine->AttachDeviceWithoutMedium(Bstr(pszCtl).raw(),
     701                                                                        port,
     702                                                                        device,
     703                                                                        devTypeRequested);    // DeviceType_DVD or DeviceType_Floppy
    706704                            }
    707705                        }
     
    846844            {
    847845                /* Just remove the bandwidth gorup. */
    848                 CHECK_ERROR(machine, SetBandwidthGroupForDevice(Bstr(pszCtl).raw(),
    849                                                                 port, device, NULL));
     846                CHECK_ERROR(machine, SetNoBandwidthGroupForDevice(Bstr(pszCtl).raw(),
     847                                                                  port, device));
    850848            }
    851849            else
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r42525 r42538  
    12061206  <interface
    12071207    name="IVirtualBoxErrorInfo" extends="$errorinfo"
    1208     uuid="e053d3c0-f493-491b-a735-3a9f0b1feed4"
     1208    uuid="f91e6e91-49e1-4fd2-b21e-269003350d06"
    12091209    supportsErrorInfo="no"
    12101210    wsmap="managed"
     
    37573757  <interface
    37583758    name="IMachine" extends="$unknown"
    3759     uuid="f5b974bd-473b-43b6-b800-1ec40b9a8513"
     3759    uuid="481ae051-96ed-4ba3-81e6-7b2c186005bc"
    37603760    wsmap="managed"
    37613761    >
     
    48124812    </method>
    48134813
     4814  <method name="attachDeviceWithoutMedium">
     4815      <desc>
     4816      Attaches a device and optionally mounts a medium to the given storage
     4817      controller (<link to="IStorageController" />, identified by @a name),
     4818      at the indicated port and device.
     4819
     4820      This method is intended for managing storage devices in general while a
     4821      machine is powered off. It can be used to attach and detach fixed
     4822      and removable media. The following kind of media can be attached
     4823      to a machine:
     4824      <ul>
     4825      <li>
     4826      For fixed and removable media, you can pass in a medium that was
     4827      previously opened using <link to="IVirtualBox::openMedium" />.
     4828      </li>
     4829
     4830      <li>Only for storage devices supporting removable media (such as
     4831      DVDs and floppies) with an empty drive or one of the medium objects listed
     4832      in the <link to="IHost::DVDDrives" /> and <link to="IHost::floppyDrives"/>
     4833      arrays to indicate a host drive.
     4834      For removable devices, you can also use <link to="IMachine::mountMedium"/>
     4835      to change the media while the machine is running.
     4836      </li>
     4837      </ul>
     4838
     4839      In a VM's default configuration of virtual machines, the secondary
     4840      master of the IDE controller is used for a CD/DVD drive.
     4841      <link to="IMediumAttachment"/> will appear in the machine's list of medium
     4842      attachments (see <link to="IMachine::mediumAttachments"/>).
     4843
     4844      See <link to="IMedium"/> and <link to="IMediumAttachment"/> for more
     4845      information about attaching media.
     4846
     4847      The specified device slot must not have a device attached to it,
     4848      or this method will fail.
     4849      <note>
     4850      You cannot attach a device to a newly created machine until
     4851      this machine's settings are saved to disk using
     4852      <link to="#saveSettings"/>.
     4853      </note>
     4854      <note>
     4855      If the medium is being attached indirectly, a new differencing medium
     4856      will implicitly be created for it and attached instead. If the
     4857      changes made to the machine settings (including this indirect
     4858      attachment) are later cancelled using <link to="#discardSettings"/>,
     4859      this implicitly created differencing medium will implicitly
     4860      be deleted.
     4861      </note>
     4862
     4863      <result name="E_INVALIDARG">
     4864        SATA device, SATA port, IDE port or IDE slot out of range, or
     4865            file or UUID not found.
     4866      </result>
     4867      <result name="VBOX_E_INVALID_OBJECT_STATE">
     4868        Machine must be registered before media can be attached.
     4869      </result>
     4870      <result name="VBOX_E_INVALID_VM_STATE">
     4871      Invalid machine state.
     4872      </result>
     4873      <result name="VBOX_E_OBJECT_IN_USE">
     4874      A medium is already attached to this or another virtual machine.
     4875      </result>
     4876      </desc>
     4877      <param name="name" type="wstring" dir="in">
     4878      <desc>Name of the storage controller to attach the device to.</desc>
     4879      </param>
     4880      <param name="controllerPort" type="long" dir="in">
     4881      <desc>Port to attach the device to. For an IDE controller, 0 specifies
     4882      the primary controller and 1 specifies the secondary controller.
     4883      For a SCSI controller, this must range from 0 to 15; for a SATA controller,
     4884      from 0 to 29; for an SAS controller, from 0 to 7.</desc>
     4885      </param>
     4886      <param name="device" type="long" dir="in">
     4887      <desc>Device slot in the given port to attach the device to. This is only
     4888      relevant for IDE controllers, for which 0 specifies the master device and
     4889      1 specifies the slave device. For all other controller types, this must
     4890      be 0.</desc>
     4891      </param>
     4892      <param name="type" type="DeviceType" dir="in">
     4893      <desc>Device type of the attached device. For media opened by
     4894      <link to="IVirtualBox::openMedium" />, this must match the device type
     4895      specified there.</desc>
     4896      </param>
     4897    </method>
     4898
    48144899    <method name="detachDevice">
    48154900      <desc>
     
    50425127    </method>
    50435128
    5044     <method name="UnmountMedium">
     5129    <method name="setNoBandwidthGroupForDevice">
     5130      <desc>
     5131      Sets no bandwidth group for an existing storage device.
     5132      The device must already exist; see <link to="IMachine::attachDevice"/>
     5133      for how to attach a new device.
     5134      The @a controllerPort and @a device parameters specify the device slot and
     5135      have have the same meaning as with <link to="IMachine::attachDevice" />.
     5136      <result name="E_INVALIDARG">
     5137      SATA device, SATA port, IDE port or IDE slot out of range.
     5138      </result>
     5139      <result name="VBOX_E_INVALID_OBJECT_STATE">
     5140      Attempt to modify an unregistered virtual machine.
     5141      </result>
     5142      <result name="VBOX_E_INVALID_VM_STATE">
     5143      Invalid machine state.
     5144      </result>
     5145
     5146       </desc>
     5147      <param name="name" type="wstring" dir="in">
     5148      <desc>Name of the storage controller.</desc>
     5149      </param>
     5150      <param name="controllerPort" type="long" dir="in">
     5151      <desc>Storage controller port.</desc>
     5152      </param>
     5153      <param name="device" type="long" dir="in">
     5154      <desc>Device slot in the given port.</desc>
     5155      </param>
     5156    </method>
     5157
     5158
     5159    <method name="unmountMedium">
    50455160          <desc>
    50465161            Unmounts any currently mounted medium (<link to="IMedium" />,
     
    1225212367  <interface
    1225312368    name="IMedium" extends="$unknown"
    12254     uuid="53f9cc0c-e0fd-40a5-a404-a7a5272082cd"
     12369    uuid="29989373-b111-4654-8493-2e1176cba890"
    1225512370    wsmap="managed"
    1225612371    >
     
    1338913504        <desc>Progress object to track the operation completion.</desc>
    1339013505      </param>
     13506    </method>
     13507
     13508    <method name="cloneToBase">
     13509    <desc>
     13510    Starts creating a clone of this medium in the format and at the
     13511    location defined by the @a target argument.
     13512
     13513    The target medium must be either in <link to="MediumState_NotCreated"/>
     13514    state (i.e. must not have an existing storage unit) or in
     13515    <link to="MediumState_Created"/> state (i.e. created and not locked, and
     13516    big enough to hold the data or else the copy will be partial). Upon
     13517    successful completion, the cloned medium will contain exactly the
     13518    same sector data as the medium being cloned, except that in the
     13519    first case a new UUID for the clone will be randomly generated, and in
     13520    the second case the UUID will remain unchanged.
     13521
     13522    The @a parent argument defines which medium will be the parent
     13523    of the clone. In this case the clone will be a base image, i.e.
     13524    completely independent. It is possible to specify an arbitrary
     13525    medium for this parameter, including the parent of the
     13526    medium which is being cloned. Even cloning to a child of the source
     13527    medium is possible. Note that when cloning to an existing image, the
     13528    @a parent argument is ignored.
     13529
     13530    After the returned progress object reports that the operation is
     13531    successfully complete, the target medium gets remembered by this
     13532    VirtualBox installation and may be attached to virtual machines.
     13533
     13534    <note>
     13535    This medium will be placed to <link to="MediumState_LockedRead"/>
     13536    state for the duration of this operation.
     13537    </note>
     13538    <result name="E_NOTIMPL">
     13539    The specified cloning variant is not supported at the moment.
     13540    </result>
     13541    </desc>
     13542    <param name="target" type="IMedium" dir="in">
     13543    <desc>Target medium.</desc>
     13544    </param>
     13545    <param name="variant" type="unsigned long" dir="in">
     13546    <desc>Exact image variant which should be created (as a combination of
     13547    <link to="MediumVariant" /> flags).</desc>
     13548    </param>
     13549    <param name="progress" type="IProgress" dir="return">
     13550    <desc>Progress object to track the operation completion.</desc>
     13551    </param>
    1339113552    </method>
    1339213553
  • trunk/src/VBox/Main/include/MachineImpl.h

    r42489 r42538  
    500500    STDMETHOD(SetBootOrder)(ULONG aPosition, DeviceType_T aDevice);
    501501    STDMETHOD(GetBootOrder)(ULONG aPosition, DeviceType_T *aDevice);
     502    STDMETHOD(AttachDeviceWithoutMedium)(IN_BSTR aControllerName, LONG aControllerPort,
     503                                        LONG aDevice, DeviceType_T aType);
    502504    STDMETHOD(AttachDevice)(IN_BSTR aControllerName, LONG aControllerPort,
    503505                            LONG aDevice, DeviceType_T aType, IMedium *aMedium);
     
    507509    STDMETHOD(NonRotationalDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aNonRotational);
    508510    STDMETHOD(SetAutoDiscardForDevice)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice, BOOL aDiscard);
     511    STDMETHOD(SetNoBandwidthGroupForDevice)(IN_BSTR aControllerName, LONG aControllerPort,
     512                                            LONG aDevice);
    509513    STDMETHOD(SetBandwidthGroupForDevice)(IN_BSTR aControllerName, LONG aControllerPort,
    510514                                          LONG aDevice, IBandwidthGroup *aBandwidthGroup);
  • trunk/src/VBox/Main/include/MediumImpl.h

    r42125 r42538  
    154154    STDMETHOD(CloneTo)(IMedium *aTarget, ULONG aVariant,
    155155                        IMedium *aParent, IProgress **aProgress);
     156    STDMETHOD(CloneToBase)(IMedium *aTarget, ULONG aVariant,
     157                           IProgress **aProgress);
    156158    STDMETHOD(Compact)(IProgress **aProgress);
    157159    STDMETHOD(Resize)(LONG64 aLogicalSize, IProgress **aProgress);
     
    183185    bool getFirstRegistryMachineId(Guid &uuid) const;
    184186    void markRegistriesModified();
    185    
     187
    186188    HRESULT setPropertyDirect(const Utf8Str &aName, const Utf8Str &aValue);
    187189
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r42489 r42538  
    42914291}
    42924292
     4293STDMETHODIMP Machine::SetNoBandwidthGroupForDevice(IN_BSTR aControllerName, LONG aControllerPort,
     4294                                                   LONG aDevice)
     4295{
     4296    int rc = S_OK;
     4297    LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d\n",
     4298                     aControllerName, aControllerPort, aDevice));
     4299
     4300    rc = SetBandwidthGroupForDevice(aControllerName, aControllerPort, aDevice, NULL);
     4301
     4302    return rc;
     4303}
     4304
    42934305STDMETHODIMP Machine::SetBandwidthGroupForDevice(IN_BSTR aControllerName, LONG aControllerPort,
    42944306                                                 LONG aDevice, IBandwidthGroup *aBandwidthGroup)
     
    43534365    return S_OK;
    43544366}
     4367
     4368STDMETHODIMP Machine::AttachDeviceWithoutMedium(IN_BSTR aControllerName,
     4369                                                LONG    aControllerPort,
     4370                                                LONG    aDevice,
     4371                                                DeviceType_T aType)
     4372{
     4373     HRESULT rc = S_OK;
     4374
     4375     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d aType=%d aMedium=%p\n",
     4376                      aControllerName, aControllerPort, aDevice, aType));
     4377
     4378     rc = AttachDevice(aControllerName, aControllerPort, aDevice, aType, NULL);
     4379
     4380     return rc;
     4381}
     4382
     4383
    43554384
    43564385STDMETHODIMP Machine::UnmountMedium(IN_BSTR aControllerName,
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r42208 r42538  
    26432643
    26442644    return rc;
     2645}
     2646
     2647STDMETHODIMP Medium::CloneToBase(IMedium   *aTarget,
     2648                                 ULONG     aVariant,
     2649                                 IProgress **aProgress)
     2650{
     2651     int rc = S_OK;
     2652     CheckComArgNotNull(aTarget);
     2653     CheckComArgOutPointerValid(aProgress);
     2654     rc =  CloneTo(aTarget, aVariant, NULL, aProgress);
     2655     return rc;
    26452656}
    26462657
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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