From patchwork Wed Dec 19 09:53:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 207312 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 8F8102C0094 for ; Wed, 19 Dec 2012 21:48:38 +1100 (EST) Received: from localhost ([::1]:57503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlGMn-0006nZ-8h for incoming@patchwork.ozlabs.org; Wed, 19 Dec 2012 04:55:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlGLi-00057L-Om for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:54:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlGLe-0001mX-NU for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:54:02 -0500 Received: from greensocs.com ([87.106.252.221]:54839 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlGLe-0001mN-Gj for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:53:58 -0500 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id CAB71439E3B; Wed, 19 Dec 2012 09:53:57 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zDYj0Lf0V6Bz; Wed, 19 Dec 2012 10:53:57 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id 78B48439E40; Wed, 19 Dec 2012 10:53:57 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 6688E439E3B; Wed, 19 Dec 2012 10:53:56 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org Date: Wed, 19 Dec 2012 10:53:36 +0100 Message-Id: <1355910821-21302-11-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1355910821-21302-1-git-send-email-fred.konrad@greensocs.com> References: <1355910821-21302-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, e.voevodin@samsung.com, mark.burton@greensocs.com, agraf@suse.de, stefanha@redhat.com, cornelia.huck@de.ibm.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [RFC PATCH V8 10/15] virtio-blk-s390 : Switch to the new API. 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: KONRAD Frederic Here the virtio-blk-s390 is modified for the new API. The device virtio-blk-s390 extends virtio-s390-device. It creates and connects a virtio-blk during the init. Signed-off-by: KONRAD Frederic --- hw/s390-virtio-bus.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index 849adab..eba4f3f 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -165,14 +165,13 @@ static int s390_virtio_net_init(VirtIOS390Device *dev) static int s390_virtio_blk_init(VirtIOS390Device *dev) { - VirtIODevice *vdev; - - vdev = virtio_blk_init((DeviceState *)dev, &dev->blk); - if (!vdev) { + DeviceState *vdev; + vdev = qdev_create(BUS(dev->bus), "virtio-blk"); + virtio_blk_set_conf(vdev, &(dev->blk)); + if (qdev_init(vdev) < 0) { return -1; } - - return s390_virtio_device_init(dev, vdev); + return s390_virtio_device_init(dev, VIRTIO_DEVICE(vdev)); } static int s390_virtio_serial_init(VirtIOS390Device *dev)