VirtualBox

Changeset 132 in vbox


Ignore:
Timestamp:
Jan 18, 2007 12:35:35 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
17582
Message:

Main:

  • Prototyped IConsoleCallback::onRuntimeError();
  • All size parameters in IHardDisk are now ULONG64.

Frontends:

  • Updated according to the above.
Location:
trunk/src/VBox
Files:
11 edited

Legend:

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

    r1 r132  
    19601960    HRESULT rc;
    19611961    Bstr filename;
    1962     size_t sizeMB = 0;
     1962    uint64_t sizeMB = 0;
    19631963    bool fStatic = false;
    19641964    Bstr comment;
     
    19851985            }
    19861986            i++;
    1987             sizeMB = atoi(argv[i]);
     1987            sizeMB = RTStrToUInt64(argv[i]);
    19881988        }
    19891989        else if (strcmp(argv[i], "-static") == 0)
     
    44344434        }
    44354435
    4436         ULONG size;
     4436        ULONG64 size;
    44374437        hardDisk->COMGETTER(Size)(&size);
    4438         RTPrintf("Size:                 %lu MBytes\n", size);
     4438        RTPrintf("Size:                 %llu MBytes\n", size);
    44394439        ULONG64 actualSize;
    44404440        hardDisk->COMGETTER(ActualSize)(&actualSize);
    4441         RTPrintf("Current size on disk: %lu MBytes\n", actualSize >> 20);
     4441        RTPrintf("Current size on disk: %llu MBytes\n", actualSize >> 20);
    44424442
    44434443        HardDiskType_T type;
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r1 r132  
    470470        gfGuestScrollLockPressed = fScrollLock;
    471471        gfGuestCapsLockPressed   = fCapsLock;
     472        return S_OK;
     473    }
     474
     475    STDMETHOD(OnRuntimeError)(BOOL fatal, INPTR BSTR id, INPTR BSTR message)
     476    {
    472477        return S_OK;
    473478    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r1 r132  
    267267        Q_UNUSED( fScrollLock );
    268268        Q_UNUSED( fCapsLock );
     269        return S_OK;
     270    }
     271
     272    STDMETHOD(OnRuntimeError)(BOOL fatal, IN_BSTRPARAM id, IN_BSTRPARAM message)
     273    {
    269274        return S_OK;
    270275    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r70 r132  
    585585        details = hardDiskTypeString (root);
    586586   
    587     details += ", " + formatSize ((unsigned long long) root.GetSize() * _1M);
     587    details += ", " + formatSize (root.GetSize() * _1M);
    588588   
    589589    return details;
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxDiskImageManagerDlg.ui.h

    r71 r132  
    970970    QString hardDiskType = vboxGlobal().hardDiskTypeString (aHd);
    971971    QString virtualSize = accessible ?
    972         vboxGlobal().formatSize ((ULONG64)aHd.GetSize() * _1M) : QString ("--");
     972        vboxGlobal().formatSize (aHd.GetSize() * _1M) : QString ("--");
    973973    QString actualSize = accessible ?
    974974        vboxGlobal().formatSize (aHd.GetActualSize()) : QString ("--");
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui

    r1 r132  
    637637    <variable access="private">CHardDisk chd;</variable>
    638638    <variable access="private">int sliderStep;</variable>
    639     <variable access="private">ULONG64 MaxVDISize;</variable>
    640     <variable access="private">ULONG64 currentSize;</variable>
     639    <variable access="private">Q_UINT64 MaxVDISize;</variable>
     640    <variable access="private">Q_UINT64 currentSize;</variable>
    641641</variables>
    642642<slots>
     
    652652    <function>setRecommendedSize( ulong aSize )</function>
    653653    <function returnType="QString">imageFileName()</function>
    654     <function returnType="ULONG64">imageSize()</function>
     654    <function returnType="Q_UINT64">imageSize()</function>
    655655    <function returnType="bool">isDynamicImage()</function>
    656656    <function returnType="CHardDisk">hardDisk() { return chd; }</function>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui.h

    r1 r132  
    223223
    224224
    225 ULONG64 VBoxNewHDWzd::imageSize()
     225Q_UINT64 VBoxNewHDWzd::imageSize()
    226226{
    227227    return currentSize;
     
    332332{
    333333    QString src = imageFileName();
    334     ulong size = imageSize();
     334    Q_UINT64 size = imageSize();
    335335
    336336    AssertReturn (!src.isEmpty(), false);
  • trunk/src/VBox/Main/HardDiskImpl.cpp

    r1 r132  
    13391339}
    13401340
    1341 STDMETHODIMP HVirtualDiskImage::COMGETTER(Size) (ULONG *aSize)
     1341STDMETHODIMP HVirtualDiskImage::COMGETTER(Size) (ULONG64 *aSize)
    13421342{
    13431343    if (!aSize)
     
    14271427/////////////////////////////////////////////////////////////////////////////
    14281428
    1429 STDMETHODIMP HVirtualDiskImage::CreateDynamicImage (ULONG aSize, IProgress **aProgress)
     1429STDMETHODIMP HVirtualDiskImage::CreateDynamicImage (ULONG64 aSize, IProgress **aProgress)
    14301430{
    14311431    if (!aProgress)
     
    14381438}
    14391439
    1440 STDMETHODIMP HVirtualDiskImage::CreateFixedImage (ULONG aSize, IProgress **aProgress)
     1440STDMETHODIMP HVirtualDiskImage::CreateFixedImage (ULONG64 aSize, IProgress **aProgress)
    14411441{
    14421442    if (!aProgress)
     
    22452245                uint64_t size = VDIDiskGetSize (disk);
    22462246                /* convert to MBytes */
    2247                 mSize = (ULONG) (size / 1024 / 1024);
     2247                mSize = size / 1024 / 1024;
    22482248            }
    22492249
     
    22852285 *  @param aProgress    address of IProgress pointer to return
    22862286 */
    2287 HRESULT HVirtualDiskImage::createImage (ULONG aSize, BOOL aDynamic,
    2288                                        IProgress **aProgress)
     2287HRESULT HVirtualDiskImage::createImage (ULONG64 aSize, BOOL aDynamic,
     2288                                        IProgress **aProgress)
    22892289{
    22902290    AutoLock alock (this);
     
    23532353        if (aSize < 1 || aSize > maxVDISize)
    23542354            return setError (E_INVALIDARG,
    2355                 tr ("Invalid VDI size %ul MB (must be in range [1, %Lu] MB)"),
     2355                tr ("Invalid VDI size: %llu MB (must be in range [1, %llu] MB)"),
    23562356                aSize, maxVDISize);
    23572357    }
     
    26822682}
    26832683
    2684 STDMETHODIMP HISCSIHardDisk::COMGETTER(Size) (ULONG *aSize)
     2684STDMETHODIMP HISCSIHardDisk::COMGETTER(Size) (ULONG64 *aSize)
    26852685{
    26862686    if (!aSize)
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r1 r132  
    24262426        </method>
    24272427
     2428        <method name="onRuntimeError">
     2429            <desc>
     2430                Notification when an error happens during the virtual
     2431                machine execution.
     2432               
     2433                There are three kinds of runtime errors:
     2434                <ul>
     2435                    <li><i>fatal</i></li>
     2436                    <li><i>non-fatal with retry</i></li>
     2437                    <li><i>non-fatal without retry</i></li>
     2438                </ul>
     2439               
     2440                <b>Fatal</b> errors are indicated by the @a fatal parameter set
     2441                to <tt>true</tt>. In case of fatal errors, the virtual machine
     2442                execution is always paused before calling this notification, and
     2443                the notification handler is supposed either to immediately save
     2444                the virtual machine state using <link to="IConsole::saveState()"/>
     2445                or power it off using <link to="IConsole::powerDown()"/>.
     2446                Resuming the execution can lead to unpredictable results.
     2447               
     2448                <b>Non-fatal</b> errors are indicated by the
     2449                @a fatal parameter set to <tt>false</tt>. If the virtual machine
     2450                is in the Paused state by the time the error notification is
     2451                received, it means that the user can retry the machine
     2452                execution after attempting to solve the probem that caused the
     2453                error. In this case, the notification handler is supposed
     2454                to show an appropriate message to the user (depending on the
     2455                value of the @a id parameter) that offers several actions such
     2456                as <i>Retry</i>, <i>Save</i> or <i>Power Off</i>. If the user
     2457                wants to retry, the notification handler should continue
     2458                the machine execution using the <link to="IConsole::resume()"/>
     2459                call. If the machine execution is not Paused during this
     2460                notification, then it means this notification is a warning (for
     2461                example, about a fatal condition that can happen very soon); no
     2462                any immediate action is required from the user, the machine
     2463                continues its normal execution.
     2464
     2465                Note that in either case the notification handler
     2466                <b>must not</b> perform any action directly on a thread
     2467                where this notification is called. Everything it is allowed to
     2468                do is to post a message to another thread that will then talk
     2469                to the user and take the corresponding action.
     2470               
     2471                Currently, the following error identificators are known:
     2472                <ul>
     2473                <li>"HostMemoryLow"</li>
     2474                <li>"HostAudioNotResponding"</li>
     2475                <li>"VDIStorageFull"</li>
     2476                </ul>
     2477
     2478                <note>
     2479                    This notification is not designed to be implemented by more
     2480                    than one callback at a time. If you have multiple
     2481                    IConsoleCallback instances registered on the given
     2482                    IConsole object, make sure you just return S_OK from all but
     2483                    one of them that does actual user notification and performs
     2484                    necessary actions.
     2485                </note>
     2486
     2487            </desc>
     2488            <param name="fatal" type="boolean" dir="in">
     2489                <desc>Whether the error is fatal or not</desc>
     2490            </param>
     2491            <param name="id" type="wstring" dir="in">
     2492                <desc>Error identificator</desc>
     2493            </param>
     2494            <param name="message" type="wstring" dir="in">
     2495                <desc>Optional error message</desc>
     2496            </param>
     2497        </method>
     2498
    24282499    </interface>
    24292500
     
    44964567        </attribute>
    44974568
    4498         <attribute name="size" type="unsigned long" readonly="yes">
     4569        <attribute name="size" type="unsigned long long" readonly="yes">
    44994570            <desc>
    45004571
     
    46904761            </desc>
    46914762
    4692             <param name="size" type="unsigned long" dir="in">
     4763            <param name="size" type="unsigned long long" dir="in">
    46934764                <desc>Maximum logical size of the hard disk in megabytes.</desc>
    46944765            </param>
     
    47134784            </desc>
    47144785
    4715             <param name="size" type="unsigned long" dir="in">
     4786            <param name="size" type="unsigned long long" dir="in">
    47164787                <desc>Logical size of the hard disk in megabytes.</desc>
    47174788            </param>
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r1 r132  
    102102    }
    103103
     104    STDMETHOD(OnRuntimeError)(BOOL fatal, INPTR BSTR id, INPTR BSTR message)
     105    {
     106        return S_OK;
     107    }
     108
    104109    // IDisplay properties
    105110    STDMETHOD(COMGETTER(Width)) (ULONG *width);
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r1 r132  
    238238    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
    239239    STDMETHOD(COMSETTER(Description)) (INPTR BSTR aDescription);
    240     STDMETHOD(COMGETTER(Size)) (ULONG *aSize);
     240    STDMETHOD(COMGETTER(Size)) (ULONG64 *aSize);
    241241    STDMETHOD(COMGETTER(ActualSize)) (ULONG64 *aActualSize);
    242242
     
    247247
    248248    // IVirtualDiskImage methods
    249     STDMETHOD(CreateDynamicImage) (ULONG aSize, IProgress **aProgress);
    250     STDMETHOD(CreateFixedImage) (ULONG aSize, IProgress **aProgress);
     249    STDMETHOD(CreateDynamicImage) (ULONG64 aSize, IProgress **aProgress);
     250    STDMETHOD(CreateFixedImage) (ULONG64 aSize, IProgress **aProgress);
    251251    STDMETHOD(DeleteImage)();
    252252
     
    286286    HRESULT setFilePath (const BSTR aFilePath);
    287287    HRESULT queryInformation (Bstr *aAccessError);
    288     HRESULT createImage (ULONG aSize, BOOL aDynamic, IProgress **aProgress);
     288    HRESULT createImage (ULONG64 aSize, BOOL aDynamic, IProgress **aProgress);
    289289
    290290    /** VDI asynchronous operation thread function */
     
    302302    Bstr mDescription;
    303303
    304     ULONG mSize;
     304    ULONG64 mSize;
    305305    ULONG64 mActualSize;
    306306
     
    357357    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
    358358    STDMETHOD(COMSETTER(Description)) (INPTR BSTR aDescription);
    359     STDMETHOD(COMGETTER(Size)) (ULONG *aSize);
     359    STDMETHOD(COMGETTER(Size)) (ULONG64 *aSize);
    360360    STDMETHOD(COMGETTER(ActualSize)) (ULONG64 *aActualSize);
    361361
     
    406406    Bstr mDescription;
    407407
    408     ULONG mSize;
     408    ULONG64 mSize;
    409409    ULONG64 mActualSize;
    410410
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