VirtualBox

Changeset 26290 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 5, 2010 2:27:19 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57359
Message:

Statistics interval controllable from within the guest from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r26289 r26290  
    13921392        }
    13931393
    1394         case VMMDevReq_GetStatisticsChangeRequest:
    1395         {
    1396             Log(("VMMDevReq_GetStatisticsChangeRequest\n"));
    1397             if (pRequestHeader->size != sizeof(VMMDevGetStatisticsChangeRequest))
    1398             {
    1399                 AssertFailed();
    1400                 pRequestHeader->rc = VERR_INVALID_PARAMETER;
    1401             }
    1402             else
    1403             {
    1404                 VMMDevGetStatisticsChangeRequest *statIntervalChangeRequest = (VMMDevGetStatisticsChangeRequest*)pRequestHeader;
    1405                 /* just pass on the information */
    1406                 Log(("VMMDev: returning statistics interval %d seconds\n", pThis->u32StatIntervalSize));
    1407                 statIntervalChangeRequest->u32StatInterval = pThis->u32StatIntervalSize;
    1408 
    1409                 if (statIntervalChangeRequest->eventAck == VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST)
    1410                 {
    1411                     /* Remember which mode the client has queried. */
    1412                     pThis->u32LastStatIntervalSize= pThis->u32StatIntervalSize;
    1413                 }
    1414 
    1415                 pRequestHeader->rc = VINF_SUCCESS;
    1416             }
    1417             break;
    1418         }
    1419 
    14201394        case VMMDevReq_ReportGuestStats:
    14211395        {
     
    20692043}
    20702044
    2071 static DECLCALLBACK(int) vmmdevSetStatisticsInterval(PPDMIVMMDEVPORT pInterface, uint32_t ulStatInterval)
    2072 {
    2073     VMMDevState *pThis = IVMMDEVPORT_2_VMMDEVSTATE(pInterface);
    2074     PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    2075 
    2076     /* Verify that the new resolution is different and that guest does not yet know about it. */
    2077     bool fSame = (pThis->u32LastStatIntervalSize == ulStatInterval);
    2078 
    2079     Log(("vmmdevSetStatisticsInterval: old=%d. new=%d\n", pThis->u32LastStatIntervalSize, ulStatInterval));
    2080 
    2081     if (!fSame)
    2082     {
    2083         /* we could validate the information here but hey, the guest can do that as well! */
    2084         pThis->u32StatIntervalSize = ulStatInterval;
    2085 
    2086         /* IRQ so the guest knows what's going on */
    2087         VMMDevNotifyGuest (pThis, VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST);
    2088     }
    2089 
    2090     PDMCritSectLeave(&pThis->CritSect);
    2091     return VINF_SUCCESS;
    2092 }
    2093 
    20942045
    20952046static DECLCALLBACK(int) vmmdevSetCredentials(PPDMIVMMDEVPORT pInterface, const char *pszUsername,
     
    24792430    /* disabled memory ballooning */
    24802431    pThis->u32LastMemoryBalloonSize = 0;
    2481 
    2482     /* disabled statistics updating */
    2483     pThis->u32LastStatIntervalSize = 0;
    24842432
    24852433    /* Clear the "HGCM event enabled" flag so the event can be automatically reenabled.  */
     
    25932541    pThis->IPort.pfnRequestSeamlessChange  = vmmdevRequestSeamlessChange;
    25942542    pThis->IPort.pfnSetMemoryBalloon       = vmmdevSetMemoryBalloon;
    2595     pThis->IPort.pfnSetStatisticsInterval  = vmmdevSetStatisticsInterval;
    25962543    pThis->IPort.pfnVRDPChange             = vmmdevVRDPChange;
    25972544    pThis->IPort.pfnCpuHotUnplug           = vmmdevCpuHotUnplug;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette