Changeset 8690 in vbox for trunk/src/VBox/Main
- Timestamp:
- May 7, 2008 11:00:06 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r8425 r8690 323 323 ///////////////////////////////////////////////////////////////////////////// 324 324 325 void Guest::setAdditionsVersion (Bstr aVersion )326 { 327 Assert ReturnVoid (!aVersion.isEmpty());325 void Guest::setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType) 326 { 327 Assert(aVersion.isNull() || !aVersion.isEmpty()); 328 328 329 329 AutoCaller autoCaller (this); … … 333 333 334 334 mData.mAdditionsVersion = aVersion; 335 /* this implies that Additions are active */ 336 mData.mAdditionsActive = TRUE; 335 mData.mAdditionsActive = !aVersion.isNull(); 336 /** @todo Translate aOsType to a string and assign it to mData.mOSTypeId. 337 * The problem is just that the VBOXOSTYPE -> string translation table is in VBoxSVC. :/ 338 * We need this fixed for correct session information! */ 337 339 } 338 340 -
trunk/src/VBox/Main/VMMDevInterface.cpp
r8425 r8690 151 151 /** 152 152 * Report guest OS version. 153 * Called whenever the Additions issue a guest version report request .153 * Called whenever the Additions issue a guest version report request or the VM is reset. 154 154 * 155 155 * @param pInterface Pointer to this interface. … … 171 171 return; 172 172 173 char version[20]; 174 RTStrPrintf(version, sizeof(version), "%d", guestInfo->additionsVersion); 175 guest->setAdditionsVersion(Bstr(version)); 173 if (guestInfo->additionsVersion != 0) 174 { 175 char version[20]; 176 RTStrPrintf(version, sizeof(version), "%d", guestInfo->additionsVersion); 177 guest->setAdditionsVersion(Bstr(version), guestInfo->osType); 178 179 /* 180 * Tell the console interface about the event 181 * so that it can notify its consumers. 182 */ 183 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 184 185 if (guestInfo->additionsVersion < VMMDEV_VERSION) 186 pDrv->pVMMDev->getParent()->onAdditionsOutdated(); 187 } 188 else 189 { 190 /* 191 * The guest additions was disabled because of a reset 192 * or driver unload. 193 */ 194 guest->setAdditionsVersion (Bstr(), guestInfo->osType); 195 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 196 } 197 } 198 199 /** 200 * Update the guest additions capabilities. 201 * This is called when the guest additions capabilities change. The new capabilities 202 * are given and the connector should update its internal state. 203 * 204 * @param pInterface Pointer to this interface. 205 * @param newCapabilities New capabilities. 206 * @thread The emulation thread. 207 */ 208 DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities) 209 { 210 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 211 212 /* store that information in IGuest */ 213 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 214 Assert(guest); 215 if (!guest) 216 return; 217 218 guest->setSupportsSeamless(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_SEAMLESS)); 219 guest->setSupportsGraphics(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_GRAPHICS)); 176 220 177 221 /* … … 180 224 */ 181 225 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 182 183 if (guestInfo->additionsVersion < VMMDEV_VERSION) 184 { 185 pDrv->pVMMDev->getParent()->onAdditionsOutdated(); 186 } 187 } 188 189 /** 190 * Update the guest additions capabilities. 191 * This is called when the guest additions capabilities change. The new capabilities 192 * are given and the connector should update its internal state. 193 * 194 * @param pInterface Pointer to this interface. 195 * @param newCapabilities New capabilities. 196 * @thread The emulation thread. 197 */ 198 DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities) 199 { 200 PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); 201 202 /* store that information in IGuest */ 203 Guest* guest = pDrv->pVMMDev->getParent()->getGuest(); 204 Assert(guest); 205 if (!guest) 206 return; 207 208 guest->setSupportsSeamless(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_SEAMLESS)); 209 guest->setSupportsGraphics(BOOL (newCapabilities & VMMDEV_GUEST_SUPPORTS_GRAPHICS)); 210 211 /* 212 * Tell the console interface about the event 213 * so that it can notify its consumers. 214 */ 215 pDrv->pVMMDev->getParent()->onAdditionsStateChange(); 216 226 217 227 } 218 228 … … 458 468 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_SYSTEM_CACHE) 459 469 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_MemSystemCache, pGuestStats->u32MemSystemCache / (_1M/pGuestStats->u32PageSize)); 460 470 461 471 if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE) 462 472 guest->SetStatistic(pGuestStats->u32CpuId, GuestStatisticType_PageFileSize, pGuestStats->u32PageFileSize / (_1M/pGuestStats->u32PageSize)); … … 501 511 502 512 PDRVMAINVMMDEV pDrv = PDMIHGCMCONNECTOR_2_MAINVMMDEV(pInterface); 503 513 504 514 if ( !pServiceLocation 505 515 || ( pServiceLocation->type != VMMDevHGCMLoc_LocalHost -
trunk/src/VBox/Main/include/GuestImpl.h
r8425 r8690 24 24 25 25 #include "VirtualBoxBase.h" 26 #include <VBox/ostypes.h> 26 27 27 28 class Console; … … 74 75 75 76 // public methods that are not in IDL 76 void setAdditionsVersion (Bstr aVersion );77 void setAdditionsVersion (Bstr aVersion, VBOXOSTYPE aOsType); 77 78 78 79 void setSupportsSeamless (BOOL aSupportsSeamless);
Note:
See TracChangeset
for help on using the changeset viewer.