Changeset 54609 in vbox for trunk/src/VBox
- Timestamp:
- Mar 3, 2015 8:32:45 PM (10 years ago)
- 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 87 87 endif 88 88 VBoxGuest_SOURCES += \ 89 VBoxGuest.cpp \ 90 VBoxGuest2.cpp 89 VBoxGuest.cpp 91 90 ifeq ($(KBUILD_TARGET), win) 92 91 VBoxGuest_SOURCES += \ … … 137 136 VBoxGuestLibOs2Hack_SOURCES = \ 138 137 VBoxGuest-os2.cpp \ 139 VBoxGuest.cpp \ 140 VBoxGuest2.cpp 138 VBoxGuest.cpp 141 139 endif # OS/2 142 140 143 VBoxGuest2.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)144 141 VBoxGuest.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) 145 142 … … 155 152 VBoxGuestNT_SOURCES = \ 156 153 VBoxGuest.cpp \ 157 VBoxGuest2.cpp \158 154 VBoxGuest-$(KBUILD_TARGET).cpp \ 159 155 VBoxGuest-$(KBUILD_TARGET)-legacy.cpp \ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r54608 r54609 31 31 #define LOG_GROUP LOG_GROUP_DEFAULT 32 32 #include "VBoxGuestInternal.h" 33 #include "VBoxGuest2.h"34 33 #include <VBox/VMMDev.h> /* for VMMDEV_RAM_SIZE */ 35 34 #include <VBox/log.h> … … 309 308 310 309 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 */ 317 static 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 */ 385 static 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 311 412 /** @name Memory Ballooning 312 413 * @{ … … 803 904 int VbgdCommonReinitDevExtAfterHibernation(PVBOXGUESTDEVEXT pDevExt, VBOXOSTYPE enmOSType) 804 905 { 805 int rc = VBoxGuestReportGuestInfo(enmOSType);906 int rc = vbgdReportGuestInfo(enmOSType); 806 907 if (RT_SUCCESS(rc)) 807 908 { 808 rc = VBoxGuestReportDriverStatus(true /* Driver is active */);909 rc = vbgdReportDriverStatus(true /* Driver is active */); 809 910 if (RT_FAILURE(rc)) 810 911 Log(("VbgdCommonReinitDevExtAfterHibernation: could not report guest driver status, rc=%Rrc\n", rc)); … … 968 1069 Assert(pDevExt->PhysIrqAckEvents != 0); 969 1070 970 rc = VBoxGuestReportGuestInfo(enmOSType);1071 rc = vbgdReportGuestInfo(enmOSType); 971 1072 if (RT_SUCCESS(rc)) 972 1073 { … … 989 1090 * Done! 990 1091 */ 991 rc = VBoxGuestReportDriverStatus(true /* Driver is active */);1092 rc = vbgdReportDriverStatus(true /* Driver is active */); 992 1093 if (RT_FAILURE(rc)) 993 1094 LogRel(("VbgdCommonInitDevExt: VBoxReportGuestDriverStatus failed, rc=%Rrc\n", rc)); -
trunk/src/VBox/Additions/common/VBoxGuest/freebsd/Makefile
r53241 r54609 5 5 6 6 # 7 # Copyright (C) 2006-201 4Oracle Corporation7 # Copyright (C) 2006-2015 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 SRCS = \ 28 28 VBoxGuest.c \ 29 VBoxGuest2.c \30 29 VBoxGuest-freebsd.c \ 31 30 GenericRequest.c \ -
trunk/src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
r53241 r54609 6 6 7 7 # 8 # Copyright (C) 2007-201 0Oracle Corporation8 # Copyright (C) 2007-2015 Oracle Corporation 9 9 # 10 10 # This file is part of VirtualBox Open Source Edition (OSE), as … … 76 76 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest.c \ 77 77 ${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 \80 78 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestIDC-unix.c.h=>VBoxGuestIDC-unix.c.h \ 81 79 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h=>VBoxGuestInternal.h \ -
trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile
r54524 r54609 5 5 6 6 # 7 # Copyright (C) 2006-201 4Oracle Corporation7 # Copyright (C) 2006-2015 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 VBoxGuest-linux.o \ 26 26 VBoxGuest.o \ 27 VBoxGuest2.o \28 27 GenericRequest.o \ 29 28 HGCMInternal.o \ -
trunk/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
r54524 r54609 6 6 7 7 # 8 # Copyright (C) 2007-201 4Oracle Corporation8 # Copyright (C) 2007-2015 Oracle Corporation 9 9 # 10 10 # This file is part of VirtualBox Open Source Edition (OSE), as … … 71 71 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp=>VBoxGuest.c \ 72 72 ${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 \75 73 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestIDC-unix.c.h=>VBoxGuestIDC-unix.c.h \ 76 74 ${PATH_ROOT}/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h=>VBoxGuestInternal.h \
Note:
See TracChangeset
for help on using the changeset viewer.