From owner-svn-ports-head@FreeBSD.ORG Wed Jul 3 12:56:49 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FC67470; Wed, 3 Jul 2013 12:56:49 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21C671A8C; Wed, 3 Jul 2013 12:56:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Cunsd068602; Wed, 3 Jul 2013 12:56:49 GMT (envelope-from decke@svn.freebsd.org) Received: (from decke@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63CumMZ068599; Wed, 3 Jul 2013 12:56:48 GMT (envelope-from decke@svn.freebsd.org) Message-Id: <201307031256.r63CumMZ068599@svn.freebsd.org> From: Bernhard Froehlich Date: Wed, 3 Jul 2013 12:56:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r322228 - in head/emulators/virtualbox-ose: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 12:56:49 -0000 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 Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk (contents, props changed) head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp (contents, props changed) Modified: head/emulators/virtualbox-ose/Makefile Modified: head/emulators/virtualbox-ose/Makefile ============================================================================== --- head/emulators/virtualbox-ose/Makefile Wed Jul 3 12:44:17 2013 (r322227) +++ head/emulators/virtualbox-ose/Makefile Wed Jul 3 12:56:48 2013 (r322228) @@ -3,6 +3,7 @@ PORTNAME= virtualbox-ose DISTVERSION= 4.2.14 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \ http://tmp.chruetertee.ch/ \ Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk Wed Jul 3 12:56:48 2013 (r322228) @@ -0,0 +1,11 @@ +--- src/VBox/Runtime/Makefile.kmk.orig 2013-06-21 16:27:18.000000000 +0400 ++++ src/VBox/Runtime/Makefile.kmk 2013-06-30 14:57:33.248215681 +0400 +@@ -844,7 +844,7 @@ + r3/posix/RTMemProtect-posix.cpp \ + r3/posix/RTPathUserHome-posix.cpp \ + r3/posix/RTSystemQueryOSInfo-posix.cpp \ +- r3/posix/RTSystemQueryTotalRam-posix.cpp \ ++ r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp \ + r3/posix/RTTimeNow-posix.cpp \ + r3/posix/RTTimeSet-posix.cpp \ + r3/posix/dir-posix.cpp \ Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp Wed Jul 3 12:56:48 2013 (r322228) @@ -0,0 +1,83 @@ +--- ./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 @@ ++/* $Id: RTSystemQueryTotalRam-freebsd.cpp $ */ ++/** @file ++ * IPRT - RTSystemQueryTotalRam, FreeBSD style ++ */ ++ ++/* ++ * Copyright (C) 2013 Martin Birgmeier, Oracle Corporation ++ * ++ * This file is part of VirtualBox Open Source Edition (OSE), as ++ * available from http://www.virtualbox.org. This file is free software; ++ * you can redistribute it and/or modify it under the terms of the GNU ++ * General Public License (GPL) as published by the Free Software ++ * Foundation, in version 2 as it comes in the "COPYING" file of the ++ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the ++ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ++ * ++ * The contents of this file may alternatively be used under the terms ++ * of the Common Development and Distribution License Version 1.0 ++ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the ++ * VirtualBox OSE distribution, in which case the provisions of the ++ * CDDL are applicable instead of those of the GPL. ++ * ++ * You may elect to license modified versions of this file under the ++ * terms and conditions of either the GPL or the CDDL or both. ++ */ ++ ++ ++/******************************************************************************* ++* Header Files * ++*******************************************************************************/ ++#include ++#include "internal/iprt.h" ++ ++#include ++#include ++#include ++ ++/* FreeBSD */ ++#include ++#include ++#include ++ ++RTDECL(int) RTSystemQueryTotalRam(uint64_t *pcb) ++{ ++ int mib[2]; ++ size_t pcblen = sizeof(*pcb); ++ ++ AssertPtrReturn(pcb, VERR_INVALID_POINTER); ++ ++ mib[0] = CTL_HW; ++ 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 */ ++ } ++ return RTErrConvertFromErrno(errno); ++} ++ ++RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb) ++{ ++ int mib[2]; ++ size_t pcblen = sizeof(*pcb); ++ ++ AssertPtrReturn(pcb, VERR_INVALID_POINTER); ++ ++ 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 */ ++ } ++ return RTErrConvertFromErrno(errno); ++}