Changeset 105069 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 27, 2024 8:26:21 PM (7 months ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp
r105064 r105069 779 779 * 780 780 * @returns VBox status code. 781 * @param pD evIns The pcnet device instance.781 * @param pDrvIns The pcnet device instance. 782 782 * @param pThread The send thread. 783 783 * … … 791 791 drvNATNotifyNATThread(pThis, "drvNATAsyncIoWakeup"); 792 792 return VINF_SUCCESS; 793 }794 795 /** @todo r=jack: do we need? */796 static DECLCALLBACK(int) drvNATHostResThread(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)797 {798 PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT);799 800 if (pThread->enmState == PDMTHREADSTATE_INITIALIZING)801 return VINF_SUCCESS;802 803 while (pThread->enmState == PDMTHREADSTATE_RUNNING)804 {805 RTReqQueueProcess(pThis->hHostResQueue, RT_INDEFINITE_WAIT);806 }807 808 return VINF_SUCCESS;809 }810 811 static DECLCALLBACK(int) drvNATReqQueueInterrupt()812 {813 /*814 * RTReqQueueProcess loops until request returns a warning or info815 * status code (other than VINF_SUCCESS).816 */817 return VINF_INTERRUPTED;818 }819 820 static DECLCALLBACK(int) drvNATHostResWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)821 {822 RT_NOREF(pThread);823 PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT);824 Assert(pThis != NULL);825 826 int rc;827 rc = RTReqQueueCallEx(pThis->hHostResQueue, NULL /*ppReq*/, 0 /*cMillies*/,828 RTREQFLAGS_IPRT_STATUS | RTREQFLAGS_NO_WAIT,829 (PFNRT)drvNATReqQueueInterrupt, 0);830 return rc;831 793 } 832 794 … … 847 809 /** 848 810 * Info handler. 811 * 812 * @param pDrvIns The PDM driver context. 813 * @param pHlp .... 814 * @param pszArgs Unused. 815 * 816 * @thread any 849 817 */ 850 818 static DECLCALLBACK(void) drvNATInfo(PPDMDRVINS pDrvIns, PCDBGFINFOHLP pHlp, const char *pszArgs) … … 1173 1141 } 1174 1142 1175 RTReqQueueDestroy(pThis->hHostResQueue);1176 pThis->hHostResQueue = NIL_RTREQQUEUE;1177 1178 1143 RTReqQueueDestroy(pThis->hSlirpReqQueue); 1179 1144 pThis->hSlirpReqQueue = NIL_RTREQQUEUE; … … 1249 1214 pThis->hSlirpReqQueue = NIL_RTREQQUEUE; 1250 1215 pThis->hUrgRecvReqQueue = NIL_RTREQQUEUE; 1251 pThis->hHostResQueue = NIL_RTREQQUEUE;1252 1216 pThis->EventRecv = NIL_RTSEMEVENT; 1253 1217 pThis->EventUrgRecv = NIL_RTSEMEVENT; … … 1308 1272 int fDNSProxy = 0; 1309 1273 GET_S32(rc, pDrvIns, pCfg, "DNSProxy", fDNSProxy); 1310 int fUseHostResolver = 0;1311 GET_S32(rc, pDrvIns, pCfg, "UseHostResolver", fUseHostResolver);1312 1274 int MTU = 1500; 1313 1275 GET_S32(rc, pDrvIns, pCfg, "SlirpMTU", MTU); … … 1403 1365 pSlirpCfg->vdhcp_start = vdhcp_start; 1404 1366 pSlirpCfg->vnameserver = vnameserver; 1367 pSlirpCfg->if_mtu = MTU; 1405 1368 1406 1369 #ifndef RT_OS_WINDOWS … … 1463 1426 rc = PDMDrvHlpThreadCreate(pDrvIns, &pThis->pUrgRecvThread, pThis, drvNATUrgRecv, 1464 1427 drvNATUrgRecvWakeup, 256 * _1K, RTTHREADTYPE_IO, "NATURGRX"); 1465 AssertRCReturn(rc, rc);1466 1467 rc = RTReqQueueCreate(&pThis->hHostResQueue);1468 AssertRCReturn(rc, rc);1469 1470 rc = PDMDrvHlpThreadCreate(pThis->pDrvIns, &pThis->pHostResThread,1471 pThis, drvNATHostResThread, drvNATHostResWakeup,1472 128 * _1K, RTTHREADTYPE_IO, "HOSTRES");1473 1428 AssertRCReturn(rc, rc); 1474 1429 -
trunk/src/VBox/Devices/Network/DrvNATlibslirp.h
r105064 r105069 301 301 RTCRITSECT XmitLock; 302 302 303 /** Request queue for the async host resolver. */304 RTREQQUEUE hHostResQueue;305 /** Async host resolver thread. */306 PPDMTHREAD pHostResThread;307 308 303 #ifdef RT_OS_DARWIN 309 304 /* Handle of the DNS watcher runloop source. */ … … 332 327 static DECLCALLBACK(int) drvNATAsyncIoThread(PPDMDRVINS, PPDMTHREAD); 333 328 static DECLCALLBACK(int) drvNATAsyncIoWakeup(PPDMDRVINS, PPDMTHREAD); 334 static DECLCALLBACK(int) drvNATHostResThread(PPDMDRVINS, PPDMTHREAD);335 static DECLCALLBACK(int) drvNATReqQueueInterrupt();336 static DECLCALLBACK(int) drvNATHostResWakeup(PPDMDRVINS, PPDMTHREAD);337 329 static DECLCALLBACK(void *) drvNATQueryInterface(PPDMIBASE, const char *); 338 330 static DECLCALLBACK(void) drvNATInfo(PPDMDRVINS, PCDBGFINFOHLP, const char *);
Note:
See TracChangeset
for help on using the changeset viewer.