VirtualBox

Changeset 27805 in vbox


Ignore:
Timestamp:
Mar 29, 2010 8:12:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59465
Message:

Main/SystemProperties: new stubs for properties defining minimum free disk space for safe operation

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

Legend:

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

    r27607 r27805  
    77
    88/*
    9  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6464void SystemProperties::FinalRelease()
    6565{
    66     uninit ();
     66    uninit();
    6767}
    6868
     
    7575 * @returns COM result indicator
    7676 */
    77 HRESULT SystemProperties::init (VirtualBox *aParent)
     77HRESULT SystemProperties::init(VirtualBox *aParent)
    7878{
    7979    LogFlowThisFunc(("aParent=%p\n", aParent));
     
    102102    /// any number of backends
    103103
    104     /// @todo We currently leak memory because it's not actually clear what to
    105     /// free in structures returned by VDBackendInfo. Must be fixed ASAP!
    106 
    107104    VDBACKENDINFO aVDInfo[100];
    108105    unsigned cEntries;
    109     int vrc = VDBackendInfo(RT_ELEMENTS (aVDInfo), aVDInfo, &cEntries);
     106    int vrc = VDBackendInfo(RT_ELEMENTS(aVDInfo), aVDInfo, &cEntries);
    110107    AssertRC(vrc);
    111108    if (RT_SUCCESS(vrc))
     
    125122
    126123    /* Driver defaults which are OS specific */
    127 #if defined (RT_OS_WINDOWS)
     124#if defined(RT_OS_WINDOWS)
    128125# ifdef VBOX_WITH_WINMM
    129126    mDefaultAudioDriver = AudioDriverType_WinMM;
     
    131128    mDefaultAudioDriver = AudioDriverType_DirectSound;
    132129# endif /* !VBOX_WITH_WINMM */
    133 #elif defined (RT_OS_SOLARIS)
     130#elif defined(RT_OS_SOLARIS)
    134131    mDefaultAudioDriver = AudioDriverType_SolAudio;
    135 #elif defined (RT_OS_LINUX)
    136 # if defined (VBOX_WITH_PULSE)
     132#elif defined(RT_OS_LINUX)
     133# if defined(VBOX_WITH_PULSE)
    137134    /* Check for the pulse library & that the pulse audio daemon is running. */
    138     if (RTProcIsRunningByName ("pulseaudio") &&
    139         RTLdrIsLoadable ("libpulse.so.0"))
     135    if (RTProcIsRunningByName("pulseaudio") &&
     136        RTLdrIsLoadable("libpulse.so.0"))
    140137        mDefaultAudioDriver = AudioDriverType_Pulse;
    141138    else
    142139# endif /* VBOX_WITH_PULSE */
    143 # if defined (VBOX_WITH_ALSA)
     140# if defined(VBOX_WITH_ALSA)
    144141        /* Check if we can load the ALSA library */
    145         if (RTLdrIsLoadable ("libasound.so.2"))
     142        if (RTLdrIsLoadable("libasound.so.2"))
    146143            mDefaultAudioDriver = AudioDriverType_ALSA;
    147144        else
    148145# endif /* VBOX_WITH_ALSA */
    149146            mDefaultAudioDriver = AudioDriverType_OSS;
    150 #elif defined (RT_OS_DARWIN)
     147#elif defined(RT_OS_DARWIN)
    151148    mDefaultAudioDriver = AudioDriverType_CoreAudio;
    152 #elif defined (RT_OS_OS2)
     149#elif defined(RT_OS_OS2)
    153150    mDefaultAudioDriver = AudioDriverType_MMP;
    154 #elif defined (RT_OS_FREEBSD)
     151#elif defined(RT_OS_FREEBSD)
    155152    mDefaultAudioDriver = AudioDriverType_OSS;
    156153#else
     
    187184STDMETHODIMP SystemProperties::COMGETTER(MinGuestRAM)(ULONG *minRAM)
    188185{
    189     if (!minRAM)
    190         return E_POINTER;
     186    CheckComArgOutPointerValid(minRAM);
    191187
    192188    AutoCaller autoCaller(this);
     
    202198STDMETHODIMP SystemProperties::COMGETTER(MaxGuestRAM)(ULONG *maxRAM)
    203199{
    204     if (!maxRAM)
    205         return E_POINTER;
     200    CheckComArgOutPointerValid(maxRAM);
    206201
    207202    AutoCaller autoCaller(this);
     
    226221STDMETHODIMP SystemProperties::COMGETTER(MinGuestVRAM)(ULONG *minVRAM)
    227222{
    228     if (!minVRAM)
    229         return E_POINTER;
     223    CheckComArgOutPointerValid(minVRAM);
    230224
    231225    AutoCaller autoCaller(this);
     
    240234STDMETHODIMP SystemProperties::COMGETTER(MaxGuestVRAM)(ULONG *maxVRAM)
    241235{
    242     if (!maxVRAM)
    243         return E_POINTER;
     236    CheckComArgOutPointerValid(maxVRAM);
    244237
    245238    AutoCaller autoCaller(this);
     
    254247STDMETHODIMP SystemProperties::COMGETTER(MinGuestCPUCount)(ULONG *minCPUCount)
    255248{
    256     if (!minCPUCount)
    257         return E_POINTER;
     249    CheckComArgOutPointerValid(minCPUCount);
    258250
    259251    AutoCaller autoCaller(this);
     
    268260STDMETHODIMP SystemProperties::COMGETTER(MaxGuestCPUCount)(ULONG *maxCPUCount)
    269261{
    270     if (!maxCPUCount)
    271         return E_POINTER;
     262    CheckComArgOutPointerValid(maxCPUCount);
    272263
    273264    AutoCaller autoCaller(this);
     
    282273STDMETHODIMP SystemProperties::COMGETTER(MaxGuestMonitors)(ULONG *maxMonitors)
    283274{
    284     if (!maxMonitors)
    285         return E_POINTER;
     275    CheckComArgOutPointerValid(maxMonitors);
    286276
    287277    AutoCaller autoCaller(this);
     
    296286STDMETHODIMP SystemProperties::COMGETTER(MaxVDISize)(ULONG64 *maxVDISize)
    297287{
    298     if (!maxVDISize)
    299         return E_POINTER;
     288    CheckComArgOutPointerValid(maxVDISize);
    300289
    301290    AutoCaller autoCaller(this);
     
    319308STDMETHODIMP SystemProperties::COMGETTER(NetworkAdapterCount)(ULONG *count)
    320309{
    321     if (!count)
    322         return E_POINTER;
     310    CheckComArgOutPointerValid(count);
    323311
    324312    AutoCaller autoCaller(this);
     
    333321STDMETHODIMP SystemProperties::COMGETTER(SerialPortCount)(ULONG *count)
    334322{
    335     if (!count)
    336         return E_POINTER;
     323    CheckComArgOutPointerValid(count);
    337324
    338325    AutoCaller autoCaller(this);
     
    347334STDMETHODIMP SystemProperties::COMGETTER(ParallelPortCount)(ULONG *count)
    348335{
    349     if (!count)
    350         return E_POINTER;
     336    CheckComArgOutPointerValid(count);
    351337
    352338    AutoCaller autoCaller(this);
     
    372358}
    373359
    374 STDMETHODIMP SystemProperties::GetMaxDevicesPerPortForStorageBus (StorageBus_T aBus, ULONG *aMaxDevicesPerPort)
     360STDMETHODIMP SystemProperties::GetMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
     361                                                                 ULONG *aMaxDevicesPerPort)
    375362{
    376363    CheckComArgOutPointerValid(aMaxDevicesPerPort);
     
    405392}
    406393
    407 STDMETHODIMP SystemProperties::GetMinPortCountForStorageBus (StorageBus_T aBus, ULONG *aMinPortCount)
     394STDMETHODIMP SystemProperties::GetMinPortCountForStorageBus(StorageBus_T aBus,
     395                                                            ULONG *aMinPortCount)
    408396{
    409397    CheckComArgOutPointerValid(aMinPortCount);
     
    447435}
    448436
    449 STDMETHODIMP SystemProperties::GetMaxPortCountForStorageBus (StorageBus_T aBus, ULONG *aMaxPortCount)
     437STDMETHODIMP SystemProperties::GetMaxPortCountForStorageBus(StorageBus_T aBus,
     438                                                            ULONG *aMaxPortCount)
    450439{
    451440    CheckComArgOutPointerValid(aMaxPortCount);
     
    489478}
    490479
    491 STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(StorageBus_T aBus, ULONG *aMaxInstances)
     480STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(StorageBus_T aBus,
     481                                                           ULONG *aMaxInstances)
    492482{
    493483    CheckComArgOutPointerValid(aMaxInstances);
     
    517507
    518508STDMETHODIMP SystemProperties::GetDeviceTypesForStorageBus(StorageBus_T aBus,
    519                                  ComSafeArrayOut(DeviceType_T, aDeviceTypes))
     509                                                           ComSafeArrayOut(DeviceType_T, aDeviceTypes))
    520510{
    521511    CheckComArgOutSafeArrayPointerValid(aDeviceTypes);
     
    558548}
    559549
    560 STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder) (BSTR *aDefaultMachineFolder)
     550STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder)(BSTR *aDefaultMachineFolder)
    561551{
    562552    CheckComArgOutPointerValid(aDefaultMachineFolder);
     
    572562}
    573563
    574 STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder) (IN_BSTR aDefaultMachineFolder)
     564STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder)(IN_BSTR aDefaultMachineFolder)
    575565{
    576566    AutoCaller autoCaller(this);
     
    580570    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    581571
    582     HRESULT rc = setDefaultMachineFolder (aDefaultMachineFolder);
     572    HRESULT rc = setDefaultMachineFolder(aDefaultMachineFolder);
    583573    if (SUCCEEDED(rc))
    584574        rc = mParent->saveSettings();
     
    587577}
    588578
    589 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFolder) (BSTR *aDefaultHardDiskFolder)
     579STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFolder)(BSTR *aDefaultHardDiskFolder)
    590580{
    591581    CheckComArgOutPointerValid(aDefaultHardDiskFolder);
     
    601591}
    602592
    603 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder) (IN_BSTR aDefaultHardDiskFolder)
     593STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder)(IN_BSTR aDefaultHardDiskFolder)
    604594{
    605595    AutoCaller autoCaller(this);
     
    609599    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    610600
    611     HRESULT rc = setDefaultHardDiskFolder (aDefaultHardDiskFolder);
     601    HRESULT rc = setDefaultHardDiskFolder(aDefaultHardDiskFolder);
    612602    if (SUCCEEDED(rc))
    613603        rc = mParent->saveSettings();
     
    616606}
    617607
    618 STDMETHODIMP SystemProperties::
    619 COMGETTER(MediumFormats) (ComSafeArrayOut(IMediumFormat *, aMediumFormats))
    620 {
    621     if (ComSafeArrayOutIsNull(aMediumFormats))
    622         return E_POINTER;
     608STDMETHODIMP SystemProperties::COMGETTER(MediumFormats)(ComSafeArrayOut(IMediumFormat *, aMediumFormats))
     609{
     610    CheckComArgOutSafeArrayPointerValid(aMediumFormats);
    623611
    624612    AutoCaller autoCaller(this);
     
    627615    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    628616
    629     SafeIfaceArray<IMediumFormat> mediumFormats (mMediumFormats);
     617    SafeIfaceArray<IMediumFormat> mediumFormats(mMediumFormats);
    630618    mediumFormats.detachTo(ComSafeArrayOutArg(aMediumFormats));
    631619
     
    633621}
    634622
    635 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat) (BSTR *aDefaultHardDiskFormat)
     623STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat)(BSTR *aDefaultHardDiskFormat)
    636624{
    637625    CheckComArgOutPointerValid(aDefaultHardDiskFormat);
     
    647635}
    648636
    649 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat) (IN_BSTR aDefaultHardDiskFormat)
     637STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat)(IN_BSTR aDefaultHardDiskFormat)
    650638{
    651639    AutoCaller autoCaller(this);
     
    655643    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    656644
    657     HRESULT rc = setDefaultHardDiskFormat (aDefaultHardDiskFormat);
     645    HRESULT rc = setDefaultHardDiskFormat(aDefaultHardDiskFormat);
    658646    if (SUCCEEDED(rc))
    659647        rc = mParent->saveSettings();
     
    662650}
    663651
    664 STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary) (BSTR *aRemoteDisplayAuthLibrary)
     652STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceWarning)(ULONG64 *aFreeSpace)
     653{
     654    CheckComArgOutPointerValid(aFreeSpace);
     655
     656    ReturnComNotImplemented();
     657}
     658
     659STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceWarning)(ULONG64 aFreeSpace)
     660{
     661    ReturnComNotImplemented();
     662}
     663
     664STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentWarning)(ULONG *aFreeSpacePercent)
     665{
     666    CheckComArgOutPointerValid(aFreeSpacePercent);
     667
     668    ReturnComNotImplemented();
     669}
     670
     671STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentWarning)(ULONG aFreeSpacePercent)
     672{
     673    ReturnComNotImplemented();
     674}
     675
     676STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceError)(ULONG64 *aFreeSpace)
     677{
     678    CheckComArgOutPointerValid(aFreeSpace);
     679
     680    ReturnComNotImplemented();
     681}
     682
     683STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceError)(ULONG64 aFreeSpace)
     684{
     685    ReturnComNotImplemented();
     686}
     687
     688STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentError)(ULONG *aFreeSpacePercent)
     689{
     690    CheckComArgOutPointerValid(aFreeSpacePercent);
     691
     692    ReturnComNotImplemented();
     693}
     694
     695STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentError)(ULONG aFreeSpacePercent)
     696{
     697    ReturnComNotImplemented();
     698}
     699
     700STDMETHODIMP SystemProperties::COMGETTER(RemoteDisplayAuthLibrary)(BSTR *aRemoteDisplayAuthLibrary)
    665701{
    666702    CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary);
     
    676712}
    677713
    678 STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (IN_BSTR aRemoteDisplayAuthLibrary)
     714STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary)(IN_BSTR aRemoteDisplayAuthLibrary)
    679715{
    680716    AutoCaller autoCaller(this);
     
    684720    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    685721
    686     HRESULT rc = setRemoteDisplayAuthLibrary (aRemoteDisplayAuthLibrary);
     722    HRESULT rc = setRemoteDisplayAuthLibrary(aRemoteDisplayAuthLibrary);
    687723    if (SUCCEEDED(rc))
    688724        rc = mParent->saveSettings();
     
    691727}
    692728
    693 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary) (BSTR *aWebServiceAuthLibrary)
     729STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary)(BSTR *aWebServiceAuthLibrary)
    694730{
    695731    CheckComArgOutPointerValid(aWebServiceAuthLibrary);
     
    705741}
    706742
    707 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary) (IN_BSTR aWebServiceAuthLibrary)
     743STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary)(IN_BSTR aWebServiceAuthLibrary)
    708744{
    709745    AutoCaller autoCaller(this);
     
    713749    AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS);
    714750
    715     HRESULT rc = setWebServiceAuthLibrary (aWebServiceAuthLibrary);
     751    HRESULT rc = setWebServiceAuthLibrary(aWebServiceAuthLibrary);
    716752    if (SUCCEEDED(rc))
    717753        rc = mParent->saveSettings();
     
    720756}
    721757
    722 STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount) (ULONG *count)
    723 {
    724     if (!count)
    725         return E_POINTER;
     758STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount)(ULONG *count)
     759{
     760    CheckComArgOutPointerValid(count);
    726761
    727762    AutoCaller autoCaller(this);
     
    735770}
    736771
    737 STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount) (ULONG count)
     772STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount)(ULONG count)
    738773{
    739774    AutoCaller autoCaller(this);
     
    750785}
    751786
    752 STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver) (AudioDriverType_T *aAudioDriver)
    753 {
    754     if (!aAudioDriver)
    755         return E_POINTER;
     787STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver)(AudioDriverType_T *aAudioDriver)
     788{
     789    CheckComArgOutPointerValid(aAudioDriver);
    756790
    757791    AutoCaller autoCaller(this);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r27792 r27805  
    13161316
    13171317  <interface
    1318      name="ILocalOwner" extends="$dispatched"
     1318     name="ILocalOwner" extends="$unknown"
    13191319     uuid="308FF42A-DC45-49D4-A950-B1EEE5E00BB5" wsmap="suppress"
    13201320     >
     
    16891689
    16901690  <interface
    1691     name="IVirtualBox" extends="$dispatched"
     1691    name="IVirtualBox" extends="$unknown"
    16921692    uuid="3f36e024-7fed-4f20-a02c-9158a82b44e6"
    16931693    wsmap="managed"
     
    80358035     name="ISystemProperties"
    80368036     extends="$unknown"
    8037      uuid="fca0d89c-d2ce-45c1-a7b9-e6e7d8501eb1"
     8037     uuid="07c3ffd8-8f59-49cc-b608-53a332e85cc3"
    80388038     wsmap="managed"
    80398039     >
     
    82418241        </see>
    82428242      </desc>
     8243    </attribute>
     8244
     8245    <attribute name="freeDiskSpaceWarning" type="unsigned long long">
     8246      <desc>Issue a warning if the free disk space is below (or in some disk
     8247      intensive operation is expected to go below) the given size in
     8248      Megabytes.</desc>
     8249    </attribute>
     8250
     8251    <attribute name="freeDiskSpacePercentWarning" type="unsigned long">
     8252      <desc>Issue a warning if the free disk space is below (or in some disk
     8253      intensive operation is expected to go below) the given percentage.</desc>
     8254    </attribute>
     8255
     8256    <attribute name="freeDiskSpaceError" type="unsigned long long">
     8257      <desc>Issue an error if the free disk space is below (or in some disk
     8258      intensive operation is expected to go below) the given size in
     8259      Megabytes.</desc>
     8260    </attribute>
     8261
     8262    <attribute name="freeDiskSpacePercentError" type="unsigned long">
     8263      <desc>Issue an error if the free disk space is below (or in some disk
     8264      intensive operation is expected to go below) the given percentage.</desc>
    82438265    </attribute>
    82448266
     
    1324613268
    1324713269  <interface
    13248      name="ISession" extends="$dispatched"
     13270     name="ISession" extends="$unknown"
    1324913271     uuid="12F4DCDB-12B2-4EC1-B7CD-DDD9F6C5BF4D"
    1325013272     wsmap="managed"
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r27607 r27805  
    77
    88/*
    9  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8686    STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFormat);
    8787    STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (IN_BSTR aDefaultHardDiskFormat);
     88    STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(ULONG64 *aFreeDiskSpace);
     89    STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(ULONG64 aFreeDiskSpace);
     90    STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent);
     91    STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent);
     92    STDMETHOD(COMGETTER(FreeDiskSpaceError))(ULONG64 *aFreeDiskSpace);
     93    STDMETHOD(COMSETTER(FreeDiskSpaceError))(ULONG64 aFreeDiskSpace);
     94    STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent);
     95    STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent);
    8896    STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary);
    8997    STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (IN_BSTR aRemoteDisplayAuthLibrary);
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