Date: Sun, 07 Jul 2013 13:29:01 -0700 From: Cy Schubert <Cy.Schubert@komquats.com> To: =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= <decke@FreeBSD.org> Cc: Cy Schubert <Cy.Schubert@komquats.com>, 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: <201307072029.r67KT1gd010380@slippy.cwsent.com> In-Reply-To: Message from =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= <decke@FreeBSD.org> of "Sun, 07 Jul 2013 17:09:55 %2B0200." <CAE-m3X096bq%2Ba6on9n1-ak8QR7fibY-vMDyBGfZ3f7eomvvTLg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <CAE-m3X096bq+a6on9n1-ak8QR7fibY-vMDyBGfZ3f7eomvvTLg@mail.gmail.c om> , =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= writes: > 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. 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 <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?201307072029.r67KT1gd010380>