VirtualBox

Changeset 8318 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Apr 23, 2008 8:56:36 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30080
Message:

Additions/common, solaris: Report disabled guest graphics capabilities by default.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r8155 r8318  
    3535
    3636#include "VBoxGuestInternal.h"
     37#include <VBox/VBoxDev.h>       /* for VMMDEV_GUEST_SUPPORTS_GRAPHICS */
    3738#include <VBox/log.h>
    3839#include <iprt/assert.h>
     
    331332                                    if (RT_SUCCESS(rc))
    332333                                    {
    333                                         rc = ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0);
    334                                         if (rc == DDI_SUCCESS)
     334                                        /*
     335                                         * Disable graphics capability explicitly for Solaris guests.
     336                                         */
     337                                        rc = VBoxGuestSetGuestCapabilities(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS);
     338                                        if (RT_SUCCESS(rc))
    335339                                        {
    336                                             g_pDip = pDip;
    337                                             ddi_set_driver_private(pDip, pState);
    338                                             pci_config_teardown(&PciHandle);
    339                                             ddi_report_dev(pDip);
    340                                             return DDI_SUCCESS;
     340                                            rc = ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0);
     341                                            if (rc == DDI_SUCCESS)
     342                                            {
     343                                                g_pDip = pDip;
     344                                                ddi_set_driver_private(pDip, pState);
     345                                                pci_config_teardown(&PciHandle);
     346                                                ddi_report_dev(pDip);
     347                                                return DDI_SUCCESS;
     348                                            }
     349
     350                                            LogRel((DEVICE_NAME ":ddi_create_minor_node failed.\n"));
    341351                                        }
    342 
    343                                         LogRel((DEVICE_NAME ":ddi_create_minor_node failed.\n"));
     352                                        else
     353                                            LogRel((DEVICE_NAME ":VBoxGuestSetGuestCapabilities failed. rc=%d\n", rc));
    344354                                    }
    345355                                    else
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r8155 r8318  
    518518    VBoxGuestWaitFreeLocked(pDevExt, pWait);
    519519    RTSpinlockReleaseNoInts(pDevExt->WaitSpinlock, &Tmp);
     520}
     521
     522
     523/** @todo XXX: This should later be done as a proper IOCtl request. Currently we call this from Ring-0. */
     524int VBoxGuestSetGuestCapabilities(uint32_t u32OrMask, uint32_t u32NotMask)
     525{
     526    int rc;
     527    VMMDevReqGuestCapabilities2 *pReq;
     528    rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_SetGuestCapabilities);
     529    if (RT_FAILURE(rc))
     530    {
     531        Log(("VBoxGuestSetGuestCapabilities: failed to allocate %u (%#x) bytes to cache the request. rc=%d!!\n",
     532             sizeof(*pReq), sizeof(*pReq), rc));
     533        return rc;
     534    }
     535
     536    pReq->u32OrMask = u32OrMask;
     537    pReq->u32NotMask = u32NotMask;
     538
     539    rc = VbglGRPerform(&pReq->header);
     540    if (RT_FAILURE(rc))
     541        Log(("VBoxGuestSetGuestCapabilities:VbglGRPerform failed, rc=%Rrc!\n", rc));
     542    else if (RT_FAILURE(pReq->header.rc))
     543    {
     544        Log(("VBoxGuestSetGuestCapabilities: The request failed; VMMDev rc=%Rrc!\n", pReq->header.rc));
     545        rc = pReq->header.rc;
     546    }
     547
     548    VbglGRFree(&pReq->header);
     549    return rc;
    520550}
    521551
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    r8155 r8318  
    152152void VBoxGuestDeleteDevExt(PVBOXGUESTDEVEXT pDevExt);
    153153bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt);
     154int  VBoxGuestSetGuestCapabilities(uint32_t u32OrMask, uint32_t u32NotMask);
    154155
    155156int  VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession);
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