VirtualBox

Ignore:
Timestamp:
Aug 4, 2010 4:44:20 PM (15 years ago)
Author:
vboxsync
Message:

Some more fixes for Guest Additions version lookup/status; moved some duplicate helper function to VbglR0.

File:
1 edited

Legend:

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

    r31241 r31364  
    255255
    256256/**
    257  * Report guest information to the VMMDev.
    258  *
    259  * @returns VBox status code.
    260  * @param   pDevExt     The device extension.
    261  * @param   enmOSType   The OS type to report.
    262  */
    263 static int vboxGuestInitReportGuestInfo(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType)
    264 {
    265     /*
    266      * Report general info + capabilities to host.
    267      */
    268     VMMDevReportGuestInfo *pReq;
    269     int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_ReportGuestInfo);
    270     if (RT_SUCCESS(rc))
    271     {
    272         pReq->guestInfo.interfaceVersion = VMMDEV_VERSION;
    273         pReq->guestInfo.osType = enmOSType;
    274         rc = VbglGRPerform(&pReq->header);
    275         if (RT_FAILURE(rc))
    276             LogRel(("vboxGuestInitReportGuestInfo: 1st part failed with rc=%Rrc\n", rc));
    277         VbglGRFree(&pReq->header);
    278     }
    279     VMMDevReportGuestInfo2 *pReq2;
    280     if (RT_SUCCESS(rc))
    281         rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq2, sizeof(*pReq2), VMMDevReq_ReportGuestInfo2);
    282     if (RT_SUCCESS(rc))
    283     {
    284         pReq2->guestInfo.additionsMajor = VBOX_VERSION_MAJOR;
    285         pReq2->guestInfo.additionsMinor = VBOX_VERSION_MINOR;
    286         pReq2->guestInfo.additionsBuild = VBOX_VERSION_BUILD;
    287         pReq2->guestInfo.additionsRevision = VBOX_SVN_REV;
    288         pReq2->guestInfo.additionsFeatures = 0;
    289         RTStrCopy(pReq2->guestInfo.szName, sizeof(pReq2->guestInfo.szName), VBOX_VERSION_STRING);
    290         rc = VbglGRPerform(&pReq2->header);
    291         if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
    292             rc = VINF_SUCCESS;
    293         if (RT_FAILURE(rc))
    294             LogRel(("vboxGuestInitReportGuestInfo: 2nd part failed with rc=%Rrc\n", rc));
    295         VbglGRFree(&pReq2->header);
    296     }
    297 
    298     /*
    299      * Report guest status to host.  Because the host set the "Guest Additions active" flag as soon
    300      * as he received the VMMDevReportGuestInfo above to make sure all is compatible with older Guest
    301      * Additions we now have to disable that flag again here (too early, VBoxService and friends need
    302      * to start up first).
    303      */
    304     VMMDevReportGuestStatus *pReq3;
    305     rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq3, sizeof(*pReq3), VMMDevReq_ReportGuestStatus);
    306     if (RT_SUCCESS(rc))
    307     {
    308         pReq3->guestStatus.facility = VBoxGuestStatusFacility_VBoxGuestDriver;
    309         pReq3->guestStatus.status = VBoxGuestStatusCurrent_Active; /** @todo Are we actually *really* active at this point? */
    310         pReq3->guestStatus.flags = 0;
    311         rc = VbglGRPerform(&pReq3->header);
    312         if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
    313             rc = VINF_SUCCESS;
    314         if (RT_FAILURE(rc))
    315             LogRel(("vboxGuestInitReportGuestInfo: reporting status failed with rc=%Rrc\n", rc));
    316         VbglGRFree(&pReq3->header);
    317     }
    318     return rc;
    319 }
    320 
    321 
    322 /**
    323257 * Inflate the balloon by one chunk represented by an R0 memory object.
    324258 *
     
    799733            Assert(pDevExt->PhysIrqAckEvents != 0);
    800734
    801             rc = vboxGuestInitReportGuestInfo(pDevExt, enmOSType);
     735            rc = vboxGuestSetFilterMask(pDevExt, fFixedEvents);
    802736            if (RT_SUCCESS(rc))
    803737            {
    804                 rc = vboxGuestSetFilterMask(pDevExt, fFixedEvents);
     738                /*
     739                 * Disable guest graphics capability by default. The guest specific
     740                 * graphics driver will re-enable this when it is necessary.
     741                 */
     742                rc = VBoxGuestSetGuestCapabilities(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS);
    805743                if (RT_SUCCESS(rc))
    806744                {
    807                     /*
    808                      * Disable guest graphics capability by default. The guest specific
    809                      * graphics driver will re-enable this when it is necessary.
    810                      */
    811                     rc = VBoxGuestSetGuestCapabilities(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS);
    812                     if (RT_SUCCESS(rc))
    813                     {
    814                         vboxGuestInitFixateGuestMappings(pDevExt);
    815                         Log(("VBoxGuestInitDevExt: returns success\n"));
    816                         return VINF_SUCCESS;
    817                     }
    818 
    819                     LogRel(("VBoxGuestInitDevExt: VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc));
     745                    vboxGuestInitFixateGuestMappings(pDevExt);
     746
     747                    rc = VbglR0MiscReportGuestInfo(enmOSType);
     748                    if (RT_FAILURE(rc))
     749                        LogRel(("VBoxGuestInitDevExt: VbglR0MiscReportGuestInfo failed, rc=%Rrc\n", rc));
     750
     751                    Log(("VBoxGuestInitDevExt: returns success\n"));
     752                    return VINF_SUCCESS;
    820753                }
    821                 else
    822                     LogRel(("VBoxGuestInitDevExt: vboxGuestSetFilterMask failed, rc=%Rrc\n", rc));
     754
     755                LogRel(("VBoxGuestInitDevExt: VBoxGuestSetGuestCapabilities failed, rc=%Rrc\n", rc));
    823756            }
    824757            else
    825                 LogRel(("VBoxGuestInitDevExt: vboxGuestInitReportGuestInfo failed, rc=%Rrc\n", rc));
    826 
     758                LogRel(("VBoxGuestInitDevExt: vboxGuestSetFilterMask failed, rc=%Rrc\n", rc));
    827759            VbglGRFree((VMMDevRequestHeader *)pDevExt->pIrqAckEvents);
    828760        }
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