From patchwork Fri Oct 16 13:42:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 36216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F168B7BBA for ; Sat, 17 Oct 2009 01:11:49 +1100 (EST) Received: from localhost ([127.0.0.1]:52562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MynX0-0003yz-8t for incoming@patchwork.ozlabs.org; Fri, 16 Oct 2009 10:11:46 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Myn4Y-0001uh-Dz for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Myn4Q-0001qr-8U for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:19 -0400 Received: from [199.232.76.173] (port=40522 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Myn4Q-0001ql-0N for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49873) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Myn4P-0007nh-ID for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:13 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9GDgCLR001959 for ; Fri, 16 Oct 2009 09:42:12 -0400 Received: from zweiblum.home.kraxel.org (vpn2-9-112.ams2.redhat.com [10.36.9.112]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9GDgA5v011573; Fri, 16 Oct 2009 09:42:11 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 1B78A70108; Fri, 16 Oct 2009 15:42:04 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 16 Oct 2009 15:42:00 +0200 Message-Id: <1255700523-15270-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1255700523-15270-1-git-send-email-kraxel@redhat.com> References: <1255700523-15270-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [RfC PATCH v3 07/10] qdev: add qdev_prop_exists() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- hw/qdev-properties.c | 5 +++++ hw/qdev.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index c9843a2..370f356 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -452,6 +452,11 @@ static Property *qdev_prop_find(DeviceState *dev, const char *name) return NULL; } +int qdev_prop_exists(DeviceState *dev, const char *name) +{ + return qdev_prop_find(dev, name) ? true : false; +} + int qdev_prop_parse(DeviceState *dev, const char *name, const char *value) { Property *prop; diff --git a/hw/qdev.h b/hw/qdev.h index c678ab2..5271a3c 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -245,6 +245,7 @@ extern PropertyInfo qdev_prop_pci_devfn; /* Set properties between creation and init. */ void *qdev_get_prop_ptr(DeviceState *dev, Property *prop); +int qdev_prop_exists(DeviceState *dev, const char *name); int qdev_prop_parse(DeviceState *dev, const char *name, const char *value); void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type); void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value);