Date: Sat, 06 Jul 2013 00:18:35 -0700 From: Cy Schubert <Cy.Schubert@komquats.com> To: Bernhard Froehlich <decke@FreeBSD.org> 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: <201307060718.r667IZF7048210@slippy.cwsent.com> In-Reply-To: Message from Bernhard Froehlich <decke@FreeBSD.org> of "Wed, 03 Jul 2013 12:56:48 -0000." <201307031256.r63CumMZ068599@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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. 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307060718.r667IZF7048210>