genode/repos/ports/src/virtualbox5/patches/usb.patch

200 lines
8.0 KiB
Diff

usb.patch
diff --git a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
index a51bc36..bed42e8 100644
--- a/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/USB/USBProxyDevice.cpp
@@ -843,6 +843,7 @@ static DECLCALLBACK(int) usbProxyConstruct(PPDMUSBINS pUsbIns, int iInstance, PC
/*
* Select backend and open the device.
*/
+ return PDMUSB_SET_ERROR(pUsbIns, VERR_NOT_SUPPORTED, N_("USBProxy: not supported on Genode"));
rc = VERR_NOT_FOUND;
for (unsigned i = 0; i < RT_ELEMENTS(g_aUsbProxies); i++)
{
diff --git a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
index 4790fcb..d649ad6 100644
--- a/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/USB/VUSBDevice.cpp
@@ -1134,7 +1143,7 @@ static DECLCALLBACK(int) vusbDevUrbIoThread(RTTHREAD hThread, void *pvUser)
vusbUrbDoReapAsyncDev(pDev, RT_INDEFINITE_WAIT);
/* Process any URBs waiting to be cancelled first. */
- int rc = RTReqQueueProcess(pDev->hReqQueueSync, 0); /* Don't wait if there is nothing to do. */
+ int rc = RTReqQueueProcess(pDev->hReqQueueSync, pDev->enmState == VUSB_DEVICE_STATE_RESET ? 5 : 0); /* if in reset state (takes 10ms) sleep a bit - otherwise this thread consumes in this loop a lot of cpu time */
Assert(RT_SUCCESS(rc) || rc == VERR_TIMEOUT); NOREF(rc);
}
diff --git a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
index 3173a36..8105987 100644
--- a/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/build/VBoxDD.cpp
@@ -39,6 +39,7 @@ const void *g_apvVBoxDDDependencies[] =
NULL,
};
+#if 0
/**
* Register builtin devices.
@@ -329,6 +330,7 @@ extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_
return VINF_SUCCESS;
}
+#endif /* if 0 */
/**
* Register builtin USB device.
diff --git a/src/app/virtualbox/src/VBox/Main/include/Matching.h b/src/app/virtualbox/src/VBox/Main/include/Matching.h
index 2f01f69..9b13e37 100644
--- a/src/app/virtualbox/src/VBox/Main/include/Matching.h
+++ b/src/app/virtualbox/src/VBox/Main/include/Matching.h
@@ -291,10 +291,12 @@ public:
return mValueAny || mValue == aValue;
}
+#if 0
bool isMatch (const BOOL aValue) const
{
return isMatch (bool (aValue == TRUE));
}
+#endif /* if 0 */
private:
--- a/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
+++ b/src/app/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
@@ -13219,6 +13225,7 @@
{
LogFlowThisFunc(("\n"));
+ return S_OK;
#ifdef VBOX_WITH_USB
HRESULT rc = mUSBDeviceFilters->i_notifyProxy(true /* aInsertFilters */);
AssertComRC(rc);
@@ -13246,6 +13253,7 @@
{
LogFlowThisFunc(("\n"));
+ return S_OK;
#ifdef VBOX_WITH_USB
HRESULT rc = mUSBDeviceFilters->i_notifyProxy(false /* aInsertFilters */);
AssertComRC(rc);
--- a/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
+++ b/src/app/virtualbox/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp
@@ -386,7 +386,7 @@
ComAssertRet(pProxySvc, E_FAIL);
ComAssertRet(pFilter->i_getId() == NULL, E_FAIL);
- pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
+// pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
}
alock.release();
@@ -452,7 +452,7 @@
ComAssertRet(pProxySvc, E_FAIL);
ComAssertRet(pFilter->i_getId() != NULL, E_FAIL);
- pProxySvc->removeFilter(pFilter->i_getId());
+// pProxySvc->removeFilter(pFilter->i_getId());
pFilter->i_getId() = NULL;
}
@@ -606,7 +606,7 @@
{
USBDeviceFilter *pFilter = *it;
Assert(pFilter->i_getId() != NULL);
- pProxySvc->removeFilter(pFilter->i_getId());
+// pProxySvc->removeFilter(pFilter->i_getId());
pFilter->i_getId() = NULL;
}
@@ -631,7 +631,7 @@
{
USBDeviceFilter *pFilter = *it; /* resolve ambiguity */
Assert(pFilter->i_getId() == NULL);
- pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
+// pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
}
}
++it;
@@ -841,12 +841,12 @@
if (aFilter->i_getData().mData.fActive)
{
ComAssertRet(aFilter->i_getId() == NULL, E_FAIL);
- aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
+// aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
}
else
{
ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
- pProxySvc->removeFilter(aFilter->i_getId());
+// pProxySvc->removeFilter(aFilter->i_getId());
aFilter->i_getId() = NULL;
}
}
@@ -857,10 +857,10 @@
{
/* update the filter in the proxy */
ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
- pProxySvc->removeFilter(aFilter->i_getId());
+// pProxySvc->removeFilter(aFilter->i_getId());
if (aFilter->i_getData().mRemote.isMatch(false))
{
- aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
+// aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
}
}
}
@@ -1027,13 +1027,10 @@
LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters));
AutoCaller autoCaller(this);
- AssertComRCReturn(autoCaller.rc(), false);
+ AssertComRCReturnRC(autoCaller.rc());
AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
- USBProxyService *pProxySvc = m->pHost->i_usbProxyService();
- AssertReturn(pProxySvc, E_FAIL);
-
DeviceFilterList::const_iterator it = m->llDeviceFilters->begin();
while (it != m->llDeviceFilters->end())
{
@@ -1044,10 +1041,13 @@
&& pFilter->i_getData().mRemote.isMatch(false) /* and if the filter is NOT remote */
)
{
+ USBProxyService *pProxySvc = m->pHost->i_usbProxyService();
+ AssertReturn(pProxySvc, E_FAIL);
+
if (aInsertFilters)
{
AssertReturn(pFilter->i_getId() == NULL, E_FAIL);
- pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
+// pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
}
else
{
@@ -1056,7 +1056,7 @@
* process crash for example. So, don't assert that ID != NULL. */
if (pFilter->i_getId() != NULL)
{
- pProxySvc->removeFilter(pFilter->i_getId());
+// pProxySvc->removeFilter(pFilter->i_getId());
pFilter->i_getId() = NULL;
}
}
--- a/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
@@ -599,7 +614,8 @@
uint64_t tsNext = vusbRhR3ProcessFrame(pThis, false /* fCallback */);
- if (tsNext >= 250 * RT_NS_1US)
+ /* spinning as high priority thread is evil */
+ if (true) //tsNext >= 250 * RT_NS_1US)
{
rc = RTSemEventMultiWaitEx(pThis->hSemEventPeriodFrame, RTSEMWAIT_FLAGS_RELATIVE | RTSEMWAIT_FLAGS_NANOSECS | RTSEMWAIT_FLAGS_UNINTERRUPTIBLE,
tsNext);