From patchwork Wed Oct 3 07:48:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 188728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A571D2C00C2 for ; Wed, 3 Oct 2012 18:15:37 +1000 (EST) Received: from localhost ([::1]:43393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJJi6-0001Bu-E5 for incoming@patchwork.ozlabs.org; Wed, 03 Oct 2012 03:49:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJJho-0000ru-Kc for qemu-devel@nongnu.org; Wed, 03 Oct 2012 03:49:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJJhi-00059P-Ir for qemu-devel@nongnu.org; Wed, 03 Oct 2012 03:49:20 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:42989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJJhi-00057k-C7 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 03:49:14 -0400 Received: by padfb10 with SMTP id fb10so6144090pad.4 for ; Wed, 03 Oct 2012 00:49:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=1pxhX0WqSo6THkobQsDaIN3XcqZeGtS121QiQtlEfo8=; b=fYiFF0GZWq5FctGUwXNEsRwqJkr7VlIIclH8W3kWke1KaUMGYk2cawpTpjDF3BWI4b zBfJUB+FcLNFjX7au1zwtuSu1A4orH0GM6cd1D5a65NyxZ+rbbLiNukn/5B3qAd57BTe HrK+2mPK2y5JguzA9lr3qHqmzKVPcftZlCZmLHM10OH9l9PbPAMfqa1PbeLYvpGf+dzX Ij6ypGLGWrPqrMgK26pWY8p77EYJYxZT3pbUWEvTMsk4vRHCCX9QRKhB5Ee+3xiJ7Q8w gSnHxQIb8feYncQZwX5GB88woZW1ByIrQYKtxKvvBedCOSvnSF3Eo2xod7LnnPJMJu5n +FRQ== Received: by 10.68.189.193 with SMTP id gk1mr10694045pbc.123.1349250553465; Wed, 03 Oct 2012 00:49:13 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id uz3sm2229348pbc.19.2012.10.03.00.49.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 00:49:12 -0700 (PDT) From: Peter Crosthwaite To: qemu-devel@nongnu.org, paul@codesourcery.com, edgar.iglesias@gmail.com, peter.maydell@linaro.org, stefanha@gmail.com Date: Wed, 3 Oct 2012 17:48:31 +1000 Message-Id: X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQk1rC96dcDSZKGLhG1oiRLXkVitI8/5iSIJSMxhsYF0sRO2CKgtJfb7fdvQDWq9hgp/DvWM X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.45 Cc: blauwirbel@gmail.com, "Peter A. G. Crosthwaite" , i.mitsyanko@samsung.com Subject: [Qemu-devel] [PATCH v8 03/14] ssi: Added create_slave_no_init() 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: Peter A. G. Crosthwaite Slave creation function that can be used to create an SSI slave without qdev_init() being called. This give machine models a chance to set properties. Signed-off-by: Peter A. G. Crosthwaite --- hw/ssi.c | 9 +++++++-- hw/ssi.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/ssi.c b/hw/ssi.c index 2e4f2fe..c47419d 100644 --- a/hw/ssi.c +++ b/hw/ssi.c @@ -86,10 +86,15 @@ static TypeInfo ssi_slave_info = { .abstract = true, }; +DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name) +{ + return qdev_create(&bus->qbus, name); +} + DeviceState *ssi_create_slave(SSIBus *bus, const char *name) { - DeviceState *dev; - dev = qdev_create(&bus->qbus, name); + DeviceState *dev = ssi_create_slave_no_init(bus, name); + qdev_init_nofail(dev); return dev; } diff --git a/hw/ssi.h b/hw/ssi.h index 65b159d..2bde9f5 100644 --- a/hw/ssi.h +++ b/hw/ssi.h @@ -76,6 +76,7 @@ extern const VMStateDescription vmstate_ssi_slave; } DeviceState *ssi_create_slave(SSIBus *bus, const char *name); +DeviceState *ssi_create_slave_no_init(SSIBus *bus, const char *name); /* Master interface. */ SSIBus *ssi_create_bus(DeviceState *parent, const char *name);