svn commit: r322228 - in head/emulators/virtualbox-ose: . files

Bernhard Fröhlich decke at FreeBSD.org
Sun Jul 7 15:09:55 UTC 2013


On Sat, Jul 6, 2013 at 9:18 AM, Cy Schubert <Cy.Schubert at komquats.com> wrote:
> In message <201307031256.r63CumMZ068599 at svn.freebsd.org>, Bernhard
> Froehlich wr
> ites:
>> Author: decke
>> Date: Wed Jul  3 12:56:48 2013
>> New Revision: 322228
>> URL: http://svnweb.freebsd.org/changeset/ports/322228
>>
>> Log:
>>   - Changing RAM for a VM was broken in the GUI because there was no
>>   implementation for FreeBSD that could calculate available RAM.
>>
>>   PR:         ports/180086
>>   Submitted by:       Martin Birgmeier <Martin.Birgmeier at aon.at>
>
> Previously I replied that this patch didn't work for me. The following did
> work.

Could you please describe the idea behind the patch a bit because it does
not immediately make sense so me why removing the check is a good idea.

> Index: Makefile
> ===================================================================
> --- Makefile    (revision 322363)
> +++ Makefile    (working copy)
> @@ -3,7 +3,7 @@
>
>  PORTNAME=      virtualbox-ose
>  DISTVERSION=   4.2.14
> -PORTREVISION=  1
> +PORTREVISION=  2
>  CATEGORIES=    emulators
>  MASTER_SITES=  http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
>                 http://tmp.chruetertee.ch/ \
> Index: files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd
> .cpp
> ===================================================================
> --- files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cp
> p       (revision 322363)
> +++ files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cp
> p       (working copy)
> @@ -1,6 +1,6 @@
> ---- ./src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp.ORIG
> 2013-06-30 09:27:59.000000000 +0200
> -+++ ./src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp
> 2013-06-30 09:51:29.000000000 +0200
> -@@ -0,0 +1,80 @@
> +--- src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp.orig
> 2013-07-05 20:24:41.691718725 -0700
> ++++ src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp
> 2013-07-05 23:24:19.810482426 -0700
> +@@ -0,0 +1,70 @@
>  +/* $Id: RTSystemQueryTotalRam-freebsd.cpp $ */
>  +/** @file
>  + * IPRT - RTSystemQueryTotalRam, FreeBSD style
> @@ -54,12 +54,7 @@
>  +    mib[1] = HW_PHYSMEM;      /* HW_REALMEM is also possible, but
>  +                                 includes non-main memory as well */
>  +    *pcb = 0;
> -+    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) {
> -+      if (pcblen == sizeof(*pcb))
> -+          return VINF_SUCCESS;
> -+      else
> -+          return VERR_NO_MEMORY;      /* XXX */
> -+    }
> ++    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) return VINF_SUCCESS;
>  +    return RTErrConvertFromErrno(errno);
>  +}
>  +
> @@ -73,11 +68,6 @@
>  +    mib[0] = CTL_HW;
>  +    mib[1] = HW_USERMEM;
>  +    *pcb = 0;
> -+    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) {
> -+      if (pcblen == sizeof(*pcb))
> -+          return VINF_SUCCESS;
> -+      else
> -+          return VERR_NO_MEMORY;      /* XXX */
> -+    }
> ++    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) return VINF_SUCCESS;
>  +    return RTErrConvertFromErrno(errno);
>  +}
>
>
>
> --
> Cheers,
> Cy Schubert <Cy.Schubert at komquats.com>
> FreeBSD UNIX:  <cy at FreeBSD.org>   Web:  http://www.FreeBSD.org
>
>         The need of the many outweighs the greed of the few.
>
>



--
Bernhard Froehlich
http://www.bluelife.at/


More information about the svn-ports-all mailing list