vbox6: cleanup code and log output

Issue #4031
This commit is contained in:
Christian Helmuth 2021-03-29 16:18:25 +02:00 committed by Norman Feske
parent 1a57a5a959
commit 4cdfeb13e2
8 changed files with 58 additions and 79 deletions

View File

@ -506,7 +506,6 @@ static DECLCALLBACK(int) xhciR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFG
uint32_t const mmio_flags = IOMMMIO_FLAGS_READ_DWORD
| IOMMMIO_FLAGS_WRITE_DWORD_ZEROED;
// | IOMMMIO_FLAGS_DBGSTOP_ON_COMPLICATED_WRITE;
rc = PDMDevHlpPCIIORegionCreateMmio(pDevIns, 0, pThis->ctl->mmio_size(),
PCI_ADDRESS_SPACE_MEM,
@ -529,7 +528,7 @@ const PDMDEVREG g_DeviceXHCI =
/* .cMaxInstances = */ ~0U,
/* .uSharedVersion = */ 42,
/* .cbInstanceShared = */ sizeof(XHCI),
/* .cbInstanceCC = */ 0, //sizeof(XHCICC),
/* .cbInstanceCC = */ 0, /* sizeof(XHCICC) */
/* .cbInstanceRC = */ 0,
/* .cMaxPciDevices = */ 1,
/* .cMaxMsixVectors = */ 0,

View File

@ -35,7 +35,7 @@ HRESULT Machine::exportTo(const ComPtr<IAppliance> &aAppliance,
int com::VBoxLogRelCreate(char const*, char const*, unsigned int, char const*,
char const*, unsigned int, unsigned int, unsigned int,
unsigned int, unsigned long, RTERRINFO*) TRACE(NS_OK)
unsigned int, unsigned long, RTERRINFO*) { return NS_OK; }
/* DisplayPNGUtil.cpp */
@ -50,7 +50,7 @@ int DisplayMakePNG(uint8_t *, uint32_t, uint32_t, uint8_t **, uint32_t *,
#include "VBox/com/com.h"
HRESULT com::Initialize(uint32_t) TRACE(S_OK)
HRESULT com::Initialize(uint32_t) { return S_OK; }
HRESULT com::Shutdown() STOP
@ -102,15 +102,15 @@ USBProxyService::~USBProxyService() { }
HRESULT USBProxyService::init() { return VINF_SUCCESS; }
RWLockHandle *USBProxyService::lockHandle() const STOP
HRESULT USBProxyService::autoCaptureDevicesForVM(SessionMachine *) TRACE(S_OK)
HRESULT USBProxyService::autoCaptureDevicesForVM(SessionMachine *) { return S_OK; }
HRESULT USBProxyService::captureDeviceForVM(SessionMachine *, IN_GUID,
com::Utf8Str const&) STOP
HRESULT USBProxyService::detachAllDevicesFromVM(SessionMachine*, bool, bool) STOP
HRESULT USBProxyService::detachAllDevicesFromVM(SessionMachine*, bool, bool) { return S_OK; }
HRESULT USBProxyService::detachDeviceFromVM(SessionMachine*, IN_GUID, bool) STOP
void *USBProxyService::insertFilter(PCUSBFILTER aFilter) STOP
void USBProxyService::removeFilter(void *aId) STOP
int USBProxyService::getLastError() TRACE(VINF_SUCCESS)
bool USBProxyService::isActive() TRACE(false)
int USBProxyService::getLastError() { return VINF_SUCCESS; }
bool USBProxyService::isActive() { return false; }
HRESULT USBProxyService::removeUSBDeviceSource(com::Utf8Str const&) STOP
HRESULT USBProxyService::addUSBDeviceSource(com::Utf8Str const&,
com::Utf8Str const&,
@ -124,7 +124,7 @@ using USBDeviceSourceList =
std::__cxx11::list<settings::USBDeviceSource, std::allocator<settings::USBDeviceSource> >;
HRESULT USBProxyService::i_saveSettings(USBDeviceSourceList &) TRACE(VINF_SUCCESS)
HRESULT USBProxyService::i_loadSettings(USBDeviceSourceList const &) TRACE(VINF_SUCCESS)
HRESULT USBProxyService::i_loadSettings(USBDeviceSourceList const &) { return VINF_SUCCESS; }
/* USBFilter.cpp */
@ -144,12 +144,12 @@ HRESULT VirtualBox::createAppliance(ComPtr<IAppliance> &) STOP
#include "CloudProviderManagerImpl.h"
CloudProviderManager::CloudProviderManager() TRACE()
CloudProviderManager::CloudProviderManager() { }
CloudProviderManager::~CloudProviderManager() { }
HRESULT CloudProviderManager::FinalConstruct() TRACE(VINF_SUCCESS)
HRESULT CloudProviderManager::FinalConstruct() { return VINF_SUCCESS; }
void CloudProviderManager::FinalRelease() TRACE()
HRESULT CloudProviderManager::init() TRACE(VINF_SUCCESS)
HRESULT CloudProviderManager::init() { return VINF_SUCCESS; }
void CloudProviderManager::uninit() STOP
HRESULT CloudProviderManager::getProviderById (com::Guid const&, ComPtr<ICloudProvider>&) STOP
HRESULT CloudProviderManager::getProviderByName (com::Utf8Str const&, ComPtr<ICloudProvider>&) STOP
@ -167,7 +167,7 @@ int NetIfGetLinkSpeed(const char *, uint32_t *) STOP
int NetIfGetState(const char *, NETIFSTATUS *) STOP
int NetIfRemoveHostOnlyNetworkInterface(VirtualBox *, const Guid &, IProgress **) STOP
int NetIfList(std::__cxx11::list<ComObjPtr<HostNetworkInterface>,
std::allocator<ComObjPtr<HostNetworkInterface> > >&) TRACE(VINF_SUCCESS)
std::allocator<ComObjPtr<HostNetworkInterface> > >&) { return VINF_SUCCESS; }
/* fatvfs.cpp */
@ -214,7 +214,7 @@ RTDECL(int) RTSystemQueryTotalRam(uint64_t *pcb) STOP
HostDnsServiceResolvConf::~HostDnsServiceResolvConf() { }
HRESULT HostDnsServiceResolvConf::init(HostDnsMonitorProxy*, char const*) TRACE(VINF_SUCCESS)
HRESULT HostDnsServiceResolvConf::init(HostDnsMonitorProxy*, char const*) { return VINF_SUCCESS; }
void HostDnsServiceResolvConf::uninit() STOP
@ -253,9 +253,9 @@ int AutostartDb::addAutostopVM (char const *) STOP
int AutostartDb::removeAutostopVM (char const *) STOP
int AutostartDb::removeAutostartVM(char const *) STOP
AutostartDb::AutostartDb() TRACE()
AutostartDb::~AutostartDb() { }
int AutostartDb::setAutostartDbPath(char const*) TRACE(VINF_SUCCESS)
AutostartDb::AutostartDb() { }
AutostartDb::~AutostartDb() { }
int AutostartDb::setAutostartDbPath(char const*) { return VINF_SUCCESS; }
RT_C_DECLS_BEGIN
@ -263,28 +263,28 @@ static_assert(sizeof(RTR0PTR) == sizeof(RTR3PTR), "pointer transformation bug");
static_assert(sizeof(RTR0PTR) == sizeof(void *) , "pointer transformation bug");
static_assert(sizeof(RTR3PTR) == sizeof(RTR0PTR), "pointer transformation bug");
int emR3InitDbg(PVM) TRACE(VINF_SUCCESS)
int SELMR3Init(PVM) TRACE(VINF_SUCCESS)
int SELMR3Term(PVM) TRACE(VINF_SUCCESS)
void SELMR3Relocate(PVM) TRACE()
void SELMR3Reset(PVM) TRACE()
int emR3InitDbg(PVM) { return VINF_SUCCESS; }
int SELMR3Init(PVM) { return VINF_SUCCESS; }
int SELMR3Term(PVM) { return VINF_SUCCESS; }
void SELMR3Relocate(PVM) { }
void SELMR3Reset(PVM) { }
/* module loader of pluggable device manager */
int pdmR3LdrInitU(PUVM) TRACE(VINF_SUCCESS)
int PDMR3LdrLoadVMMR0U(PUVM) TRACE(VINF_SUCCESS)
void PDMR3LdrRelocateU(PUVM, RTGCINTPTR) TRACE()
int pdmR3LoadR3U(PUVM, const char *, const char *) TRACE(VINF_SUCCESS)
int pdmR3LdrInitU(PUVM) { return VINF_SUCCESS; }
int PDMR3LdrLoadVMMR0U(PUVM) { return VINF_SUCCESS; }
void PDMR3LdrRelocateU(PUVM, RTGCINTPTR) { }
int pdmR3LoadR3U(PUVM, const char *, const char *) { return VINF_SUCCESS; }
void pdmR3LdrTermU(PUVM) TRACE()
int PDMR3LdrLoadR0(PUVM, const char *, const char *) TRACE(VINF_SUCCESS)
int PDMR3LdrLoadR0(PUVM, const char *, const char *) { return VINF_SUCCESS; }
char *pdmR3FileR3(const char * file, bool)
{
char * pv = reinterpret_cast<char *>(RTMemTmpAllocZ(1));
if (debug)
if (false)
Genode::log(__func__, ": file ", file, " ", (void *)pv, " ", __builtin_return_address(0));
TRACE(pv)
return pv;
}
const char * RTBldCfgRevisionStr(void)
@ -294,7 +294,7 @@ const char * RTBldCfgRevisionStr(void)
DECLHIDDEN(int) rtProcInitExePath(char *pszPath, size_t cchPath)
{
Genode::copy_cstring(pszPath, "/undefined_ProcInitExePath", cchPath);
Genode::copy_cstring(pszPath, "/virtualbox6", cchPath);
return VINF_SUCCESS;
}
@ -306,7 +306,7 @@ RT_C_DECLS_END
#include "HostHardwareLinux.h"
int VBoxMainDriveInfo::updateDVDs() TRACE(VINF_SUCCESS)
int VBoxMainDriveInfo::updateDVDs() { return VINF_SUCCESS; }
/* buildconfig.cpp */
@ -321,7 +321,7 @@ uint32_t RTBldCfgVersionMinor(void) { return ~0; }
/* VDIfTcpNet.cpp */
VBOXDDU_DECL(int) VDIfTcpNetInstDefaultCreate(PVDIFINST, PVDINTERFACE *) TRACE(VINF_SUCCESS)
VBOXDDU_DECL(int) VDIfTcpNetInstDefaultCreate(PVDIFINST, PVDINTERFACE *) { return VINF_SUCCESS; }
/* SharedFolderImpl.cpp */
@ -344,12 +344,12 @@ HRESULT Console::i_teleporterTrg(PUVM, IMachine *, Utf8Str *, bool, Progress *,
#include <DBGFInternal.h>
int dbgfR3BpInit(VM*) TRACE(VINF_SUCCESS)
int dbgfR3BpInit(VM*) { return VINF_SUCCESS; }
/* DBGFR3BugCheck.cpp */
int dbgfR3BugCheckInit(VM*) TRACE(VINF_SUCCESS)
int dbgfR3BugCheckInit(VM*) { return VINF_SUCCESS; }
/* dbgcfg.cpp */
@ -371,9 +371,9 @@ uint32_t RTDbgAsRelease(RTDBGAS) { return 1; /* fake reference counter */ }
/* DBGFAddrSpace.cpp */
int dbgfR3AsInit(PUVM) TRACE(VINF_SUCCESS)
int dbgfR3AsInit(PUVM) { return VINF_SUCCESS; }
void dbgfR3AsTerm(PUVM) { }
void dbgfR3AsRelocate(PUVM, RTGCUINTPTR) TRACE()
void dbgfR3AsRelocate(PUVM, RTGCUINTPTR) { }
int DBGFR3AsSymbolByAddr(PUVM, RTDBGAS, PCDBGFADDRESS, uint32_t,
PRTGCINTPTR, PRTDBGSYMBOL, PRTDBGMOD) TRACE(VERR_NOT_IMPLEMENTED)
@ -406,7 +406,7 @@ VMMR3DECL(int) PGMR3MappingsSize(PVM pVM, uint32_t *pcb)
#include <PGMInternal.h>
int pgmR3InitSavedState(PVM, uint64_t) TRACE(VINF_SUCCESS)
int pgmR3InitSavedState(PVM, uint64_t) { return VINF_SUCCESS; }
/* nsProxyRelease.cpp */

View File

@ -288,8 +288,6 @@ static DECLCALLBACK(int) drvNicNetworkUp_BeginXmit(PPDMINETWORKUP pInterface, bo
static DECLCALLBACK(int) drvNicNetworkUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin,
PCPDMNETWORKGSO pGso, PPPDMSCATTERGATHER ppSgBuf)
{
// PDRVNIC pThis = PDMINETWORKUP_2_DRVNIC(pInterface);
/*
* Allocate a scatter / gather buffer descriptor that is immediately
* followed by the buffer space of its single segment. The GSO context
@ -329,7 +327,6 @@ static DECLCALLBACK(int) drvNicNetworkUp_AllocBuf(PPDMINETWORKUP pInterface, siz
*/
static DECLCALLBACK(int) drvNicNetworkUp_FreeBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf)
{
// PDRVNIC pThis = PDMINETWORKUP_2_DRVNIC(pInterface);
if (pSgBuf)
{
Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
@ -351,9 +348,6 @@ static DECLCALLBACK(int) drvNicNetworkUp_SendBuf(PPDMINETWORKUP pInterface, PPDM
AssertPtr(pSgBuf);
Assert((pSgBuf->fFlags & PDMSCATTERGATHER_FLAGS_MAGIC_MASK) == PDMSCATTERGATHER_FLAGS_MAGIC);
/* Set an FTM checkpoint as this operation changes the state permanently. */
// PDMDrvHlpFTSetCheckpoint(pThis->pDrvIns, FTMCHECKPOINTTYPE_NETWORK);
int rc;
if (!pSgBuf->pvUser)
{
@ -397,7 +391,6 @@ static DECLCALLBACK(int) drvNicNetworkUp_SendBuf(PPDMINETWORKUP pInterface, PPDM
*/
static DECLCALLBACK(void) drvNicNetworkUp_EndXmit(PPDMINETWORKUP pInterface)
{
// PDRVNIC pThis = PDMINETWORKUP_2_DRVNIC(pInterface);
}

View File

@ -53,12 +53,10 @@ extern "C" int sched_yield()
return 0;
}
extern "C" int sched_get_priority_max(int policy) TRACE(0)
extern "C" int sched_get_priority_min(int policy) TRACE(0)
extern "C" int pthread_setschedparam(pthread_t thread, int policy,
const struct sched_param *param) TRACE(0)
extern "C" int pthread_getschedparam(pthread_t thread, int *policy,
struct sched_param *param) TRACE(0)
extern "C" int sched_get_priority_max(int policy) { return 0; }
extern "C" int sched_get_priority_min(int policy) { return 0; }
extern "C" int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param) { return 0; }
extern "C" int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param) { return 0; }
namespace Pthread {

View File

@ -15,6 +15,7 @@
#define _STUB_MACROS_H_
#include <base/log.h>
#include <base/sleep.h>
#define TRACE(retval) \
{ \
@ -29,22 +30,8 @@
Genode::error(__PRETTY_FUNCTION__, " called (", __FILE__, ":", __LINE__, "), " \
"not implemented, eip=", \
__builtin_return_address(0)); \
while (1); \
\
class Not_implemented { }; \
throw Not_implemented(); /* sparing the need for a return value */ \
}
#define DUMMY_STATIC(X) \
{ \
static X dummy; \
Genode::error("static ", __PRETTY_FUNCTION__, " called (", __FILE__, "), " \
"not implemented, eip=", \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return dummy; \
/* noreturn function sparing the need for a return value */ \
Genode::sleep_forever(); \
}
#endif /* _STUB_MACROS_H_ */

View File

@ -501,7 +501,8 @@ static int vmmr0_pdm_device_create(PDMDEVICECREATEREQ &request)
static int vmmr0_pdm_device_gen_call(PDMDEVICEGENCALLREQ &request)
{
warning("PDMDEVICEGENCALLREQ PDMDEVICEGENCALL=", (int)request.enmCall, " not implemented");
if (false)
warning("PDMDEVICEGENCALLREQ PDMDEVICEGENCALL=", (int)request.enmCall, " not implemented");
return VINF_SUCCESS;
}
@ -713,7 +714,7 @@ int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted,
}
int suplibOsTerm(PSUPLIBDATA pThis) TRACE(VINF_SUCCESS)
int suplibOsTerm(PSUPLIBDATA) { return VINF_SUCCESS; }
int suplibOsInstall(void) TRACE(VERR_NOT_IMPLEMENTED)

View File

@ -56,8 +56,9 @@ void Sup::Gmm::_update_pool_size()
size_t const new_size_pages = _reservation_pages.value + _alloc_ex_pages.value;
if (new_size_pages <= size_pages) {
warning("Can't shrink guest memory pool from ",
size_pages, " to ", new_size_pages, " pages");
if (false)
warning("Can't shrink guest memory pool from ",
size_pages, " to ", new_size_pages, " pages");
return;
}

View File

@ -19,7 +19,7 @@ static bool const debug = true;
#include <SpecialSystemDirectory.h>
nsresult GetSpecialSystemDirectory(SystemDirectories, nsILocalFile**) STOP
void StartupSpecialSystemDirectory() TRACE()
void StartupSpecialSystemDirectory() { }
#include <nsFastLoadService.h>
@ -54,19 +54,19 @@ nsresult nsStringInputStreamConstructor(nsISupports*, nsID const&, void**) STOP
#include <xptinfo.h>
nsIInterfaceInfoManager *XPTI_GetInterfaceInfoManager() TRACE(nullptr)
nsIInterfaceInfoManager *XPTI_GetInterfaceInfoManager() { return nullptr; }
extern "C" {
#include <_freebsd.h>
#include <primpl.h>
void _MD_EarlyInit(void) TRACE()
void _PR_InitCPUs(void) TRACE()
void _pr_init_ipv6(void) TRACE()
void _PR_InitLayerCache(void) TRACE()
void _PR_InitLinker(void) TRACE()
void _PR_InitSegs(void) TRACE()
void _PR_InitStacks(void) TRACE()
void _MD_EarlyInit(void) { }
void _PR_InitCPUs(void) { }
void _pr_init_ipv6(void) { }
void _PR_InitLayerCache(void) { }
void _PR_InitLinker(void) { }
void _PR_InitSegs(void) { }
void _PR_InitStacks(void) { }
}