From patchwork Sat Jan 30 01:00:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8169171 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CEF039F6DA for ; Sat, 30 Jan 2016 01:03:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 196D220381 for ; Sat, 30 Jan 2016 01:03:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 475FB20380 for ; Sat, 30 Jan 2016 01:03:41 +0000 (UTC) Received: from localhost ([::1]:37181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJwy-0004TI-NH for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Jan 2016 20:03:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJwn-0004RD-0e for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPJwi-0007yw-On for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:28 -0500 Received: from mail-sn1nam02on0074.outbound.protection.outlook.com ([104.47.36.74]:62912 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJwi-0007yg-He for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:24 -0500 Received: from CY1NAM02FT053.eop-nam02.prod.protection.outlook.com (10.152.74.59) by CY1NAM02HT159.eop-nam02.prod.protection.outlook.com (10.152.74.249) with Microsoft SMTP Server (TLS) id 15.1.355.15; Sat, 30 Jan 2016 01:03:23 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none; suse.de; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by CY1NAM02FT053.mail.protection.outlook.com (10.152.74.165) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sat, 30 Jan 2016 01:03:22 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:45432 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aPJwf-0002NH-Ic; Fri, 29 Jan 2016 17:03:21 -0800 Received: from [127.0.0.1] (port=52650 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aPJwf-0002sj-BP; Fri, 29 Jan 2016 17:03:21 -0800 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u0U0viqP022000; Fri, 29 Jan 2016 16:57:44 -0800 Received: from [172.19.74.182] (port=49964 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aPJwe-0002sg-Hi; Fri, 29 Jan 2016 17:03:20 -0800 From: Alistair Francis To: , , Date: Fri, 29 Jan 2016 17:00:45 -0800 Message-ID: <09f39516d69c78ebf356ef3b08838abb879b6cb6.1454115217.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22054.006 X-TM-AS-Result: No--10.371-7.0-31-10 X-imss-scan-details: No--10.371-7.0-31-10 X-TMASE-MatchedRID: 9DomuZeNnSY1vivz3L6ga0KcYi5Qw/RVWDdWpJMntKhOCtCDJNptxq4T oUk/aSm1TrmpAQzEOVjH5DPULyc4TrBAQLqGlKivksHaPaQQRsDvmgUySWGueBMu6ersnFy9Lyc 54RnMqiqnL1+EP4NV2TtCpM5lJp2qwdbU3akH5AzMuewaQUInJH0tCKdnhB589yM15V5aWpj6C0 ePs7A07RjOlt1Pi553TwdRTOYVJO9uSFCUHa0n+naY+772XY1hAGM3FbFr86o= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(11100500001)(19580395003)(76176999)(4326007)(2201001)(19580405001)(5001770100001)(118296001)(5003600100002)(33646002)(87936001)(92566002)(50226001)(86362001)(575784001)(2906002)(48376002)(77096005)(85426001)(6806005)(189998001)(106466001)(2950100001)(5001960100002)(50466002)(1220700001)(229853001)(3470700001)(1096002)(71366001)(5003940100001)(105606002)(50986999)(36756003)(586003)(64026002)(5008740100001)(47776003)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1NAM02HT159; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8905c390-f874-4ada-2c91-08d32911269c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT159; X-Microsoft-Antispam-PRVS: <0b059e68117e401889df6982a1c7101e@CY1NAM02HT159.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13015025)(13024025)(8121501046)(5005006)(13023025)(13018025)(3002001)(10201501046); SRVR:CY1NAM02HT159; BCL:0; PCL:0; RULEID:; SRVR:CY1NAM02HT159; X-Forefront-PRVS: 083751FCA6 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2016 01:03:22.4261 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT159 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.74 Cc: edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com, crosthwaitepeter@gmail.com, afaerber@suse.de, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v3 01/16] memory: Allow subregions to not be printed by info mtree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a function called memory_region_add_subregion_no_print() that creates memory subregions that won't be printed when running the 'info mtree' command. Signed-off-by: Alistair Francis Reviewed-by: KONRAD Frederic --- include/exec/memory.h | 17 +++++++++++++++++ memory.c | 10 +++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index c92734a..25353df 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -186,6 +186,7 @@ struct MemoryRegion { bool skip_dump; bool enabled; bool warning_printed; /* For reservations */ + bool do_not_print; uint8_t vga_logging_count; MemoryRegion *alias; hwaddr alias_offset; @@ -954,6 +955,22 @@ void memory_region_del_eventfd(MemoryRegion *mr, void memory_region_add_subregion(MemoryRegion *mr, hwaddr offset, MemoryRegion *subregion); + +/** + * memory_region_add_subregion_no_print: Add a subregion to a container. + * + * The same functionality as memory_region_add_subregion except that any + * memory regions added by this function are not printed by 'info mtree'. + * + * @mr: the region to contain the new subregion; must be a container + * initialized with memory_region_init(). + * @offset: the offset relative to @mr where @subregion is added. + * @subregion: the subregion to be added. + */ +void memory_region_add_subregion_no_print(MemoryRegion *mr, + hwaddr offset, + MemoryRegion *subregion); + /** * memory_region_add_subregion_overlap: Add a subregion to a container * with overlap. diff --git a/memory.c b/memory.c index d2d0a92..4b9d961 100644 --- a/memory.c +++ b/memory.c @@ -1827,6 +1827,14 @@ void memory_region_add_subregion(MemoryRegion *mr, memory_region_add_subregion_common(mr, offset, subregion); } +void memory_region_add_subregion_no_print(MemoryRegion *mr, + hwaddr offset, + MemoryRegion *subregion) +{ + memory_region_add_subregion(mr, offset, subregion); + subregion->do_not_print = true; +} + void memory_region_add_subregion_overlap(MemoryRegion *mr, hwaddr offset, MemoryRegion *subregion, @@ -2217,7 +2225,7 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f, const MemoryRegion *submr; unsigned int i; - if (!mr) { + if (!mr || mr->do_not_print) { return; }