From patchwork Sun Oct 2 14:32:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 117308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) by ozlabs.org (Postfix) with ESMTP id 21ECE1007D6 for ; Mon, 3 Oct 2011 01:38:25 +1100 (EST) Received: from localhost ([::1]:55588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAN6J-0006lf-5p for incoming@patchwork.ozlabs.org; Sun, 02 Oct 2011 10:33:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]:38251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAN5k-00059e-G9 for qemu-devel@nongnu.org; Sun, 02 Oct 2011 10:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAN5j-0000bH-2p for qemu-devel@nongnu.org; Sun, 02 Oct 2011 10:32:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAN5i-0000aP-RN for qemu-devel@nongnu.org; Sun, 02 Oct 2011 10:32:31 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p92EWRKJ006426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 Oct 2011 10:32:27 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p92EWPtJ013989; Sun, 2 Oct 2011 10:32:27 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id C55F4250B64; Sun, 2 Oct 2011 16:32:22 +0200 (IST) From: Avi Kivity To: Anthony Liguori , Blue Swirl , qemu-devel@nongnu.org Date: Sun, 2 Oct 2011 16:32:18 +0200 Message-Id: <1317565939-14900-4-git-send-email-avi@redhat.com> In-Reply-To: <1317565939-14900-1-git-send-email-avi@redhat.com> References: <1317565939-14900-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] memory: Do not print empty PIO root 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- memory.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/memory.c b/memory.c index eae67be..19f1d36 100644 --- a/memory.c +++ b/memory.c @@ -1360,7 +1360,10 @@ void mtree_info(fprintf_function mon_printf, void *f) g_free(ml2); } - QTAILQ_INIT(&ml_head); - mon_printf(f, "I/O\n"); - mtree_print_mr(mon_printf, f, address_space_io.root, 0, 0, &ml_head); + if (address_space_io.root && + !QTAILQ_EMPTY(&address_space_io.root->subregions)) { + QTAILQ_INIT(&ml_head); + mon_printf(f, "I/O\n"); + mtree_print_mr(mon_printf, f, address_space_io.root, 0, 0, &ml_head); + } }