From owner-svn-ports-all@FreeBSD.ORG Sun Jul 7 20:29:04 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D7AC9EF; Sun, 7 Jul 2013 20:29:04 +0000 (UTC) (envelope-from Cy.Schubert@komquats.com) Received: from smtp-out-05.shaw.ca (smtp-out-05.shaw.ca [64.59.134.13]) by mx1.freebsd.org (Postfix) with ESMTP id D08DE1456; Sun, 7 Jul 2013 20:29:03 +0000 (UTC) X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=/OolT88hxzZB4/D8S1pLLnpaRVcdzwgG3HupJc0czqk= c=1 sm=1 a=M2G-30rFWU8A:10 a=QrugwKR0C_UA:10 a=wAGQQ9Az6v0A:10 a=BLceEmwcHowA:10 a=ICAaq7hcmGcA:10 a=kj9zAlcOel0A:10 a=IbtKDeXwb2+SRU442/pi3A==:17 a=BWvPGDcYAAAA:8 a=6I5d2MoRAAAA:8 a=0ydcORbq0TFuWJuJFCcA:9 a=CjuIK1q_8ugA:10 a=V7tsTZBp22UA:10 a=SV7veod9ZcQA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO spqr.komquats.com) ([96.50.7.119]) by smtp-out-05.shaw.ca with ESMTP; 07 Jul 2013 14:29:02 -0600 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 9D79A80; Sun, 7 Jul 2013 13:29:01 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.14.7/8.14.7) with ESMTP id r67KT1gd010380; Sun, 7 Jul 2013 13:29:01 -0700 (PDT) (envelope-from Cy.Schubert@komquats.com) Message-Id: <201307072029.r67KT1gd010380@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.5 From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.komquats.com/ To: =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= Subject: Re: svn commit: r322228 - in head/emulators/virtualbox-ose: . files In-Reply-To: Message from =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= of "Sun, 07 Jul 2013 17:09:55 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 07 Jul 2013 13:29:01 -0700 Cc: Cy Schubert , svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Cy Schubert List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 20:29:04 -0000 In message , =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= writes: > On Sat, Jul 6, 2013 at 9:18 AM, Cy Schubert 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 > > > > 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. Here is an improved patch. Index: files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd .cpp =================================================================== --- files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cp p (revision 322458) +++ files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cp p (working copy) @@ -55,7 +55,7 @@ + includes non-main memory as well */ + *pcb = 0; + if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) { -+ if (pcblen == sizeof(*pcb)) ++ if (pcblen == sizeof(*pcb) || pcblen == sizeof(uint32_t)) + return VINF_SUCCESS; + else + return VERR_NO_MEMORY; /* XXX */ @@ -74,7 +74,7 @@ + mib[1] = HW_USERMEM; + *pcb = 0; + if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) { -+ if (pcblen == sizeof(*pcb)) ++ if (pcblen == sizeof(*pcb) || pcblen == sizeof(uint32_t)) + return VINF_SUCCESS; + else + return VERR_NO_MEMORY; /* XXX */ The idea behind this is that I'm running it on a 32-bit system and it returns a 32-bit pcb. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.