VirtualBox

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


Ignore:
Timestamp:
Oct 16, 2009 2:15:04 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53579
Message:

API/Medium: new attribute to get the kind of medium (dvd/floppy/hard disk), plus error message fixes to use the right terminology.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r23591 r23823  
    14341434}
    14351435
     1436STDMETHODIMP Medium::COMGETTER(DeviceType)(DeviceType_T *aDeviceType)
     1437{
     1438    CheckComArgOutPointerValid(aDeviceType);
     1439
     1440    AutoCaller autoCaller(this);
     1441    CheckComRCReturnRC(autoCaller.rc());
     1442
     1443    AutoReadLock alock(this);
     1444
     1445    *aDeviceType = m->devType;
     1446
     1447    return S_OK;
     1448}
     1449
    14361450STDMETHODIMP Medium::COMGETTER(HostDrive)(BOOL *aHostDrive)
    14371451{
     
    33443358 * and assign to this medium, and <ext> is the default extension for this
    33453359 * medium's storage format. Note that this procedure requires the media state to
    3346  * be NotCreated and will return a faiulre otherwise.
     3360 * be NotCreated and will return a failure otherwise.
    33473361 *
    33483362 * @param aLocation Location of the storage unit. If the location is a FS-path,
     
    33683382                 E_FAIL);
    33693383
    3370     /* are we dealing with a new hard disk constructed using the existing
     3384    /* are we dealing with a new medium constructed using the existing
    33713385     * location? */
    33723386    bool isImport = m->format.isNull();
     
    34193433        if (RT_FAILURE(vrc))
    34203434            return setError(VBOX_E_FILE_ERROR,
    3421                             tr("Invalid hard disk storage file location '%s' (%Rrc)"),
     3435                            tr("Invalid medium storage file location '%s' (%Rrc)"),
    34223436                            location.raw(), vrc);
    34233437
     
    34493463                if (vrc == VERR_FILE_NOT_FOUND || vrc == VERR_PATH_NOT_FOUND)
    34503464                    return setError(VBOX_E_FILE_ERROR,
    3451                                     tr("Could not find file for the hard disk '%s' (%Rrc)"),
     3465                                    tr("Could not find file for the medium '%s' (%Rrc)"),
    34523466                                    locationFull.raw(), vrc);
    34533467                else if (aFormat.isEmpty())
    34543468                    return setError(VBOX_E_IPRT_ERROR,
    3455                                     tr("Could not get the storage format of the hard disk '%s' (%Rrc)"),
     3469                                    tr("Could not get the storage format of the medium '%s' (%Rrc)"),
    34563470                                    locationFull.raw(), vrc);
    34573471                else
     
    35923606        }
    35933607
    3594         /* are we dealing with a new hard disk constructed using the existing
     3608        /* are we dealing with a new medium constructed using the existing
    35953609         * location? */
    35963610        bool isImport = m->id.isEmpty();
     
    36053619
    36063620            /* Note that we don't use VD_OPEN_FLAGS_READONLY when opening new
    3607              * hard disks because that would prevent necessary modifications
    3608              * when opening hard disks of some third-party formats for the first
     3621             * media because that would prevent necessary modifications
     3622             * when opening media of some third-party formats for the first
    36093623             * time in VirtualBox (such as VMDK for which VDOpen() needs to
    36103624             * generate an UUID if it is missing) */
     
    36233637            if (RT_FAILURE(vrc))
    36243638            {
    3625                 lastAccessError = Utf8StrFmt(tr("Could not open the hard disk '%ls'%s"),
     3639                lastAccessError = Utf8StrFmt(tr("Could not open the medium '%ls'%s"),
    36263640                                             m->locationFull.raw(), vdError(vrc).raw());
    36273641                throw S_OK;
     
    36673681                    {
    36683682                        lastAccessError = Utf8StrFmt(
    3669                             tr("UUID {%RTuuid} of the hard disk '%ls' does not match the value {%RTuuid} stored in the media registry ('%ls')"),
     3683                            tr("UUID {%RTuuid} of the medium '%ls' does not match the value {%RTuuid} stored in the media registry ('%ls')"),
    36703684                            &uuid, m->locationFull.raw(), m->id.raw(),
    36713685                            mVirtualBox->settingsFilePath().raw());
     
    36793693                 * underlying storage so use what we store in XML */
    36803694
    3681                 /* generate an UUID for an imported UUID-less hard disk */
     3695                /* generate an UUID for an imported UUID-less medium */
    36823696                if (isImport)
    36833697                {
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r23801 r23823  
    84778477  <interface
    84788478    name="IMedium" extends="$unknown"
    8479     uuid="62551115-83b8-4d20-925f-79e9d3c00f96"
     8479    uuid="ad3cdc5b-28ce-4390-8273-ca2068a217c5"
    84808480    wsmap="managed"
    84818481  >
     
    89198919        given type and format.
    89208920      </desc>
     8921    </attribute>
     8922
     8923    <attribute name="deviceType" type="DeviceType" readonly="yes">
     8924      <desc>Kind of device (DVD/Floppy/HardDisk) which is applicable to this
     8925        medium.</desc>
    89218926    </attribute>
    89228927
  • trunk/src/VBox/Main/include/MediumImpl.h

    r23591 r23823  
    105105    STDMETHOD(COMSETTER(Location))(IN_BSTR aLocation);
    106106    STDMETHOD(COMGETTER(Name))(BSTR *aName);
     107    STDMETHOD(COMGETTER(DeviceType))(DeviceType_T *aDeviceType);
    107108    STDMETHOD(COMGETTER(HostDrive))(BOOL *aHostDrive);
    108109    STDMETHOD(COMGETTER(Size))(ULONG64 *aSize);
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