VirtualBox

Changeset 54609 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 3, 2015 8:32:45 PM (10 years ago)
Author:
vboxsync
Message:

Seems someone forgot to merge VBoxGuest2.cpp into VBoxGuest.cpp, finaly done now.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
2 deleted
6 edited

Legend:

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

    r51224 r54609  
    8787  endif
    8888  VBoxGuest_SOURCES     += \
    89         VBoxGuest.cpp \
    90         VBoxGuest2.cpp
     89        VBoxGuest.cpp
    9190  ifeq ($(KBUILD_TARGET), win)
    9291   VBoxGuest_SOURCES += \
     
    137136  VBoxGuestLibOs2Hack_SOURCES = \
    138137        VBoxGuest-os2.cpp \
    139         VBoxGuest.cpp \
    140         VBoxGuest2.cpp
     138        VBoxGuest.cpp
    141139 endif # OS/2
    142140
    143  VBoxGuest2.cpp_DEFS    = VBOX_SVN_REV=$(VBOX_SVN_REV)
    144141 VBoxGuest.cpp_DEFS     = VBOX_SVN_REV=$(VBOX_SVN_REV)
    145142
     
    155152  VBoxGuestNT_SOURCES = \
    156153        VBoxGuest.cpp \
    157         VBoxGuest2.cpp \
    158154        VBoxGuest-$(KBUILD_TARGET).cpp \
    159155        VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r54608 r54609  
    3131#define LOG_GROUP   LOG_GROUP_DEFAULT
    3232#include "VBoxGuestInternal.h"
    33 #include "VBoxGuest2.h"
    3433#include <VBox/VMMDev.h> /* for VMMDEV_RAM_SIZE */
    3534#include <VBox/log.h>
     
    309308
    310309
     310
     311/**
     312 * Report the guest information to the host.
     313 *
     314 * @returns IPRT status code.
     315 * @param   enmOSType       The OS type to report.
     316 */
     317static int vbgdReportGuestInfo(VBOXOSTYPE enmOSType)
     318{
     319    /*
     320     * Allocate and fill in the two guest info reports.
     321     */
     322    VMMDevReportGuestInfo2 *pReqInfo2 = NULL;
     323    VMMDevReportGuestInfo  *pReqInfo1 = NULL;
     324    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReqInfo2, sizeof (VMMDevReportGuestInfo2), VMMDevReq_ReportGuestInfo2);
     325    Log(("vbgdReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     326    if (RT_SUCCESS(rc))
     327    {
     328        pReqInfo2->guestInfo.additionsMajor    = VBOX_VERSION_MAJOR;
     329        pReqInfo2->guestInfo.additionsMinor    = VBOX_VERSION_MINOR;
     330        pReqInfo2->guestInfo.additionsBuild    = VBOX_VERSION_BUILD;
     331        pReqInfo2->guestInfo.additionsRevision = VBOX_SVN_REV;
     332        pReqInfo2->guestInfo.additionsFeatures = 0; /* (no features defined yet) */
     333        RTStrCopy(pReqInfo2->guestInfo.szName, sizeof(pReqInfo2->guestInfo.szName), VBOX_VERSION_STRING);
     334
     335        rc = VbglGRAlloc((VMMDevRequestHeader **)&pReqInfo1, sizeof (VMMDevReportGuestInfo), VMMDevReq_ReportGuestInfo);
     336        Log(("vbgdReportGuestInfo: VbglGRAlloc VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     337        if (RT_SUCCESS(rc))
     338        {
     339            pReqInfo1->guestInfo.interfaceVersion = VMMDEV_VERSION;
     340            pReqInfo1->guestInfo.osType           = enmOSType;
     341
     342            /*
     343             * There are two protocols here:
     344             *      1. Info2 + Info1. Supported by >=3.2.51.
     345             *      2. Info1 and optionally Info2. The old protocol.
     346             *
     347             * We try protocol 1 first.  It will fail with VERR_NOT_SUPPORTED
     348             * if not supported by the VMMDev (message ordering requirement).
     349             */
     350            rc = VbglGRPerform(&pReqInfo2->header);
     351            Log(("vbgdReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     352            if (RT_SUCCESS(rc))
     353            {
     354                rc = VbglGRPerform(&pReqInfo1->header);
     355                Log(("vbgdReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     356            }
     357            else if (   rc == VERR_NOT_SUPPORTED
     358                     || rc == VERR_NOT_IMPLEMENTED)
     359            {
     360                rc = VbglGRPerform(&pReqInfo1->header);
     361                Log(("vbgdReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo completed with rc=%Rrc\n", rc));
     362                if (RT_SUCCESS(rc))
     363                {
     364                    rc = VbglGRPerform(&pReqInfo2->header);
     365                    Log(("vbgdReportGuestInfo: VbglGRPerform VMMDevReportGuestInfo2 completed with rc=%Rrc\n", rc));
     366                    if (rc == VERR_NOT_IMPLEMENTED)
     367                        rc = VINF_SUCCESS;
     368                }
     369            }
     370            VbglGRFree(&pReqInfo1->header);
     371        }
     372        VbglGRFree(&pReqInfo2->header);
     373    }
     374
     375    return rc;
     376}
     377
     378
     379/**
     380 * Report the guest driver status to the host.
     381 *
     382 * @returns IPRT status code.
     383 * @param   fActive         Flag whether the driver is now active or not.
     384 */
     385static int vbgdReportDriverStatus(bool fActive)
     386{
     387    /*
     388     * Report guest status of the VBox driver to the host.
     389     */
     390    VMMDevReportGuestStatus *pReq2 = NULL;
     391    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq2, sizeof(*pReq2), VMMDevReq_ReportGuestStatus);
     392    Log(("vbgdReportDriverStatus: VbglGRAlloc VMMDevReportGuestStatus completed with rc=%Rrc\n", rc));
     393    if (RT_SUCCESS(rc))
     394    {
     395        pReq2->guestStatus.facility = VBoxGuestFacilityType_VBoxGuestDriver;
     396        pReq2->guestStatus.status = fActive ?
     397                                    VBoxGuestFacilityStatus_Active
     398                                  : VBoxGuestFacilityStatus_Inactive;
     399        pReq2->guestStatus.flags = 0;
     400        rc = VbglGRPerform(&pReq2->header);
     401        Log(("vbgdReportDriverStatus: VbglGRPerform VMMDevReportGuestStatus completed with fActive=%d, rc=%Rrc\n",
     402             fActive ? 1 : 0, rc));
     403        if (rc == VERR_NOT_IMPLEMENTED) /* Compatibility with older hosts. */
     404            rc = VINF_SUCCESS;
     405        VbglGRFree(&pReq2->header);
     406    }
     407
     408    return rc;
     409}
     410
     411
    311412/** @name Memory Ballooning
    312413 * @{
     
    803904int VbgdCommonReinitDevExtAfterHibernation(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType)
    804905{
    805     int rc = VBoxGuestReportGuestInfo(enmOSType);
     906    int rc = vbgdReportGuestInfo(enmOSType);
    806907    if (RT_SUCCESS(rc))
    807908    {
    808         rc = VBoxGuestReportDriverStatus(true /* Driver is active */);
     909        rc = vbgdReportDriverStatus(true /* Driver is active */);
    809910        if (RT_FAILURE(rc))
    810911            Log(("VbgdCommonReinitDevExtAfterHibernation: could not report guest driver status, rc=%Rrc\n", rc));
     
    9681069            Assert(pDevExt->PhysIrqAckEvents != 0);
    9691070
    970             rc = VBoxGuestReportGuestInfo(enmOSType);
     1071            rc = vbgdReportGuestInfo(enmOSType);
    9711072            if (RT_SUCCESS(rc))
    9721073            {
     
    9891090                         * Done!
    9901091                         */
    991                         rc = VBoxGuestReportDriverStatus(true /* Driver is active */);
     1092                        rc = vbgdReportDriverStatus(true /* Driver is active */);
    9921093                        if (RT_FAILURE(rc))
    9931094                            LogRel(("VbgdCommonInitDevExt: VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc));
  • trunk/src/VBox/Additions/common/VBoxGuest/freebsd/Makefile

    r53241 r54609  
    55
    66#
    7 # Copyright (C) 2006-2014 Oracle Corporation
     7# Copyright (C) 2006-2015 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2727SRCS = \
    2828        VBoxGuest.c \
    29         VBoxGuest2.c \
    3029        VBoxGuest-freebsd.c \
    3130        GenericRequest.c \
  • trunk/src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest

    r53241 r54609  
    66
    77#
    8 # Copyright (C) 2007-2010 Oracle Corporation
     8# Copyright (C) 2007-2015 Oracle Corporation
    99#
    1010# This file is part of VirtualBox Open Source Edition (OSE), as
     
    7676    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest.c \
    7777    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c=>VBoxGuest-freebsd.c \
    78     ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest2.cpp=>VBoxGuest2.c \
    79     ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest2.h=>VBoxGuest2.h \
    8078    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestIDC-unix.c.h=>VBoxGuestIDC-unix.c.h \
    8179    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h=>VBoxGuestInternal.h \
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile

    r54524 r54609  
    55
    66#
    7 # Copyright (C) 2006-2014 Oracle Corporation
     7# Copyright (C) 2006-2015 Oracle Corporation
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2525        VBoxGuest-linux.o \
    2626        VBoxGuest.o \
    27         VBoxGuest2.o \
    2827        GenericRequest.o \
    2928        HGCMInternal.o \
  • trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest

    r54524 r54609  
    66
    77#
    8 # Copyright (C) 2007-2014 Oracle Corporation
     8# Copyright (C) 2007-2015 Oracle Corporation
    99#
    1010# This file is part of VirtualBox Open Source Edition (OSE), as
     
    7171    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest.c \
    7272    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c=>VBoxGuest-linux.c \
    73     ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest2.cpp=>VBoxGuest2.c \
    74     ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest2.h=>VBoxGuest2.h \
    7573    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestIDC-unix.c.h=>VBoxGuestIDC-unix.c.h \
    7674    ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h=>VBoxGuestInternal.h \
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