From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S73ww-0006SV-K9 for qemu-devel@nongnu.org; Mon, 12 Mar 2012 08:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S73wq-000534-As for qemu-devel@nongnu.org; Mon, 12 Mar 2012 08:02:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S73wq-00052t-38 for qemu-devel@nongnu.org; Mon, 12 Mar 2012 08:01:56 -0400 Message-ID: <4F5DE5AF.9000208@redhat.com> Date: Mon, 12 Mar 2012 14:01:51 +0200 From: Avi Kivity MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] memory: print aliased IO ranges in info mtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 03/11/2012 01:00 PM, Blue Swirl wrote: > Print also I/O ports behind bridges and other aliases. > > Signed-off-by: Blue Swirl > --- > memory.c | 13 +++++++++++++ > 1 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/memory.c b/memory.c > index 4c3dc49..0201392 100644 > --- a/memory.c > +++ b/memory.c > @@ -1639,7 +1639,20 @@ void mtree_info(fprintf_function mon_printf, void *f) > 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); > + > + /* print aliased I/O regions */ > + QTAILQ_FOREACH(ml, &ml_head, queue) { > + if (!ml->printed) { > + mon_printf(f, "%s\n", ml->mr->name); > + mtree_print_mr(mon_printf, f, ml->mr, 0, 0, &ml_head); > + } > + } > + } > + > + QTAILQ_FOREACH_SAFE(ml, &ml_head, queue, ml2) { > + g_free(ml); > } > } This is just duplication. A little refactoring would eliminate it. Also, we might have an alias from the memory address space and an alias from the I/O address space pointing into the same region. So maybe alias printing should be consolidated for all address spaces. -- error compiling committee.c: too many arguments to function