Re: [vbox-dev] Opportunity to significantly shrink the vboxsf Linux driver

2017-07-25 Thread Michael Thayer
13.07.2017 16:42, Michael Thayer wrote:
> 10.07.2017 12:29, Hans de Goede wrote:
> [Patch to shared folder code proposed by Hans to reduce the line count
> of the Linux driver.]
> 
> I reviewed the patch and made a few changes.  Not yet tested on any
> platform, but I am posting my adjusted version so that other people can
> test, including on FreeBSD and Haiku which I cannot do easily.  Note
> that this applies to the normal VirtualBox tree, not to the packaged
> Linux driver.
I redid the patch again, after realising that the non-physical-page path
was for supporting VirtualBox 3.0 and older on the host, which we have
not tested or supported for a long time.  Therefore
VbglR0CanUsePhysPageList() could be removed altogether.  Hopefully this
code will not affect other platforms at all, though testing is better
than hoping (that is addressed particularly to community port maintainers).

Hans, I kept your signed-off-by despite my changes, I hope that is fine.
 Thanks again.

The changes I committed are also attached to this message.

Regards
Michael
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
>From 21bd2fc1249c1278cae08c4013f2d8e6748306f6 Mon Sep 17 00:00:00 2001
From: Michael Thayer 
Date: Mon, 24 Jul 2017 20:26:03 +0200
Subject: [PATCH 1/5] Shared folders: stop supporting legacy host code on
 Linux, add Windows todo.

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
Using physical page lists in HGCM was added in VirtualBox 3.1, and the Linux
and Windows shared folder Additions still have code paths for supporting
older versions.  Remove this on Linux and add a todo to Windows to remove it.
This removes all shared folder driver dependencies on the guest library other
than HGCM.

Signed-off-by: Hans de Goede 
Reworked by Oracle.
---
 src/VBox/Additions/WINNT/SharedFolders/driver/file.c |  3 +++
 src/VBox/Additions/linux/sharedfolders/regops.c  | 12 ++--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/VBox/Additions/WINNT/SharedFolders/driver/file.c b/src/VBox/Additions/WINNT/SharedFolders/driver/file.c
index f42c0ca14f..c3ca43ec55 100644
--- a/src/VBox/Additions/WINNT/SharedFolders/driver/file.c
+++ b/src/VBox/Additions/WINNT/SharedFolders/driver/file.c
@@ -91,6 +91,9 @@ static int vbsfTransferCommon(VBSFTRANSFERCTX *pCtx)
 uint32_t cbToTransfer;
 uint32_t cbIO;
 
+/** @todo Remove the test and the fall-back path.  VbglR0CanUsePhysPageList()
+ *returns true for any host version after 3.0, i.e. further back than
+ *we support. */
 if (VbglR0CanUsePhysPageList())
 {
 ULONG offFirstPage = MmGetMdlByteOffset(pCtx->pMdl);
diff --git a/src/VBox/Additions/linux/sharedfolders/regops.c b/src/VBox/Additions/linux/sharedfolders/regops.c
index d411228a9d..3aec9f2cbd 100644
--- a/src/VBox/Additions/linux/sharedfolders/regops.c
+++ b/src/VBox/Additions/linux/sharedfolders/regops.c
@@ -232,16 +232,8 @@ static ssize_t sf_reg_write(struct file *file, const char *buf, size_t size, lof
 goto fail;
 }
 
-#if 1
-if (VbglR0CanUsePhysPageList())
-{
-err = VbglR0SfWritePhysCont(_handle, _g->map, sf_r->handle,
-pos, , tmp_phys);
-err = RT_FAILURE(err) ? -EPROTO : 0;
-}
-else
-#endif
-err = sf_reg_write_aux(__func__, sf_g, sf_r, tmp, , pos);
+err = VbglR0SfWritePhysCont(_handle, _g->map, sf_r->handle,
+pos, , tmp_phys);
 if (err)
 goto fail;
 
-- 
2.11.0

>From c49fa98e0eadf77962587dee89dd4301edae4e95 Mon Sep 17 00:00:00 2001
From: Michael Thayer 
Date: Mon, 24 Jul 2017 21:03:54 +0200
Subject: [PATCH 2/5] R0 guest library: move HGCM globals out of global library
 structure.

bugref:8524: Additions/linux: play nicely with distribution-installed Additions
As part of elimitating dependencies of the HGCM R0 guest library code on the
rest of the library, move its global variables (handles and mutex) out of the
global library structure and into HGCM.cpp.  The aim is to reduce the number
of library files included in the Linux shared folder driver.

Signed-off-by: Hans de Goede 
Reworked by Oracle.
---
 src/VBox/Additions/common/VBoxGuestLib/HGCM.cpp| 28 +++---
 .../Additions/common/VBoxGuestLib/VBGLInternal.h   | 11 -
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git 

Re: [vbox-dev] How to test memory ballloon ?

2017-07-25 Thread Andreas Löffler
Hello Hans,

please have a look at the manual, section 4.9.1 "Memory ballooning" and
commands like

VBoxManage controlvm "VM name" guestmemoryballoon 

VBoxManage modifyvm "VM name" --guestmemoryballoon 

There is also a frontend called VBoxBalloonCtrl in our tree which can be
used to control those values. This also could act as an example about
how to use ballooning / the API.

Hope this helps,
Andreas





Kind regards / Mit freundlichen Grüßen

**
Andreas Löffler | VirtualBox Engineering
Principal Software Engineer | Oracle Virtualization

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher

Green Oracle 
Oracle is committed to developing practices and products that
help protect the environment




On 25.07.2017 11:40, Hans de Goede wrote:
> Hi,
> 
> I would like to test the (Linux guest) memory balloon code.
> 
> Is there anything I can do to explicitly make the host request
> the guest to give up some memory through the balloon ?
> 
> Regards,
> 
> Hans
> ___
> vbox-dev mailing list
> vbox-dev@virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev


0x6DC478CF.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev


[vbox-dev] How to test memory ballloon ?

2017-07-25 Thread Hans de Goede

Hi,

I would like to test the (Linux guest) memory balloon code.

Is there anything I can do to explicitly make the host request
the guest to give up some memory through the balloon ?

Regards,

Hans
___
vbox-dev mailing list
vbox-dev@virtualbox.org
https://www.virtualbox.org/mailman/listinfo/vbox-dev