VirtualBox

Changeset 31241 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 30, 2010 12:50:58 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64255
Message:

Removed use of interface version for IGuest::getAdditionsVersion, some cleanup.

Location:
trunk/src/VBox
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/Helper.cpp

    r30758 r31241  
    204204    if (RT_SUCCESS(rc))
    205205    {
    206         pReq->guestInfo.additionsVersion = VMMDEV_VERSION;
     206        pReq->guestInfo.interfaceVersion = VMMDEV_VERSION;
    207207
    208208        /* we've already determined the Windows product before */
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r30780 r31241  
    270270    if (RT_SUCCESS(rc))
    271271    {
    272         pReq->guestInfo.additionsVersion = VMMDEV_VERSION;
     272        pReq->guestInfo.interfaceVersion = VMMDEV_VERSION;
    273273        pReq->guestInfo.osType = enmOSType;
    274274        rc = VbglGRPerform(&pReq->header);
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r30857 r31241  
    5959#define VMMDEVSTATE_2_DEVINS(pVMMDevState)         ( (pVMMDevState)->pDevIns )
    6060
    61 #define VBOX_GUEST_ADDITIONS_VERSION_1_03(s) \
    62     (   RT_HIWORD((s)->guestInfo.additionsVersion) == 1 \
    63      && RT_LOWORD((s)->guestInfo.additionsVersion) == 3 )
    64 
    65 #define VBOX_GUEST_ADDITIONS_VERSION_OK(additionsVersion) \
     61#define VBOX_GUEST_INTERFACE_VERSION_1_03(s) \
     62    (   RT_HIWORD((s)->guestInfo.interfaceVersion) == 1 \
     63     && RT_LOWORD((s)->guestInfo.interfaceVersion) == 3 )
     64
     65#define VBOX_GUEST_INTERFACE_VERSION_OK(additionsVersion) \
    6666      (   RT_HIWORD(additionsVersion) == RT_HIWORD(VMMDEV_VERSION) \
    6767       && RT_LOWORD(additionsVersion) <= RT_LOWORD(VMMDEV_VERSION) )
    6868
    69 #define VBOX_GUEST_ADDITIONS_VERSION_OLD(additionsVersion) \
     69#define VBOX_GUEST_INTERFACE_VERSION_OLD(additionsVersion) \
    7070      (   (RT_HIWORD(additionsVersion) < RT_HIWORD(VMMDEV_VERSION) \
    7171       || (   RT_HIWORD(additionsVersion) == RT_HIWORD(VMMDEV_VERSION) \
    7272           && RT_LOWORD(additionsVersion) <= RT_LOWORD(VMMDEV_VERSION) ) )
    7373
    74 #define VBOX_GUEST_ADDITIONS_VERSION_TOO_OLD(additionsVersion) \
     74#define VBOX_GUEST_INTERFACE_VERSION_TOO_OLD(additionsVersion) \
    7575      ( RT_HIWORD(additionsVersion) < RT_HIWORD(VMMDEV_VERSION) )
    7676
    77 #define VBOX_GUEST_ADDITIONS_VERSION_NEW(additionsVersion) \
     77#define VBOX_GUEST_INTERFACE_VERSION_NEW(additionsVersion) \
    7878      (   RT_HIWORD(additionsVersion) > RT_HIWORD(VMMDEV_VERSION) \
    7979       || (   RT_HIWORD(additionsVersion) == RT_HIWORD(VMMDEV_VERSION) \
     
    185185    Log3(("VMMDevNotifyGuest_EMT: u32EventMask = 0x%08X.\n", u32EventMask));
    186186
    187     if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (pVMMDevState))
     187    if (VBOX_GUEST_INTERFACE_VERSION_1_03 (pVMMDevState))
    188188    {
    189189        Log3(("VMMDevNotifyGuest_EMT: Old additions detected.\n"));
     
    487487
    488488                    /* Check additions version */
    489                     pThis->fu32AdditionsOk = VBOX_GUEST_ADDITIONS_VERSION_OK(pThis->guestInfo.additionsVersion);
     489                    pThis->fu32AdditionsOk = VBOX_GUEST_INTERFACE_VERSION_OK(pThis->guestInfo.interfaceVersion);
    490490
    491491                    LogRel(("Guest Additions information report: Interface = 0x%08X osType = 0x%08X\n",
    492                             pThis->guestInfo.additionsVersion,
     492                            pThis->guestInfo.interfaceVersion,
    493493                            pThis->guestInfo.osType));
    494494                    pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo);
     
    516516            else
    517517            {
    518                 VBoxGuestInfo2 *guestInfo2 = &((VMMDevReportGuestInfo2*)pRequestHeader)->guestInfo;
     518                VBoxGuestInfo2 *pGuestInfo2 = &((VMMDevReportGuestInfo2*)pRequestHeader)->guestInfo;
     519                AssertPtr(pGuestInfo2);
    519520                LogRel(("Guest Additions information report: Version %d.%d.%d r%d '%.*s'\n",
    520                         guestInfo2->additionsMajor, guestInfo2->additionsMinor, guestInfo2->additionsBuild,
    521                         guestInfo2->additionsRevision, sizeof(guestInfo2->szName), guestInfo2->szName));
     521                        pGuestInfo2->additionsMajor, pGuestInfo2->additionsMinor, pGuestInfo2->additionsBuild,
     522                        pGuestInfo2->additionsRevision, sizeof(pGuestInfo2->szName), pGuestInfo2->szName));
     523                pThis->pDrv->pfnUpdateGuestInfo2(pThis->pDrv, pGuestInfo2);
    522524                pRequestHeader->rc = VINF_SUCCESS;
    523525            }
     
    11231125            else
    11241126            {
    1125                 if (VBOX_GUEST_ADDITIONS_VERSION_1_03 (pThis))
     1127                if (VBOX_GUEST_INTERFACE_VERSION_1_03 (pThis))
    11261128                {
    11271129                    vmmdevSetIRQ_Legacy_EMT (pThis);
     
    26032605    {
    26042606        LogRel(("Guest Additions information report: additionsVersion = 0x%08X, osType = 0x%08X\n",
    2605                 pThis->guestInfo.additionsVersion,
     2607                pThis->guestInfo.interfaceVersion,
    26062608                pThis->guestInfo.osType));
    26072609        if (pThis->pDrv)
     
    26922694    /* Reset means that additions will report again. */
    26932695    const bool fVersionChanged = pThis->fu32AdditionsOk
    2694                               || pThis->guestInfo.additionsVersion
     2696                              || pThis->guestInfo.interfaceVersion
    26952697                              || pThis->guestInfo.osType != VBOXOSTYPE_Unknown;
    26962698    if (fVersionChanged)
    26972699        Log(("vmmdevReset: fu32AdditionsOk=%d additionsVersion=%x osType=%#x\n",
    2698              pThis->fu32AdditionsOk, pThis->guestInfo.additionsVersion, pThis->guestInfo.osType));
     2700             pThis->fu32AdditionsOk, pThis->guestInfo.interfaceVersion, pThis->guestInfo.osType));
    26992701    pThis->fu32AdditionsOk = false;
    27002702    memset (&pThis->guestInfo, 0, sizeof (pThis->guestInfo));
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp

    r31219 r31241  
    467467            VBoxGlobal::tr ("Enabled", "details report (Nested Paging)") :
    468468            VBoxGlobal::tr ("Disabled", "details report (Nested Paging)");
    469         QString addVersion = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Version");
    470         QString addRevision = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Revision");
    471         QString addVersionStr;
    472         if (!addVersion.isEmpty() && !addRevision.isEmpty())
    473         {
    474             QString addInfo = console.GetGuest().GetAdditionsVersion();
    475             addVersionStr = (addInfo.isEmpty() ? "(" : "")
    476                           + addVersion
    477                           + " r"
    478                           + m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Revision")
    479                           + (addInfo.isEmpty() ? ")" : "");
    480         }
    481         else
     469        QString addVersionStr = console.GetGuest().GetAdditionsVersion();
     470        if (addVersionStr.isEmpty())
    482471            addVersionStr = tr ("Not Detected", "guest additions");
    483472        QString osType = console.GetGuest().GetOSTypeId();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r31219 r31241  
    825825    sltCheckRequestedModes();
    826826
    827     /* Check the GA version only in case of additions are active: */
    828     if (!fIsAdditionsActive)
    829         return;
    830     /* Check the Guest Additions version and warn the user about possible compatibility issues in case if the installed version is outdated. */
    831     CGuest guest = session().GetConsole().GetGuest();
    832     QString strVersion = guest.GetAdditionsVersion();
    833     uint uVersion = strVersion.toUInt();
    834     /** @todo r=bird: This isn't want we want! We want the VirtualBox version of the additions, all three numbers. See @bugref{4084}.*/
    835     QString strRealVersion = QString("%1.%2").arg(RT_HIWORD(uVersion)).arg(RT_LOWORD(uVersion));
    836     QString strExpectedVersion = QString("%1.%2").arg(VMMDEV_VERSION_MAJOR).arg(VMMDEV_VERSION_MINOR);
    837     if (RT_HIWORD(uVersion) < VMMDEV_VERSION_MAJOR)
    838     {
    839         vboxProblem().warnAboutTooOldAdditions(0, strRealVersion, strExpectedVersion);
    840     }
    841     else if (RT_HIWORD(uVersion) == VMMDEV_VERSION_MAJOR && RT_LOWORD(uVersion) <  VMMDEV_VERSION_MINOR)
    842     {
    843         vboxProblem().warnAboutOldAdditions(0, strRealVersion, strExpectedVersion);
    844     }
    845     else if (uVersion > VMMDEV_VERSION)
    846     {
    847         vboxProblem().warnAboutNewAdditions(0, strRealVersion, strExpectedVersion);
    848     }
     827    /* A check whether the installed Guest Additions on the guest are up-to-date is now
     828     * performed by the Guest Additions itself (via VBoxTray/VBoxClient), so no need to
     829     * do something here anymore. */
    849830}
    850831
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r31220 r31241  
    46714671/**
    46724672 * @note Locks this object for reading.
     4673 *       This notification only is for reporting an incompatible
     4674 *       Guest Additions interface, *not* the Guest Additions version!
     4675 *
     4676 *       The user will be notified inside the guest if new Guest
     4677 *       Additions are available (via VBoxTray/VBoxClient).
    46734678 */
    46744679void Console::onAdditionsOutdated()
     
    46784683
    46794684    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    4680 
    4681     /** @todo Use the On-Screen Display feature to report the fact.
    4682      * The user should be told to install additions that are
    4683      * provided with the current VBox build:
    4684      * VBOX_VERSION_MAJOR.VBOX_VERSION_MINOR.VBOX_VERSION_BUILD
    4685      */
    46864685}
    46874686
  • trunk/src/VBox/Main/GuestImpl.cpp

    r31219 r31241  
    14411441/**
    14421442 * Sets the general Guest Additions information like
    1443  * API version and OS type.
     1443 * API (interface) version and OS type.
    14441444 *
    1445  * @param aVersion
     1445 * @param aInterfaceVersion
    14461446 * @param aOsType
    14471447 */
    1448 void Guest::setAdditionsInfo(Bstr aVersion, VBOXOSTYPE aOsType)
     1448void Guest::setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType)
    14491449{
    14501450    AutoCaller autoCaller(this);
     
    14541454
    14551455    /*
    1456      * Set the Guest Additions API (interface) version.
    1457      * Note that this is *not* the actual Guest Additions version and may differ!
     1456     * Note: The Guest Additions API (interface) version is deprecated
     1457     * and will not be used anymore!
    14581458     */
    1459     mData.mAdditionsVersion = aVersion;
     1459
    14601460    /*
    14611461     * Older Additions rely on the Additions API version whether they
     
    14631463     * this immediately.
    14641464     */
    1465     mData.mAdditionsActive = !aVersion.isEmpty();
     1465    mData.mAdditionsActive = !aInterfaceVersion.isEmpty();
    14661466    /*
    14671467     * Older Additions didn't have this finer grained capability bit,
     
    14781478
    14791479    mData.mOSTypeId = Global::OSTypeId (aOsType);
     1480}
     1481
     1482/**
     1483 * Sets the Guest Additions version information details.
     1484 *
     1485 * @param aAdditionsVersion
     1486 * @param aVersionName
     1487 */
     1488void Guest::setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName)
     1489{
     1490    AutoCaller autoCaller(this);
     1491    AssertComRCReturnVoid (autoCaller.rc());
     1492
     1493    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     1494
     1495    mData.mAdditionsVersion = aAdditionsVersion;
    14801496}
    14811497
     
    14871503 * @param ulFlags
    14881504 */
    1489 void Guest::setAdditionsStatus (VBoxGuestStatusFacility Facility, VBoxGuestStatusCurrent Status, ULONG ulFlags)
     1505void Guest::setAdditionsStatus(VBoxGuestStatusFacility Facility, VBoxGuestStatusCurrent Status, ULONG ulFlags)
    14901506{
    14911507    AutoCaller autoCaller(this);
     
    15071523 * @param ulActive
    15081524 */
    1509 void Guest::setSupportedFeatures (ULONG64 ulCaps, ULONG64 ulActive)
     1525void Guest::setSupportedFeatures(ULONG64 ulCaps, ULONG64 ulActive)
    15101526{
    15111527    AutoCaller autoCaller(this);
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r31024 r31241  
    189189 *
    190190 * @param   pInterface          Pointer to this interface.
    191  * @param   guestInfo           Pointer to guest information structure
     191 * @param   guestInfo           Pointer to guest information structure.
    192192 * @thread  The emulation thread.
    193193 */
     
    200200        return;
    201201
    202     /* Store that information in IGuest */
     202    /* Store that information in IGuest. */
    203203    Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
    204204    Assert(guest);
     
    206206        return;
    207207
    208     if (guestInfo->additionsVersion != 0)
    209     {
    210         char version[20];
    211         RTStrPrintf(version, sizeof(version), "%d", guestInfo->additionsVersion);
     208    if (guestInfo->interfaceVersion != 0)
     209    {
     210        char version[16];
     211        RTStrPrintf(version, sizeof(version), "%d", guestInfo->interfaceVersion);
    212212        guest->setAdditionsInfo(Bstr(version), guestInfo->osType);
    213213
     
    218218        pDrv->pVMMDev->getParent()->onAdditionsStateChange();
    219219
    220         if (guestInfo->additionsVersion < VMMDEV_VERSION)
     220        if (guestInfo->interfaceVersion < VMMDEV_VERSION)
    221221            pDrv->pVMMDev->getParent()->onAdditionsOutdated();
    222222    }
     
    227227         * or driver unload.
    228228         */
    229         guest->setAdditionsInfo(Bstr(), guestInfo->osType);
     229        guest->setAdditionsInfo(Bstr(), guestInfo->osType); /* Clear interface version + OS type. */
     230        guest->setAdditionsInfo2(Bstr(), Bstr()); /* Clear Guest Additions version. */
    230231        guest->setAdditionsStatus(VBoxGuestStatusFacility_Unknown,
    231232                                  VBoxGuestStatusCurrent_Disabled,
    232233                                  0); /* Flags; not used. */
     234        pDrv->pVMMDev->getParent()->onAdditionsStateChange();
     235    }
     236}
     237
     238/**
     239 * Reports the detailed Guest Additions version.
     240 * Called whenever the Additions issue a guest version report request or the VM is reset.
     241 *
     242 * @param   pInterface          Pointer to this interface.
     243 * @param   guestInfo           Pointer to Guest Additions information structure.
     244 * @thread  The emulation thread.
     245 */
     246DECLCALLBACK(void) vmmdevUpdateGuestInfo2(PPDMIVMMDEVCONNECTOR pInterface, const VBoxGuestInfo2 *guestInfo)
     247{
     248    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
     249
     250    Assert(guestInfo);
     251    if (!guestInfo)
     252        return;
     253
     254    /* Store that information in IGuest. */
     255    Guest* guest = pDrv->pVMMDev->getParent()->getGuest();
     256    Assert(guest);
     257    if (!guest)
     258        return;
     259
     260    if (   guestInfo->additionsMajor    != 0
     261        && guestInfo->additionsRevision != 0)
     262    {
     263        char version[32];
     264        RTStrPrintf(version, sizeof(version), "%d.%d.%dr%ld", guestInfo->additionsMajor,
     265                                                              guestInfo->additionsMinor,
     266                                                              guestInfo->additionsBuild,
     267                                                              guestInfo->additionsRevision);
     268        guest->setAdditionsInfo2(Bstr(version), Bstr(guestInfo->szName));
     269
     270        /*
     271         * Tell the console interface about the event
     272         * so that it can notify its consumers.
     273         */
     274        pDrv->pVMMDev->getParent()->onAdditionsStateChange();
     275    }
     276    else
     277    {
     278        /*
     279         * The guest additions was disabled because of a reset
     280         * or driver unload.
     281         */
     282        guest->setAdditionsInfo2(Bstr(), Bstr());
    233283        pDrv->pVMMDev->getParent()->onAdditionsStateChange();
    234284    }
     
    796846    pData->Connector.pfnUpdateGuestStatus             = vmmdevUpdateGuestStatus;
    797847    pData->Connector.pfnUpdateGuestInfo               = vmmdevUpdateGuestInfo;
     848    pData->Connector.pfnUpdateGuestInfo2              = vmmdevUpdateGuestInfo2;
    798849    pData->Connector.pfnUpdateGuestCapabilities       = vmmdevUpdateGuestCapabilities;
    799850    pData->Connector.pfnUpdateMouseCapabilities       = vmmdevUpdateMouseCapabilities;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r31227 r31241  
    77727772    <attribute name="additionsVersion" type="wstring" readonly="yes">
    77737773      <desc>
    7774         Version of the Guest Additions (3 decimal numbers separated
    7775         by dots) or empty when the Additions are not installed. The
    7776         Additions may also report a version but yet not be active as
    7777         the version might be refused by VirtualBox (incompatible) or
    7778         other failures occurred.
     7774        Version of the Guest Additions including the revision (3 decimal numbers
     7775        separated by dots + revision number) installed on the guest or empty
     7776        when the Additions are not installed.
    77797777      </desc>
    77807778    </attribute>
  • trunk/src/VBox/Main/include/GuestImpl.h

    r31219 r31241  
    8080#endif
    8181    STDMETHOD(COMGETTER(AdditionsActive)) (BOOL *aAdditionsActive);
    82 #if 0
    83     /** @todo Will replace AdditionsVersion to be more clear. */
    84     STDMETHOD(COMGETTER(AdditionsAPIVersion)) (BSTR *aAdditionsVersion);
    85 #endif
    8682    STDMETHOD(COMGETTER(AdditionsVersion)) (BSTR *aAdditionsVersion);
    87     /** @todo Remove */
     83    /** @todo Remove later by replacing it by AdditionsFeatureAvailable(). */
    8884    STDMETHOD(COMGETTER(SupportsSeamless)) (BOOL *aSupportsSeamless);
    8985    STDMETHOD(COMGETTER(SupportsGraphics)) (BOOL *aSupportsGraphics);
     
    113109
    114110    // Public methods that are not in IDL (only called internally).
    115     void setAdditionsInfo(Bstr aVersion, VBOXOSTYPE aOsType);
     111    void setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType);
     112    void setAdditionsInfo2(Bstr aAdditionsVersion, Bstr aVersionName);
    116113    void setAdditionsStatus(VBoxGuestStatusFacility Facility, VBoxGuestStatusCurrent Status, ULONG ulFlags);
    117114    void setSupportedFeatures(ULONG64 ulCaps, ULONG64 ulActive);
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