/**
 * Update the guest additions capabilities.
 * This is called when the guest additions capabilities change. The new capabilities
 * are given and the connector should update its internal state.
 *
 * @param   pInterface          Pointer to this interface.
 * @param   newCapabilities     New capabilities.
 * @thread  The emulation thread.
 */
DECLCALLBACK(void) vmmdevUpdateGuestCapabilities(PPDMIVMMDEVCONNECTOR pInterface, uint32_t newCapabilities)
{
    PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface);
    AssertPtr(pDrv);
    Console *pConsole = pDrv->pVMMDev->getParent();

    /* store that information in IGuest */
    Guest* pGuest = pConsole->getGuest();
    AssertPtr(pGuest);
    if (!pGuest)
        return;

    /*
     * Report our current capabilities (and assume none is active yet).
     */
    pGuest->setSupportedFeatures(newCapabilities);

    /*
     * Tell the console interface about the event
     * so that it can notify its consumers.
     */
    pConsole->onAdditionsStateChange();
}