From 1a18c6b727d506e6bd8c3452658bcdd60be26e73 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 26 Apr 2017 11:19:40 +0200 Subject: [PATCH] vbox4/5: enable key/value store for guest addition required for enable vbox 5 guest additions, which otherwise deny to work Issue #2338 --- repos/ports/lib/mk/virtualbox-common.inc | 11 ++--- repos/ports/lib/mk/virtualbox-runtime.mk | 1 + repos/ports/lib/mk/virtualbox5-common.inc | 4 ++ repos/ports/ports/virtualbox.hash | 2 +- repos/ports/ports/virtualbox.port | 3 +- repos/ports/ports/virtualbox5.hash | 2 +- repos/ports/ports/virtualbox5.port | 1 + repos/ports/src/virtualbox/dummies.cc | 5 +++ repos/ports/src/virtualbox/dynlib.cc | 4 +- .../src/virtualbox/frontend/VBoxEvents.h | 2 + .../src/virtualbox/frontend/VirtualBoxBase.h | 30 +++++++++++++ .../ports/src/virtualbox/frontend/console.cc | 1 + repos/ports/src/virtualbox/libc.cc | 15 +++++-- repos/ports/src/virtualbox/mm.cc | 8 ++-- .../src/virtualbox/patches/hostservice.patch | 10 +++++ .../src/virtualbox/patches/vbox_main.patch | 43 +++++++++++++++++-- repos/ports/src/virtualbox/target.inc | 2 + repos/ports/src/virtualbox5/dummies.cc | 6 +++ .../src/virtualbox5/frontend/VBoxEvents.h | 2 + .../src/virtualbox5/frontend/VirtualBoxBase.h | 20 ++++++++- .../ports/src/virtualbox5/frontend/console.cc | 3 +- repos/ports/src/virtualbox5/frontend/fb.h | 25 ++++++++++- .../src/virtualbox5/patches/vbox_main.patch | 12 +++--- repos/ports/src/virtualbox5/target.inc | 2 + 24 files changed, 182 insertions(+), 32 deletions(-) diff --git a/repos/ports/lib/mk/virtualbox-common.inc b/repos/ports/lib/mk/virtualbox-common.inc index 090ef03cc8..1254492d58 100644 --- a/repos/ports/lib/mk/virtualbox-common.inc +++ b/repos/ports/lib/mk/virtualbox-common.inc @@ -48,11 +48,11 @@ VBOX_CC_OPT += -DVBOX_WITH_E1000 VBOX_CC_OPT += -DVBOX_WITH_AHCI -ifneq ($(call select_from_ports,virtualbox),) -VIRTUALBOX_VERSION_MAJOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_MAJOR = " | grep -v "'VBOX_VERSION_MAJOR" | sed "s/^.*= //") -VIRTUALBOX_VERSION_MINOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_MINOR = " | grep -v "'VBOX_VERSION_MINOR" | sed "s/^.*= //") -VIRTUALBOX_VERSION_BUILD := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_BUILD = " | grep -v "'VBOX_VERSION_BUILD" | sed "s/^.*= //") -endif +VBOX_CC_OPT += -DVBOX_WITH_GUEST_PROPS + +VIRTUALBOX_VERSION_MAJOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_MAJOR = " | grep -v "'VBOX_VERSION_MAJOR" | sed "s/^.*= //") +VIRTUALBOX_VERSION_MINOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_MINOR = " | grep -v "'VBOX_VERSION_MINOR" | sed "s/^.*= //") +VIRTUALBOX_VERSION_BUILD := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_BUILD = " | grep -v "'VBOX_VERSION_BUILD" | sed "s/^.*= //") ifeq ($(VBOX_MACH),x86_32) VIRTUALBOX_PACKAGE_STRING = GenodeOS_32BIT_GENERIC @@ -64,6 +64,7 @@ VBOX_CC_OPT += -DVBOX_VERSION_MAJOR=$(VIRTUALBOX_VERSION_MAJOR) \ -DVBOX_VERSION_MINOR=$(VIRTUALBOX_VERSION_MINOR) \ -DVBOX_VERSION_BUILD=$(VIRTUALBOX_VERSION_BUILD) \ -DVBOX_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\" \ + -DVBOX_VERSION_STRING_RAW=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)\" \ -DVBOX_PACKAGE_STRING=\"$(VIRTUALBOX_PACKAGE_STRING)\" \ -DVBOX_API_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR)_$(VIRTUALBOX_VERSION_MINOR)\" \ -DIPRT_BLDCFG_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\" \ diff --git a/repos/ports/lib/mk/virtualbox-runtime.mk b/repos/ports/lib/mk/virtualbox-runtime.mk index 6c6330a82a..e0ec66210a 100644 --- a/repos/ports/lib/mk/virtualbox-runtime.mk +++ b/repos/ports/lib/mk/virtualbox-runtime.mk @@ -100,6 +100,7 @@ SRC_CC += Runtime/common/string/strformatrt.cpp SRC_CC += Runtime/common/string/strformattype.cpp SRC_CC += Runtime/common/string/stringalloc.cpp SRC_CC += Runtime/common/string/strprintf.cpp +SRC_CC += Runtime/common/string/strspace.cpp SRC_CC += Runtime/common/string/strstrip.cpp SRC_CC += Runtime/common/string/strtonum.cpp SRC_CC += Runtime/common/string/unidata-lower.cpp diff --git a/repos/ports/lib/mk/virtualbox5-common.inc b/repos/ports/lib/mk/virtualbox5-common.inc index 0cc5861e19..d098c808a1 100644 --- a/repos/ports/lib/mk/virtualbox5-common.inc +++ b/repos/ports/lib/mk/virtualbox5-common.inc @@ -57,6 +57,9 @@ VBOX_CC_OPT += -DVBOX_WITH_MULTI_CORE VBOX_CC_OPT += -DVBOX_WITH_AUDIO_OSS +# Required for guest additions 5++ +VBOX_CC_OPT += -DVBOX_WITH_GUEST_PROPS + VIRTUALBOX_VERSION_MAJOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_MAJOR = " | grep -v "'VBOX_VERSION_MAJOR" | sed "s/^.*= //") VIRTUALBOX_VERSION_MINOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_MINOR = " | grep -v "'VBOX_VERSION_MINOR" | sed "s/^.*= //") VIRTUALBOX_VERSION_BUILD := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk 2>/dev/null | grep "VBOX_VERSION_BUILD = " | grep -v "'VBOX_VERSION_BUILD" | sed "s/^.*= //") @@ -71,6 +74,7 @@ VBOX_CC_OPT += -DVBOX_VERSION_MAJOR=$(VIRTUALBOX_VERSION_MAJOR) \ -DVBOX_VERSION_MINOR=$(VIRTUALBOX_VERSION_MINOR) \ -DVBOX_VERSION_BUILD=$(VIRTUALBOX_VERSION_BUILD) \ -DVBOX_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\" \ + -DVBOX_VERSION_STRING_RAW=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)\" \ -DVBOX_PACKAGE_STRING=\"$(VIRTUALBOX_PACKAGE_STRING)\" \ -DVBOX_API_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR)_$(VIRTUALBOX_VERSION_MINOR)\" \ -DIPRT_BLDCFG_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\" \ diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash index 35b0c24a35..afd0f4937b 100644 --- a/repos/ports/ports/virtualbox.hash +++ b/repos/ports/ports/virtualbox.hash @@ -1 +1 @@ -8b8762f34e586d96ec89085422452342c6908f80 +38ede8c31e58b3d8af091117dbf722adfb9933eb diff --git a/repos/ports/ports/virtualbox.port b/repos/ports/ports/virtualbox.port index da71ca0ece..3f7ce9a5a8 100644 --- a/repos/ports/ports/virtualbox.port +++ b/repos/ports/ports/virtualbox.port @@ -66,6 +66,7 @@ VBOX_MAIN_INC += USBDeviceImpl HostUSBDeviceImpl Matching Wrapper VBOX_SRC_VBOX := VMM Devices Runtime GuestHost/HGSMI Storage Disassembler VBOX_SRC_VBOX += HostServices/SharedFolders Main/xml/Settings.cpp VBOX_SRC_VBOX += HostServices/SharedClipboard +VBOX_SRC_VBOX += HostServices/GuestProperties VBOX_SRC_VBOX += Main/xml/VirtualBox-settings.xsd Main/xml/SchemaDefs.xsl VBOX_SRC_VBOX += $(addsuffix .h, $(addprefix Main/include/, $(VBOX_MAIN_INC))) VBOX_SRC_VBOX += $(addsuffix .cpp, $(addprefix Main/src-client/, $(VBOX_MAIN_CLI))) @@ -84,7 +85,7 @@ VBOX_INC += usb.h usbfilter.h VBOX_INC_COM := array.h assert.h AutoLock.h ErrorInfo.h EventQueue.h Guid.h VBOX_INC_COM += list.h MultiResult.h string.h -VBOX_INC_HOST := VBoxClipboardExt.h VBoxClipboardSvc.h +VBOX_INC_HOST := VBoxClipboardExt.h VBoxClipboardSvc.h GuestPropertySvc.h VBOX_CONTENT += $(addprefix src/VBox/,$(VBOX_SRC_VBOX)) VBOX_CONTENT += $(addprefix include/VBox/, $(VBOX_INC)) diff --git a/repos/ports/ports/virtualbox5.hash b/repos/ports/ports/virtualbox5.hash index c4f239cb49..831c6c9779 100644 --- a/repos/ports/ports/virtualbox5.hash +++ b/repos/ports/ports/virtualbox5.hash @@ -1 +1 @@ -7e47c93bea1d7b2a3b69817994b7d3d0a5f0a460 +b1d0347a4935568cc5000edffe0018674004a17a diff --git a/repos/ports/ports/virtualbox5.port b/repos/ports/ports/virtualbox5.port index cc604b0c95..f0867e3315 100644 --- a/repos/ports/ports/virtualbox5.port +++ b/repos/ports/ports/virtualbox5.port @@ -79,6 +79,7 @@ VBOX_MAIN_INC += ThreadTask USBProxyBackend VBOX_SRC_VBOX := VMM Devices Runtime GuestHost/HGSMI Storage Disassembler VBOX_SRC_VBOX += HostServices/SharedFolders Main/xml/Settings.cpp VBOX_SRC_VBOX += HostServices/SharedClipboard +VBOX_SRC_VBOX += HostServices/GuestProperties VBOX_SRC_VBOX += Main/xml/VirtualBox-settings.xsd Main/xml/SchemaDefs.xsl VBOX_SRC_VBOX += Main/idl/docstrip.xsl Main/idl/VirtualBox.xidl VBOX_SRC_VBOX += Main/idl/apiwrap-server.xsl diff --git a/repos/ports/src/virtualbox/dummies.cc b/repos/ports/src/virtualbox/dummies.cc index 7fafc80682..b192065609 100644 --- a/repos/ports/src/virtualbox/dummies.cc +++ b/repos/ports/src/virtualbox/dummies.cc @@ -197,4 +197,9 @@ char *pdmR3FileR3(const char * file, bool) TRACE(pv) } +const char * RTBldCfgRevisionStr(void) +{ + return "Genode"; +} + RT_C_DECLS_END diff --git a/repos/ports/src/virtualbox/dynlib.cc b/repos/ports/src/virtualbox/dynlib.cc index c610a23fb2..2f02e3f2e7 100644 --- a/repos/ports/src/virtualbox/dynlib.cc +++ b/repos/ports/src/virtualbox/dynlib.cc @@ -24,6 +24,7 @@ extern "C" { DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad_sf (VBOXHGCMSVCFNTABLE *ptable); DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad_cb (VBOXHGCMSVCFNTABLE *ptable); +DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad_gp (VBOXHGCMSVCFNTABLE *ptable); static struct shared { @@ -32,7 +33,8 @@ static struct shared { void * func; } shared[] = { { "VBoxSharedFolders", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad_sf }, - { "VBoxSharedClipboard", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad_cb } + { "VBoxSharedClipboard", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad_cb }, + { "VBoxGuestPropSvc", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad_gp } }; diff --git a/repos/ports/src/virtualbox/frontend/VBoxEvents.h b/repos/ports/src/virtualbox/frontend/VBoxEvents.h index 189848a9a4..f2519b943b 100644 --- a/repos/ports/src/virtualbox/frontend/VBoxEvents.h +++ b/repos/ports/src/virtualbox/frontend/VBoxEvents.h @@ -41,3 +41,5 @@ void fireNATNetworkPortForwardEvent(IEventSource* aSource, CBSTR a_networkName, void fireHostNameResolutionConfigurationChangeEvent(IEventSource* aSource); void fireMediumChangedEvent(IEventSource *, IMediumAttachment *); + +#define fireGuestPropertyChangedEvent(a, b, c, d, e) diff --git a/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h b/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h index 47cf2cd5c0..fa2f1337a2 100644 --- a/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h +++ b/repos/ports/src/virtualbox/frontend/VirtualBoxBase.h @@ -1,3 +1,22 @@ +/** + * VirtualBox COM base class definition adjusted to Genode + * - based on VBox/Main/include/VirtualBoxBase.h + */ + +/* + * Copyright (C) 2006-2013 Oracle Corporation + * Copyright (C) 2013-2017 Genode Labs GmbH + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + + #ifndef ____H_VIRTUALBOXBASEIMPL #define ____H_VIRTUALBOXBASEIMPL @@ -348,6 +367,17 @@ class Backupable : public Shareable return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \ } while (0) +/** + * Checks that the pointer argument is a valid pointer or NULL and returns + * E_INVALIDARG + extended error info on failure. + * @param arg Input pointer-type argument (strings, interface pointers...) + */ +#define CheckComArgMaybeNull(arg) \ + do { \ + if (RT_UNLIKELY(!RT_VALID_PTR(arg) && (arg) != NULL)) \ + return setError(E_INVALIDARG, tr("Argument %s is an invalid pointer"), #arg); \ + } while (0) + /** * Checks that the given expression (that must involve the argument) is true and * returns E_INVALIDARG + extended error info on failure. diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc index 6b4772e135..ff16637426 100644 --- a/repos/ports/src/virtualbox/frontend/console.cc +++ b/repos/ports/src/virtualbox/frontend/console.cc @@ -386,6 +386,7 @@ void GenodeConsole::init_backends(IKeyboard * gKeyboard, IMouse * gMouse) Genodefb *fb = dynamic_cast(d->getFramebuffer()); fb->mode_sigh(_mode_change_signal_dispatcher); + handle_mode_change(); } void GenodeConsole::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelative, diff --git a/repos/ports/src/virtualbox/libc.cc b/repos/ports/src/virtualbox/libc.cc index fb4133d648..fab0629f04 100644 --- a/repos/ports/src/virtualbox/libc.cc +++ b/repos/ports/src/virtualbox/libc.cc @@ -154,21 +154,28 @@ extern "C" char *getenv(const char *name) // "+dev_pcnet.e.l.f" // "+dev_pic.e.l.f" // "+dev_apic.e.l.f" -// "+dev_vmm.e" // "+usb_mouse.e.l.f" -// "+main.e.l.f" -// "+hgcm.e.l.f" +// "+main.e.l3.f" // "+shared_folders.e.l.f" // "+drv_host_serial.e.l.f" // "+dev_audio.e.l.f" // "+dev_hda.e" // "+drv_host_audio.e.l.f" // "+drv_audio.e.l.f" +// "+dev_vmm_backdoor.e.l.f" +// "+hgcm.e.l.f" +// "+dev_vmm.e.l.f" ; + /* + * see https://www.virtualbox.org/wiki/VBoxLogging for useful tips to + * enable useful debugging of Guest additions in Windows/Linux together + * with +dev_vmm_backdoor, hgcm and dev_vmm + */ + if (Genode::strcmp(name, "VBOX_LOG_FLAGS") == 0 || Genode::strcmp(name, "VBOX_RELEASE_LOG_FLAGS") == 0) - return (char *)"thread"; + return (char *)"thread"; //" tsc"; return 0; } diff --git a/repos/ports/src/virtualbox/mm.cc b/repos/ports/src/virtualbox/mm.cc index 4326e648ef..6f1e27c889 100644 --- a/repos/ports/src/virtualbox/mm.cc +++ b/repos/ports/src/virtualbox/mm.cc @@ -324,10 +324,10 @@ int MMR3InitPaging(PVM pVM) char * MMR3HeapStrDup(PVM pVM, MMTAG enmTag, const char *psz) { - size_t cch = strlen(psz) + 1; - char *pszDup = (char *)MMR3HeapAllocU(pVM->pUVM, enmTag, cch); - if (pszDup) - memcpy(pszDup, psz, cch); + size_t cch = strlen(psz) + 1; + char *pszDup = (char *)MMR3HeapAllocU(pVM->pUVM, enmTag, cch); + if (pszDup) + memcpy(pszDup, psz, cch); return pszDup; } diff --git a/repos/ports/src/virtualbox/patches/hostservice.patch b/repos/ports/src/virtualbox/patches/hostservice.patch index 85301fe2c1..6830708e69 100644 --- a/repos/ports/src/virtualbox/patches/hostservice.patch +++ b/repos/ports/src/virtualbox/patches/hostservice.patch @@ -18,3 +18,13 @@ { int rc = VINF_SUCCESS; ++++ a/src/app/virtualbox/src/VBox/HostServices/GuestProperties/service.cpp +@@ -1627,7 +1627,7 @@ + /** + * @copydoc VBOXHGCMSVCLOAD + */ +-extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable) ++extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad_gp (VBOXHGCMSVCFNTABLE *ptable) + { + int rc = VERR_IPE_UNINITIALIZED_STATUS; + diff --git a/repos/ports/src/virtualbox/patches/vbox_main.patch b/repos/ports/src/virtualbox/patches/vbox_main.patch index a7f0c47c6e..95cef9ab18 100644 --- a/repos/ports/src/virtualbox/patches/vbox_main.patch +++ b/repos/ports/src/virtualbox/patches/vbox_main.patch @@ -533,15 +533,33 @@ index 69e3109..3c534df 100644 /** * Uninitializes the Console object. */ -@@ -1035,6 +1066,8 @@ void Console::guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId) - - #endif /* VBOX_WITH_GUEST_PROPS */ +@@ -817,6 +848,8 @@ + LogFlowThisFuncLeave(); + } +#endif /* #if 0 */ + - bool Console::isResetTurnedIntoPowerOff(void) + #ifdef VBOX_WITH_GUEST_PROPS + + /** +@@ -858,6 +891,8 @@ + LogRel(("RESET: Unable to enumerate guest properties, rc=%Rhrc\n", hrc)); + } + ++#if 0 ++ + bool Console::guestPropertiesVRDPEnabled(void) { Bstr value; +@@ -1055,6 +1090,8 @@ + return; + } + ++#endif /* #if 0 */ ++ + #endif /* VBOX_WITH_GUEST_PROPS */ + + bool Console::isResetTurnedIntoPowerOff(void) @@ -1046,6 +1079,8 @@ bool Console::isResetTurnedIntoPowerOff(void) return false; } @@ -690,6 +708,23 @@ index 69e3109..3c534df 100644 HRESULT Console::onVideoCaptureChange() { AutoCaller autoCaller(this); +@@ -5778,6 +5844,8 @@ + return hrc; + } + ++#endif /* #if 0 */ ++ + /** + * @note Temporarily locks this object for writing. + */ +@@ -5978,6 +6046,7 @@ + #endif /* VBOX_WITH_GUEST_PROPS */ + } + ++#if 0 + + /* + * Internal: helper function for connecting progress reporting @@ -6490,6 +6544,8 @@ void Console::onMouseCapabilityChange(BOOL supportsAbsolute, BOOL supportsRelati fireMouseCapabilityChangedEvent(mEventSource, supportsAbsolute, supportsRelative, supportsMT, needsHostCursor); } diff --git a/repos/ports/src/virtualbox/target.inc b/repos/ports/src/virtualbox/target.inc index 2f0e519436..a3f7f2389b 100644 --- a/repos/ports/src/virtualbox/target.inc +++ b/repos/ports/src/virtualbox/target.inc @@ -43,6 +43,8 @@ SRC_CC += HostServices/SharedFolders/shflhandle.cpp SRC_CC += HostServices/SharedClipboard/service.cpp +SRC_CC += HostServices/GuestProperties/service.cpp + SRC_CC += frontend/dummy/errorinfo.cc frontend/dummy/virtualboxbase.cc SRC_CC += frontend/dummy/autostart.cc frontend/dummy/rest.cc SRC_CC += frontend/dummy/host.cc diff --git a/repos/ports/src/virtualbox5/dummies.cc b/repos/ports/src/virtualbox5/dummies.cc index 03d252f9d7..d45eec2637 100644 --- a/repos/ports/src/virtualbox5/dummies.cc +++ b/repos/ports/src/virtualbox5/dummies.cc @@ -19,6 +19,7 @@ #include "EMInternal.h" #include "PDMInternal.h" +#include #include #include #include @@ -167,4 +168,9 @@ void RTAssertMsg2Add(const char *pszFormat, ...) lock.lock(); } +const char * RTBldCfgRevisionStr(void) +{ + return "Genode"; +} + RT_C_DECLS_END diff --git a/repos/ports/src/virtualbox5/frontend/VBoxEvents.h b/repos/ports/src/virtualbox5/frontend/VBoxEvents.h index a7a709f441..86b9c22eea 100644 --- a/repos/ports/src/virtualbox5/frontend/VBoxEvents.h +++ b/repos/ports/src/virtualbox5/frontend/VBoxEvents.h @@ -49,3 +49,5 @@ void fireRuntimeErrorEvent(IEventSource* aSource, BOOL a_fatal, CBSTR a_id, #define fireVideoCaptureChangedEvent(a) #define fireVRDEServerChangedEvent(a) #define fireVRDEServerInfoChangedEvent(a) + +#define fireGuestPropertyChangedEvent(a, b, c, d, e) diff --git a/repos/ports/src/virtualbox5/frontend/VirtualBoxBase.h b/repos/ports/src/virtualbox5/frontend/VirtualBoxBase.h index bb9120ee87..5c9338764e 100644 --- a/repos/ports/src/virtualbox5/frontend/VirtualBoxBase.h +++ b/repos/ports/src/virtualbox5/frontend/VirtualBoxBase.h @@ -1,8 +1,24 @@ +/** + * VirtualBox COM base class definition adjusted to Genode + * - based on VBox/Main/include/VirtualBoxBase.h + */ + +/* + * Copyright (C) 2006-2016 Oracle Corporation + * Copyright (C) 2013-2017 Genode Labs GmbH + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + */ + #ifndef ____H_VIRTUALBOXBASEIMPL #define ____H_VIRTUALBOXBASEIMPL -//#include - #include #include diff --git a/repos/ports/src/virtualbox5/frontend/console.cc b/repos/ports/src/virtualbox5/frontend/console.cc index dfd9165919..1c18926edd 100644 --- a/repos/ports/src/virtualbox5/frontend/console.cc +++ b/repos/ports/src/virtualbox5/frontend/console.cc @@ -334,8 +334,9 @@ void GenodeConsole::init_backends(IKeyboard * gKeyboard, IMouse * gMouse) Assert(SUCCEEDED(rc) && pFramebuffer); Genodefb *fb = dynamic_cast(pFramebuffer); - fb->mode_sigh(_mode_change_signal_dispatcher); + + handle_mode_change(); } void GenodeConsole::i_onMouseCapabilityChange(BOOL supportsAbsolute, diff --git a/repos/ports/src/virtualbox5/frontend/fb.h b/repos/ports/src/virtualbox5/frontend/fb.h index 4c6bf2a094..01be1a613c 100644 --- a/repos/ports/src/virtualbox5/frontend/fb.h +++ b/repos/ports/src/virtualbox5/frontend/fb.h @@ -188,41 +188,62 @@ class Genodefb : } STDMETHODIMP COMGETTER(Overlay) (IFramebufferOverlay **) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(WinId) (PRInt64 *winId) override { + Assert(!"FixMe"); return E_NOTIMPL; } - STDMETHODIMP VideoModeSupported(ULONG, ULONG, ULONG, BOOL *) override { - return E_NOTIMPL; } + STDMETHODIMP VideoModeSupported(ULONG width, ULONG height, + ULONG bpp, BOOL *supported) override + { + if (!supported) + return E_POINTER; + + *supported = ((width <= (ULONG)_next_fb_mode.width()) && + (height <= (ULONG)_next_fb_mode.height())); + + return S_OK; + } STDMETHODIMP Notify3DEvent(PRUint32, PRUint32, PRUint8 *) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP ProcessVHWACommand(BYTE *pCommand) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP GetVisibleRegion(BYTE *, ULONG, ULONG *) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP SetVisibleRegion(BYTE *, ULONG) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(PixelFormat) (ULONG *format) override { + Assert(!"FixMe"); return E_NOTIMPL; } HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(BitsPerPixel)(ULONG *bits) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(BytesPerLine)(ULONG *line) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(Width)(ULONG *width) override { + Assert(!"FixMe"); return E_NOTIMPL; } STDMETHODIMP COMGETTER(Height)(ULONG *height) override { + Assert(!"FixMe"); return E_NOTIMPL; } }; diff --git a/repos/ports/src/virtualbox5/patches/vbox_main.patch b/repos/ports/src/virtualbox5/patches/vbox_main.patch index 6ba0ebaa93..f901ca309d 100644 --- a/repos/ports/src/virtualbox5/patches/vbox_main.patch +++ b/repos/ports/src/virtualbox5/patches/vbox_main.patch @@ -679,15 +679,15 @@ index a717aff..3d52b9f 100644 /** * Uninitializes the Console object. */ -@@ -1014,6 +1028,8 @@ - - #endif /* VBOX_WITH_GUEST_PROPS */ +@@ -803,6 +817,8 @@ + LogFlowThisFuncLeave(); + } +#endif /* #if 0 */ + - bool Console::i_isResetTurnedIntoPowerOff(void) - { - Bstr value; + #ifdef VBOX_WITH_GUEST_PROPS + + /** @@ -1943,8 +1959,11 @@ HRESULT Console::getEmulatedUSB(ComPtr &aEmulatedUSB) diff --git a/repos/ports/src/virtualbox5/target.inc b/repos/ports/src/virtualbox5/target.inc index d878d5bb11..29ede9247b 100644 --- a/repos/ports/src/virtualbox5/target.inc +++ b/repos/ports/src/virtualbox5/target.inc @@ -46,6 +46,8 @@ SRC_CC += HostServices/SharedFolders/shflhandle.cpp SRC_CC += HostServices/SharedClipboard/service.cpp +SRC_CC += HostServices/GuestProperties/service.cpp + SRC_CC += frontend/dummy/errorinfo.cc frontend/dummy/virtualboxbase.cc SRC_CC += frontend/dummy/autostart.cc frontend/dummy/rest.cc SRC_CC += frontend/dummy/host.cc