From patchwork Wed Oct 10 00:46:36 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: 190521 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 6E7C12C0088 for ; Wed, 10 Oct 2012 12:10:58 +1100 (EST) Received: from localhost ([::1]:37264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLkSL-0003Zw-Sh for incoming@patchwork.ozlabs.org; Tue, 09 Oct 2012 20:47:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLkRt-0002bT-BN for qemu-devel@nongnu.org; Tue, 09 Oct 2012 20:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLkRs-00014f-CL for qemu-devel@nongnu.org; Tue, 09 Oct 2012 20:46:57 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:52076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLkRs-00013H-6P for qemu-devel@nongnu.org; Tue, 09 Oct 2012 20:46:56 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so68889pbb.4 for ; Tue, 09 Oct 2012 17:46:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5CZVy0Ctd18kN8TrvfFMVyMKlCxAvDKubZrkZbQAzX4=; b=YyxkEvliP7d2ks73Q+c/FuDT5fvMZSgE3o1KhYNCB4cYhehjfiS58sVZ2guFBXf+LS G+UmCC9J7yKoCh4+/y/KvBtHM4O5EdUK6Yd+nynGzxrZTU4YNpNSXBNZXxXKiJ3+yC7X R+2bf2iBMcZ/3hrUmHUa4QH1WxYcSeuq4CYWY34fa57bXbTSCfMngyvN30gJg0sxN34A 42H1nz/4QLLE0ZDLaAGO8ndY/QZVgP61+ySVPReGtpsa9TancXCeCvT3dMB7NbT81i2p opOK/asYkXz6Ocl2RWW9QcgA8+xAq/qg5xC6jD91m64l50hWSJP+ACDOXq0C7sU8lIOT rl7Q== Received: by 10.66.75.132 with SMTP id c4mr57838395paw.2.1349830015795; Tue, 09 Oct 2012 17:46:55 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id wo9sm96073pbc.53.2012.10.09.17.46.53 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 17:46:55 -0700 (PDT) From: Peter Crosthwaite To: edgar.iglesias@gmail.com, qemu-devel@nongnu.org Date: Wed, 10 Oct 2012 10:46:36 +1000 Message-Id: <1349830006-12124-4-git-send-email-peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1349830006-12124-1-git-send-email-peter.crosthwaite@xilinx.com> References: <1349830006-12124-1-git-send-email-peter.crosthwaite@xilinx.com> X-Gm-Message-State: ALoCoQkDEXwd7iMrCbmO9K8TezGLXXkElUDZT8nPsVtIC6gyE8xurWgS5PVo6mp36FOzaw5VJf1R X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Subject: [Qemu-devel] [PATCH 03/13] 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 Acked-by: Peter Maydell --- 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);