Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2013 17:09:55 +0200
From:      =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= <decke@FreeBSD.org>
To:        Cy Schubert <Cy.Schubert@komquats.com>
Cc:        svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org
Subject:   Re: svn commit: r322228 - in head/emulators/virtualbox-ose: . files
Message-ID:  <CAE-m3X096bq%2Ba6on9n1-ak8QR7fibY-vMDyBGfZ3f7eomvvTLg@mail.gmail.com>
In-Reply-To: <201307060718.r667IZF7048210@slippy.cwsent.com>
References:  <decke@FreeBSD.org> <201307031256.r63CumMZ068599@svn.freebsd.org> <201307060718.r667IZF7048210@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 6, 2013 at 9:18 AM, Cy Schubert <Cy.Schubert@komquats.com> wrote:
> In message <201307031256.r63CumMZ068599@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@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@komquats.com>
> FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org
>
>         The need of the many outweighs the greed of the few.
>
>



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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-m3X096bq%2Ba6on9n1-ak8QR7fibY-vMDyBGfZ3f7eomvvTLg>