From patchwork Tue Dec 20 14:05:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 132429 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]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B65C1B703C for ; Wed, 21 Dec 2011 01:06:08 +1100 (EST) Received: from localhost ([::1]:42775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd0KF-0001yU-Iq for incoming@patchwork.ozlabs.org; Tue, 20 Dec 2011 09:05:51 -0500 Received: from eggs.gnu.org ([140.186.70.92]:34960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd0K0-0001hE-TN for qemu-devel@nongnu.org; Tue, 20 Dec 2011 09:05:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd0Jv-0003kx-6H for qemu-devel@nongnu.org; Tue, 20 Dec 2011 09:05:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd0Ju-0003ki-Uv for qemu-devel@nongnu.org; Tue, 20 Dec 2011 09:05:31 -0500 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 pBKE5TIl026686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Dec 2011 09:05:29 -0500 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 pBKE5SRS029802; Tue, 20 Dec 2011 09:05:29 -0500 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 1D997250B9F; Tue, 20 Dec 2011 16:05:23 +0200 (IST) From: Avi Kivity To: quintela@redhat.com, Anthony Liguori Date: Tue, 20 Dec 2011 16:05:13 +0200 Message-Id: <1324389914-12246-2-git-send-email-avi@redhat.com> In-Reply-To: <1324389914-12246-1-git-send-email-avi@redhat.com> References: <1324389914-12246-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 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 1/2] memory: introduce memory_region_name() 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 Trivial accessor for the name attribute. Signed-off-by: Avi Kivity --- memory.c | 5 +++++ memory.h | 9 +++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index a90eefd..93f9569 100644 --- a/memory.c +++ b/memory.c @@ -1108,6 +1108,11 @@ uint64_t memory_region_size(MemoryRegion *mr) return int128_get64(mr->size); } +const char *memory_region_name(MemoryRegion *mr) +{ + return mr->name; +} + bool memory_region_is_ram(MemoryRegion *mr) { return mr->ram; diff --git a/memory.h b/memory.h index a82226a..55e7830 100644 --- a/memory.h +++ b/memory.h @@ -316,6 +316,15 @@ uint64_t memory_region_size(MemoryRegion *mr); bool memory_region_is_ram(MemoryRegion *mr); /** + * memory_region_name: get a memory region's name + * + * Returns the string that was used to initialize the memory region. + * + * @mr: the memory region being queried + */ +const char *memory_region_name(MemoryRegion *mr); + +/** * memory_region_is_logging: return whether a memory region is logging writes * * Returns %true if the memory region is logging writes