VirtualBox

Changeset 42442 in vbox for trunk/src


Ignore:
Timestamp:
Jul 27, 2012 4:47:04 PM (13 years ago)
Author:
vboxsync
Message:

Elinate use of NULL object references in the API - 6124

Location:
trunk/src/VBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r42248 r42442  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp

    r42395 r42442  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    395395                    {
    396396                        /* just unmount the floppy/dvd */
    397                         CHECK_ERROR(machine, MountMedium(Bstr(pszCtl).raw(),
    398                                                          port,
    399                                                          device,
    400                                                          NULL,
    401                                                          fForceUnmount));
     397                        CHECK_ERROR(machine, UnmountMedium(Bstr(pszCtl).raw(),
     398                                                           port,
     399                                                           device,
     400                                                           fForceUnmount));
    402401                    }
    403402                }
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r42413 r42442  
    37573757  <interface
    37583758    name="IMachine" extends="$unknown"
    3759     uuid="0e84a036-73bf-49c8-b587-c558d4daa788"
     3759    uuid="f5b974bd-473b-43b6-b800-1ec40b9a8513"
    37603760    wsmap="managed"
    37613761    >
     
    50415041      </param>
    50425042    </method>
     5043
     5044    <method name="UnmountMedium">
     5045          <desc>
     5046            Unmounts any currently mounted medium (<link to="IMedium" />,
     5047            identified by the given UUID @a id) to the given storage controller
     5048            (<link to="IStorageController" />, identified by @a name),
     5049            at the indicated port and device. The device must already exist;
     5050
     5051            This method is intended only for managing removable media, where the
     5052            device is fixed but media is changeable at runtime (such as DVDs
     5053            and floppies). It cannot be used for fixed media such as hard disks.
     5054
     5055            The @a controllerPort and @a device parameters specify the device slot
     5056            and have have the same meaning as with
     5057            <link to="IMachine::attachDevice" />.
     5058
     5059            The specified device slot must have a medium mounted, which will be
     5060            unmounted. If there is no mounted medium it will do nothing.
     5061            See <link to="IMedium"/> for more detailed information about
     5062            attaching/unmounting media.
     5063
     5064            <result name="E_INVALIDARG">
     5065            SATA device, SATA port, IDE port or IDE slot out of range.
     5066            </result>
     5067            <result name="VBOX_E_INVALID_OBJECT_STATE">
     5068            Attempt to unmount medium that is not removeable - not dvd or floppy.
     5069            </result>
     5070            <result name="VBOX_E_INVALID_VM_STATE">
     5071            Invalid machine state.
     5072            </result>
     5073            <result name="VBOX_E_OBJECT_IN_USE">
     5074            Medium already attached to this or another virtual machine.
     5075            </result>
     5076            <result name="VBOX_E_OBJECT_NOT_FOUND">
     5077            Medium not attached to specified port, device, controller.
     5078            </result>
     5079
     5080            </desc>
     5081              <param name="name" type="wstring" dir="in">
     5082              <desc>Name of the storage controller to unmount the medium from.</desc>
     5083              </param>
     5084              <param name="controllerPort" type="long" dir="in">
     5085              <desc>Port to unmount the medium from.</desc>
     5086              </param>
     5087              <param name="device" type="long" dir="in">
     5088              <desc>Device slot in the given port to unmount the medium from.</desc>
     5089              </param>
     5090              <param name="force" type="boolean" dir="in">
     5091              <desc>Allows to force unmount of a medium which is locked by
     5092              the device slot in the given port medium is attached to.</desc>
     5093              </param>
     5094          </method>
    50435095
    50445096    <method name="mountMedium">
  • trunk/src/VBox/Main/include/MachineImpl.h

    r42261 r42442  
    508508    STDMETHOD(MountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
    509509                           LONG aDevice, IMedium *aMedium, BOOL aForce);
     510    STDMETHOD(UnmountMedium)(IN_BSTR aControllerName, LONG aControllerPort,
     511                             LONG aDevice, BOOL aForce);
    510512    STDMETHOD(GetMedium)(IN_BSTR aControllerName, LONG aControllerPort, LONG aDevice,
    511513                         IMedium **aMedium);
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r42383 r42442  
    43504350}
    43514351
     4352STDMETHODIMP Machine::UnmountMedium(IN_BSTR aControllerName,
     4353                                    LONG    aControllerPort,
     4354                                    LONG    aDevice,
     4355                                    BOOL    aForce)
     4356{
     4357     int rc = S_OK;
     4358     LogFlowThisFunc(("aControllerName=\"%ls\" aControllerPort=%d aDevice=%d",
     4359                      aControllerName, aControllerPort, aForce));
     4360
     4361     rc = MountMedium(aControllerName, aControllerPort, aDevice, NULL, aForce);
     4362
     4363     return rc;
     4364}
    43524365
    43534366STDMETHODIMP Machine::MountMedium(IN_BSTR aControllerName,
Note: See TracChangeset for help on using the changeset viewer.

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