From nobody Mon Feb 9 11:29:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498723814554480.80230259746077; Thu, 29 Jun 2017 01:10:14 -0700 (PDT) Received: from localhost ([::1]:37539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQUWj-0008KC-8y for importer@patchew.org; Thu, 29 Jun 2017 04:10:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQURw-00043s-2h for qemu-devel@nongnu.org; Thu, 29 Jun 2017 04:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQURu-0003QX-GW for qemu-devel@nongnu.org; Thu, 29 Jun 2017 04:05:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58342) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQURu-0003QD-7w for qemu-devel@nongnu.org; Thu, 29 Jun 2017 04:05:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3DB8080E7C; Thu, 29 Jun 2017 08:05:13 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-36.pek2.redhat.com [10.72.12.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 402E789C94; Thu, 29 Jun 2017 08:05:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3DB8080E7C Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=famz@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3DB8080E7C From: Fam Zheng To: qemu-devel@nongnu.org Date: Thu, 29 Jun 2017 16:04:50 +0800 Message-Id: <20170629080452.26470-6-famz@redhat.com> In-Reply-To: <20170629080452.26470-1-famz@redhat.com> References: <20170629080452.26470-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 29 Jun 2017 08:05:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 5/7] virtio-blk: Use DEFINE_PROP_LINK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "Dr . David Alan Gilbert" , Markus Armbruster , =?UTF-8?q?Andreas=20F=C3=A4rber?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- hw/block/dataplane/virtio-blk.c | 2 +- hw/block/virtio-blk.c | 7 +++---- hw/virtio/virtio-pci.c | 2 -- include/hw/virtio/virtio-blk.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-bl= k.c index 5556f0e..6fdc6f6 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -116,7 +116,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, V= irtIOBlkConf *conf, s->conf =3D conf; =20 if (conf->iothread) { - s->iothread =3D conf->iothread; + s->iothread =3D IOTHREAD(conf->iothread); object_ref(OBJECT(s->iothread)); s->ctx =3D iothread_get_aio_context(s->iothread); } else { diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 604d37d..aa2c38c 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -981,10 +981,6 @@ static void virtio_blk_instance_init(Object *obj) { VirtIOBlock *s =3D VIRTIO_BLK(obj); =20 - object_property_add_link(obj, "iothread", TYPE_IOTHREAD, - (Object **)&s->conf.iothread, - qdev_prop_allow_set_link_before_realize, - OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL); device_add_bootindex_property(obj, &s->conf.conf.bootindex, "bootindex", "/disk@0,0", DEVICE(obj), NULL); @@ -1012,6 +1008,9 @@ static Property virtio_blk_properties[] =3D { DEFINE_PROP_BIT("request-merging", VirtIOBlock, conf.request_merging, = 0, true), DEFINE_PROP_UINT16("num-queues", VirtIOBlock, conf.num_queues, 1), + DEFINE_PROP_LINK("iothread", VirtIOBlock, conf.iothread, TYPE_IOTHREAD, + qdev_prop_allow_set_link_before_realize, + OBJ_PROP_LINK_UNREF_ON_RELEASE), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 20d6a08..e6960ae 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1996,8 +1996,6 @@ static void virtio_blk_pci_instance_init(Object *obj) =20 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BLK); - object_property_add_alias(obj, "iothread", OBJECT(&dev->vdev),"iothrea= d", - &error_abort); object_property_add_alias(obj, "bootindex", OBJECT(&dev->vdev), "bootindex", &error_abort); } diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index d3c8a6f..94a9f0c 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -33,7 +33,7 @@ struct virtio_blk_inhdr struct VirtIOBlkConf { BlockConf conf; - IOThread *iothread; + Object *iothread; char *serial; uint32_t scsi; uint32_t config_wce; --=20 2.9.4