- Timestamp:
- Jan 21, 2025 9:33:52 AM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/UsbNet.cpp
r107791 r107871 407 407 volatile bool fHaveToHostQueueWaiter; 408 408 409 /** VM is currently suspended and we should ignore all external requests. */ 410 volatile bool fSuspended; 411 409 412 /** Whether to signal the reset semaphore when the current request completes. */ 410 413 bool fSignalResetSem; … … 1248 1251 1249 1252 RTCritSectEnter(&pThis->CritSect); 1250 if (!usbNetQueueIsEmpty(&pThis->ToHostQueue) )1253 if (!usbNetQueueIsEmpty(&pThis->ToHostQueue) || pThis->fSuspended) 1251 1254 { 1252 1255 RTCritSectLeave(&pThis->CritSect); … … 1276 1279 RTCritSectEnter(&pThis->CritSect); 1277 1280 1278 if (usbNetQueueIsEmpty(&pThis->ToHostQueue) )1281 if (usbNetQueueIsEmpty(&pThis->ToHostQueue) || pThis->fSuspended) 1279 1282 { 1280 1283 RTCritSectLeave(&pThis->CritSect); … … 2115 2118 2116 2119 2120 /** 2121 * @interface_method_impl{PDMUSBREG,pfnVMSuspend} 2122 */ 2123 static DECLCALLBACK(void) usbNetVMSuspend(PPDMUSBINS pUsbIns) 2124 { 2125 PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET); 2126 #ifdef LOG_ENABLED 2127 PCPDMUSBHLP pHlp = pUsbIns->pHlpR3; 2128 VMSUSPENDREASON enmReason = pHlp->pfnVMGetSuspendReason(pUsbIns); 2129 LogFlowFunc(("/#%u/ enmReason=%u\n", pUsbIns->iInstance, enmReason)); 2130 #endif 2131 RTCritSectEnter(&pThis->CritSect); 2132 pThis->fSuspended = true; 2133 /* Unblock receive thread */ 2134 RTSemEventSignal(pThis->hEvtToHostQueue); 2135 RTCritSectLeave(&pThis->CritSect); 2136 } 2137 2138 2139 /** 2140 * @interface_method_impl{PDMUSBREG,pfnVMResume} 2141 */ 2142 static DECLCALLBACK(void) usbNetVMResume(PPDMUSBINS pUsbIns) 2143 { 2144 PUSBNET pThis = PDMINS_2_DATA(pUsbIns, PUSBNET); 2145 #ifdef LOG_ENABLED 2146 PCPDMUSBHLP pHlp = pUsbIns->pHlpR3; 2147 VMRESUMEREASON enmReason = pHlp->pfnVMGetResumeReason(pUsbIns); 2148 LogFlowFunc(("/#%u/ enmReason=%u\n", pUsbIns->iInstance, enmReason)); 2149 #endif 2150 RTCritSectEnter(&pThis->CritSect); 2151 pThis->fSuspended = false; 2152 RTCritSectLeave(&pThis->CritSect); 2153 } 2154 2155 2117 2156 /** 2118 2157 * @interface_method_impl{PDMUSBREG,pfnDestruct} … … 2336 2375 usbNetVMReset, 2337 2376 /* pfnVMSuspend */ 2338 NULL,2377 usbNetVMSuspend, 2339 2378 /* pfnVMResume */ 2340 NULL,2379 usbNetVMResume, 2341 2380 /* pfnVMPowerOff */ 2342 2381 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.