From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696507323289.3822277084387; Tue, 19 Dec 2017 07:15:07 -0800 (PST) Received: from localhost ([::1]:49232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJbh-00064z-4g for importer@patchew.org; Tue, 19 Dec 2017 10:15:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJYk-00040S-R6 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJYj-0006Qj-Il for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:11:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35542) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJYj-0006Pn-2b for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:11:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5219649038; Tue, 19 Dec 2017 15:11:56 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id C68335C552; Tue, 19 Dec 2017 15:11:50 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:22 +0000 Message-Id: <20171219151144.11120-2-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:11:56 +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] [PULL v2 01/23] coroutine: simplify co_aio_sleep_ns() prototype 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: Peter Maydell , Stefan Hajnoczi 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" The AioContext pointer argument to co_aio_sleep_ns() is only used for the sleep timer. It does not affect where the caller coroutine is resumed. Due to changes to coroutine and AIO APIs it is now possible to drop the AioContext pointer argument. This is safe to do since no caller has specific requirements for which AioContext the timer must run in. This patch drops the AioContext pointer argument and renames the function to simplify the API. Reported-by: Paolo Bonzini Reported-by: Eric Blake Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171109102652.6360-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- include/qemu/coroutine.h | 6 +----- block/null.c | 3 +-- block/sheepdog.c | 3 +-- util/qemu-coroutine-sleep.c | 4 ++-- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index 9aff9a735e..ce2eb73670 100644 --- a/include/qemu/coroutine.h +++ b/include/qemu/coroutine.h @@ -261,12 +261,8 @@ void qemu_co_rwlock_unlock(CoRwlock *lock); =20 /** * Yield the coroutine for a given duration - * - * Behaves similarly to co_sleep_ns(), but the sleeping coroutine will be - * resumed when using aio_poll(). */ -void coroutine_fn co_aio_sleep_ns(AioContext *ctx, QEMUClockType type, - int64_t ns); +void coroutine_fn qemu_co_sleep_ns(QEMUClockType type, int64_t ns); =20 /** * Yield until a file descriptor becomes readable diff --git a/block/null.c b/block/null.c index dd9c13f9ba..0cdabaa440 100644 --- a/block/null.c +++ b/block/null.c @@ -110,8 +110,7 @@ static coroutine_fn int null_co_common(BlockDriverState= *bs) BDRVNullState *s =3D bs->opaque; =20 if (s->latency_ns) { - co_aio_sleep_ns(bdrv_get_aio_context(bs), QEMU_CLOCK_REALTIME, - s->latency_ns); + qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, s->latency_ns); } return 0; } diff --git a/block/sheepdog.c b/block/sheepdog.c index 696a71442a..a1edb992ff 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -776,8 +776,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque) if (s->fd < 0) { DPRINTF("Wait for connection to be established\n"); error_report_err(local_err); - co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTI= ME, - 1000000000ULL); + qemu_co_sleep_ns(QEMU_CLOCK_REALTIME, 1000000000ULL); } }; =20 diff --git a/util/qemu-coroutine-sleep.c b/util/qemu-coroutine-sleep.c index 254349cdbb..afb678fbe5 100644 --- a/util/qemu-coroutine-sleep.c +++ b/util/qemu-coroutine-sleep.c @@ -31,9 +31,9 @@ static void co_sleep_cb(void *opaque) aio_co_wake(sleep_cb->co); } =20 -void coroutine_fn co_aio_sleep_ns(AioContext *ctx, QEMUClockType type, - int64_t ns) +void coroutine_fn qemu_co_sleep_ns(QEMUClockType type, int64_t ns) { + AioContext *ctx =3D qemu_get_current_aio_context(); CoSleepCB sleep_cb =3D { .co =3D qemu_coroutine_self(), }; --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 1513696466730167.4055123045821; Tue, 19 Dec 2017 07:14:26 -0800 (PST) Received: from localhost ([::1]:49229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJau-0005JC-CJ for importer@patchew.org; Tue, 19 Dec 2017 10:14:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJYr-00044p-Nb for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJYo-0006Tm-FG for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53962) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJYo-0006TO-8W for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:02 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B81F5F7AF; Tue, 19 Dec 2017 15:12:01 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD81718663; Tue, 19 Dec 2017 15:11:57 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:23 +0000 Message-Id: <20171219151144.11120-3-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Dec 2017 15:12:01 +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] [PULL v2 02/23] hw/block/nvme: Convert to realize 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: Kevin Wolf , Peter Maydell , Mao Zhongyi , Markus Armbruster , Max Reitz , Keith Busch , Stefan Hajnoczi , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Convert nvme_init() to realize and rename it to nvme_realize(). Cc: John Snow Cc: Keith Busch Cc: Kevin Wolf Cc: Max Reitz Cc: Markus Armbruster Signed-off-by: Mao Zhongyi Message-id: 2882e72d795e04cbe2120f569d551aef2467ac60.1511317952.git.maozy.f= nst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- hw/block/nvme.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 441e21ed1f..e530ba7a30 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -920,7 +920,7 @@ static const MemoryRegionOps nvme_cmb_ops =3D { }, }; =20 -static int nvme_init(PCIDevice *pci_dev) +static void nvme_realize(PCIDevice *pci_dev, Error **errp) { NvmeCtrl *n =3D NVME(pci_dev); NvmeIdCtrl *id =3D &n->id_ctrl; @@ -931,24 +931,27 @@ static int nvme_init(PCIDevice *pci_dev) Error *local_err =3D NULL; =20 if (!n->conf.blk) { - return -1; + error_setg(errp, "drive property not set"); + return; } =20 bs_size =3D blk_getlength(n->conf.blk); if (bs_size < 0) { - return -1; + error_setg(errp, "could not get backing file size"); + return; } =20 blkconf_serial(&n->conf, &n->serial); if (!n->serial) { - return -1; + error_setg(errp, "serial property not set"); + return; } blkconf_blocksizes(&n->conf); blkconf_apply_backend_options(&n->conf, blk_is_read_only(n->conf.blk), false, &local_err); if (local_err) { - error_report_err(local_err); - return -1; + error_propagate(errp, local_err); + return; } =20 pci_conf =3D pci_dev->config; @@ -1046,7 +1049,6 @@ static int nvme_init(PCIDevice *pci_dev) cpu_to_le64(n->ns_size >> id_ns->lbaf[NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas)].ds); } - return 0; } =20 static void nvme_exit(PCIDevice *pci_dev) @@ -1081,7 +1083,7 @@ static void nvme_class_init(ObjectClass *oc, void *da= ta) DeviceClass *dc =3D DEVICE_CLASS(oc); PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(oc); =20 - pc->init =3D nvme_init; + pc->realize =3D nvme_realize; pc->exit =3D nvme_exit; pc->class_id =3D PCI_CLASS_STORAGE_EXPRESS; pc->vendor_id =3D PCI_VENDOR_ID_INTEL; --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 1513696494098999.3838782279709; Tue, 19 Dec 2017 07:14:54 -0800 (PST) Received: from localhost ([::1]:49230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJbI-0005eJ-Nu for importer@patchew.org; Tue, 19 Dec 2017 10:14:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZ2-0004EZ-Iv for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJYw-0006XP-76 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47722) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJYv-0006Wu-U6 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:10 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15F6EC00DBB1; Tue, 19 Dec 2017 15:12:09 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAE541964A; Tue, 19 Dec 2017 15:12:02 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:24 +0000 Message-Id: <20171219151144.11120-4-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Dec 2017 15:12:09 +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] [PULL v2 03/23] hw/block: Fix the return type 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: Kevin Wolf , Peter Maydell , Mao Zhongyi , Max Reitz , Stefan Hajnoczi , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi When the function no success value to transmit, it usually make the function return void. It has turned out not to be a success, because it means that the extra local_err variable and error_propagate() will be needed. It leads to cumbersome code, therefore, transmit success/ failure in the return value is worth. So fix the return type of blkconf_apply_backend_options(), blkconf_geometry() and virtio_blk_data_plane_create() to avoid it. Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Stefan Hajnoczi Signed-off-by: Mao Zhongyi Reviewed-by: Stefan Hajnoczi Message-id: ac0edc1fc70c4457e5cec94405eb7d1f89f9c2c1.1511317952.git.maozy.f= nst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.h | 2 +- include/hw/block/block.h | 4 ++-- hw/block/block.c | 15 +++++++++------ hw/block/dataplane/virtio-blk.c | 12 +++++++----- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.h b/hw/block/dataplane/virtio-bl= k.h index db3f47b173..5e18bb99ae 100644 --- a/hw/block/dataplane/virtio-blk.h +++ b/hw/block/dataplane/virtio-blk.h @@ -19,7 +19,7 @@ =20 typedef struct VirtIOBlockDataPlane VirtIOBlockDataPlane; =20 -void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, +bool virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, VirtIOBlockDataPlane **dataplane, Error **errp); void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s); diff --git a/include/hw/block/block.h b/include/hw/block/block.h index f3f6e8ef02..64b9298829 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -72,11 +72,11 @@ static inline unsigned int get_physical_block_exp(Block= Conf *conf) /* Configuration helpers */ =20 void blkconf_serial(BlockConf *conf, char **serial); -void blkconf_geometry(BlockConf *conf, int *trans, +bool blkconf_geometry(BlockConf *conf, int *trans, unsigned cyls_max, unsigned heads_max, unsigned secs= _max, Error **errp); void blkconf_blocksizes(BlockConf *conf); -void blkconf_apply_backend_options(BlockConf *conf, bool readonly, +bool blkconf_apply_backend_options(BlockConf *conf, bool readonly, bool resizable, Error **errp); =20 /* Hard disk geometry */ diff --git a/hw/block/block.c b/hw/block/block.c index 27878d0087..b0269c857f 100644 --- a/hw/block/block.c +++ b/hw/block/block.c @@ -51,7 +51,7 @@ void blkconf_blocksizes(BlockConf *conf) } } =20 -void blkconf_apply_backend_options(BlockConf *conf, bool readonly, +bool blkconf_apply_backend_options(BlockConf *conf, bool readonly, bool resizable, Error **errp) { BlockBackend *blk =3D conf->blk; @@ -76,7 +76,7 @@ void blkconf_apply_backend_options(BlockConf *conf, bool = readonly, =20 ret =3D blk_set_perm(blk, perm, shared_perm, errp); if (ret < 0) { - return; + return false; } =20 switch (conf->wce) { @@ -99,9 +99,11 @@ void blkconf_apply_backend_options(BlockConf *conf, bool= readonly, =20 blk_set_enable_write_cache(blk, wce); blk_set_on_error(blk, rerror, werror); + + return true; } =20 -void blkconf_geometry(BlockConf *conf, int *ptrans, +bool blkconf_geometry(BlockConf *conf, int *ptrans, unsigned cyls_max, unsigned heads_max, unsigned secs= _max, Error **errp) { @@ -129,15 +131,16 @@ void blkconf_geometry(BlockConf *conf, int *ptrans, if (conf->cyls || conf->heads || conf->secs) { if (conf->cyls < 1 || conf->cyls > cyls_max) { error_setg(errp, "cyls must be between 1 and %u", cyls_max); - return; + return false; } if (conf->heads < 1 || conf->heads > heads_max) { error_setg(errp, "heads must be between 1 and %u", heads_max); - return; + return false; } if (conf->secs < 1 || conf->secs > secs_max) { error_setg(errp, "secs must be between 1 and %u", secs_max); - return; + return false; } } + return true; } diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-bl= k.c index 5556f0e64e..f6fc639e88 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -76,7 +76,7 @@ static void notify_guest_bh(void *opaque) } =20 /* Context: QEMU global mutex held */ -void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, +bool virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, VirtIOBlockDataPlane **dataplane, Error **errp) { @@ -91,11 +91,11 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, V= irtIOBlkConf *conf, error_setg(errp, "device is incompatible with iothread " "(transport does not support notifiers)"); - return; + return false; } if (!virtio_device_ioeventfd_enabled(vdev)) { error_setg(errp, "ioeventfd is required for iothread"); - return; + return false; } =20 /* If dataplane is (re-)enabled while the guest is running there c= ould @@ -103,12 +103,12 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev,= VirtIOBlkConf *conf, */ if (blk_op_is_blocked(conf->conf.blk, BLOCK_OP_TYPE_DATAPLANE, err= p)) { error_prepend(errp, "cannot start virtio-blk dataplane: "); - return; + return false; } } /* Don't try if transport does not support notifiers. */ if (!virtio_device_ioeventfd_enabled(vdev)) { - return; + return false; } =20 s =3D g_new0(VirtIOBlockDataPlane, 1); @@ -126,6 +126,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, V= irtIOBlkConf *conf, s->batch_notify_vqs =3D bitmap_new(conf->num_queues); =20 *dataplane =3D s; + + return true; } =20 /* Context: QEMU global mutex held */ --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696699424985.9151570014349; Tue, 19 Dec 2017 07:18:19 -0800 (PST) Received: from localhost ([::1]:49284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJei-0000D3-3v for importer@patchew.org; Tue, 19 Dec 2017 10:18:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZ9-0004Ko-UJ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZ8-0006cM-7m for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35952) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZ7-0006bY-W2 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F8DE49022; Tue, 19 Dec 2017 15:12:21 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73E581B46A; Tue, 19 Dec 2017 15:12:10 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:25 +0000 Message-Id: <20171219151144.11120-5-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:12:21 +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] [PULL v2 04/23] hw/block: Use errp directly rather than local_err 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: Kevin Wolf , Peter Maydell , Mao Zhongyi , "Michael S. Tsirkin" , Markus Armbruster , Max Reitz , Keith Busch , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow 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" From: Mao Zhongyi [Drop virtio_blk_data_plane_create() change that misinterprets return value when the virtio transport does not support dataplane. --Stefan] Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Keith Busch Cc: Stefan Hajnoczi Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Markus Armbruster Signed-off-by: Mao Zhongyi Reviewed-by: Stefan Hajnoczi Message-id: e77848d3735ba590f23ffbf8094379c646c33d79.1511317952.git.maozy.f= nst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- hw/block/fdc.c | 17 ++++++----------- hw/block/nvme.c | 7 ++----- hw/block/virtio-blk.c | 13 +++++-------- hw/ide/qdev.c | 12 ++++-------- hw/scsi/scsi-disk.c | 13 ++++--------- hw/usb/dev-storage.c | 9 +++------ 6 files changed, 24 insertions(+), 47 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 67f78ac702..7b7dd41296 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -473,16 +473,13 @@ static void fd_revalidate(FDrive *drv) static void fd_change_cb(void *opaque, bool load, Error **errp) { FDrive *drive =3D opaque; - Error *local_err =3D NULL; =20 if (!load) { blk_set_perm(drive->blk, 0, BLK_PERM_ALL, &error_abort); } else { - blkconf_apply_backend_options(drive->conf, - blk_is_read_only(drive->blk), false, - &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!blkconf_apply_backend_options(drive->conf, + blk_is_read_only(drive->blk), f= alse, + errp)) { return; } } @@ -522,7 +519,6 @@ static void floppy_drive_realize(DeviceState *qdev, Err= or **errp) FloppyDrive *dev =3D FLOPPY_DRIVE(qdev); FloppyBus *bus =3D FLOPPY_BUS(qdev->parent_bus); FDrive *drive; - Error *local_err =3D NULL; int ret; =20 if (dev->unit =3D=3D -1) { @@ -568,10 +564,9 @@ static void floppy_drive_realize(DeviceState *qdev, Er= ror **errp) dev->conf.rerror =3D BLOCKDEV_ON_ERROR_AUTO; dev->conf.werror =3D BLOCKDEV_ON_ERROR_AUTO; =20 - blkconf_apply_backend_options(&dev->conf, blk_is_read_only(dev->conf.b= lk), - false, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!blkconf_apply_backend_options(&dev->conf, + blk_is_read_only(dev->conf.blk), + false, errp)) { return; } =20 diff --git a/hw/block/nvme.c b/hw/block/nvme.c index e530ba7a30..e529e88e4e 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -928,7 +928,6 @@ static void nvme_realize(PCIDevice *pci_dev, Error **er= rp) int i; int64_t bs_size; uint8_t *pci_conf; - Error *local_err =3D NULL; =20 if (!n->conf.blk) { error_setg(errp, "drive property not set"); @@ -947,10 +946,8 @@ static void nvme_realize(PCIDevice *pci_dev, Error **e= rrp) return; } blkconf_blocksizes(&n->conf); - blkconf_apply_backend_options(&n->conf, blk_is_read_only(n->conf.blk), - false, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!blkconf_apply_backend_options(&n->conf, blk_is_read_only(n->conf.= blk), + false, errp)) { return; } =20 diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 05d1440786..41a4ccdede 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -930,19 +930,16 @@ static void virtio_blk_device_realize(DeviceState *de= v, Error **errp) } =20 blkconf_serial(&conf->conf, &conf->serial); - blkconf_apply_backend_options(&conf->conf, - blk_is_read_only(conf->conf.blk), true, - &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_apply_backend_options(&conf->conf, + blk_is_read_only(conf->conf.blk), t= rue, + errp)) { return; } s->original_wce =3D blk_enable_write_cache(conf->conf.blk); - blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, errp)) { return; } + blkconf_blocksizes(&conf->conf); =20 virtio_init(vdev, "virtio-blk", VIRTIO_ID_BLOCK, diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index a5181b4448..f395d24592 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -160,7 +160,6 @@ static void ide_dev_initfn(IDEDevice *dev, IDEDriveKind= kind, Error **errp) { IDEBus *bus =3D DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); IDEState *s =3D bus->ifs + dev->unit; - Error *err =3D NULL; int ret; =20 if (!dev->conf.blk) { @@ -191,16 +190,13 @@ static void ide_dev_initfn(IDEDevice *dev, IDEDriveKi= nd kind, Error **errp) =20 blkconf_serial(&dev->conf, &dev->serial); if (kind !=3D IDE_CD) { - blkconf_geometry(&dev->conf, &dev->chs_trans, 65535, 16, 255, &err= ); - if (err) { - error_propagate(errp, err); + if (!blkconf_geometry(&dev->conf, &dev->chs_trans, 65535, 16, 255, + errp)) { return; } } - blkconf_apply_backend_options(&dev->conf, kind =3D=3D IDE_CD, kind != =3D IDE_CD, - &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_apply_backend_options(&dev->conf, kind =3D=3D IDE_CD, + kind !=3D IDE_CD, errp)) { return; } =20 diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 12431177a7..870d9ae85a 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2332,7 +2332,6 @@ static void scsi_disk_unit_attention_reported(SCSIDev= ice *dev) static void scsi_realize(SCSIDevice *dev, Error **errp) { SCSIDiskState *s =3D DO_UPCAST(SCSIDiskState, qdev, dev); - Error *err =3D NULL; =20 if (!s->qdev.conf.blk) { error_setg(errp, "drive property not set"); @@ -2356,17 +2355,13 @@ static void scsi_realize(SCSIDevice *dev, Error **e= rrp) } =20 if (dev->type =3D=3D TYPE_DISK) { - blkconf_geometry(&dev->conf, NULL, 65535, 255, 255, &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_geometry(&dev->conf, NULL, 65535, 255, 255, errp)) { return; } } - blkconf_apply_backend_options(&dev->conf, - blk_is_read_only(s->qdev.conf.blk), - dev->type =3D=3D TYPE_DISK, &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_apply_backend_options(&dev->conf, + blk_is_read_only(s->qdev.conf.blk), + dev->type =3D=3D TYPE_DISK, errp)) { return; } =20 diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 8a61ec94c8..a9bcc67e67 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -601,7 +601,6 @@ static void usb_msd_realize_storage(USBDevice *dev, Err= or **errp) MSDState *s =3D USB_STORAGE_DEV(dev); BlockBackend *blk =3D s->conf.blk; SCSIDevice *scsi_dev; - Error *err =3D NULL; =20 if (!blk) { error_setg(errp, "drive property not set"); @@ -610,9 +609,8 @@ static void usb_msd_realize_storage(USBDevice *dev, Err= or **errp) =20 blkconf_serial(&s->conf, &dev->serial); blkconf_blocksizes(&s->conf); - blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), true, &= err); - if (err) { - error_propagate(errp, err); + if (!blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), tr= ue, + errp)) { return; } =20 @@ -636,10 +634,9 @@ static void usb_msd_realize_storage(USBDevice *dev, Er= ror **errp) &usb_msd_scsi_info_storage, NULL); scsi_dev =3D scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable, s->conf.bootindex, dev->serial, - &err); + errp); blk_unref(blk); if (!scsi_dev) { - error_propagate(errp, err); return; } usb_msd_handle_reset(dev); --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 151369674352055.885482201064065; Tue, 19 Dec 2017 07:19:03 -0800 (PST) Received: from localhost ([::1]:49295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJfV-0000sS-9r for importer@patchew.org; Tue, 19 Dec 2017 10:18:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZI-0004Rb-DV for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZE-0006fe-54 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54358) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZD-0006fB-Su for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:28 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 191516147B; Tue, 19 Dec 2017 15:12:27 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9A55189EB; Tue, 19 Dec 2017 15:12:22 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:26 +0000 Message-Id: <20171219151144.11120-6-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Dec 2017 15:12:27 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL v2 05/23] dev-storage: Fix the unusual function name 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: Peter Maydell , Mao Zhongyi , Gerd Hoffmann , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi The function name of usb_msd_{realize,unrealize}_*, usb_msd_class_initfn_* are unusual. Rename it to usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 11e6003433abce35f3f4970e1acc71ee92dbcf51.1511317952.git.maozy.f= nst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- hw/usb/dev-storage.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index a9bcc67e67..9722ac854c 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -596,7 +596,7 @@ static void usb_msd_unrealize_storage(USBDevice *dev, E= rror **errp) object_unref(OBJECT(&s->bus)); } =20 -static void usb_msd_realize_storage(USBDevice *dev, Error **errp) +static void usb_msd_storage_realize(USBDevice *dev, Error **errp) { MSDState *s =3D USB_STORAGE_DEV(dev); BlockBackend *blk =3D s->conf.blk; @@ -643,14 +643,14 @@ static void usb_msd_realize_storage(USBDevice *dev, E= rror **errp) s->scsi_dev =3D scsi_dev; } =20 -static void usb_msd_unrealize_bot(USBDevice *dev, Error **errp) +static void usb_msd_bot_unrealize(USBDevice *dev, Error **errp) { MSDState *s =3D USB_STORAGE_DEV(dev); =20 object_unref(OBJECT(&s->bus)); } =20 -static void usb_msd_realize_bot(USBDevice *dev, Error **errp) +static void usb_msd_bot_realize(USBDevice *dev, Error **errp) { MSDState *s =3D USB_STORAGE_DEV(dev); DeviceState *d =3D DEVICE(dev); @@ -764,12 +764,12 @@ static void usb_msd_class_initfn_common(ObjectClass *= klass, void *data) dc->vmsd =3D &vmstate_usb_msd; } =20 -static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data) +static void usb_msd_class_storage_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); USBDeviceClass *uc =3D USB_DEVICE_CLASS(klass); =20 - uc->realize =3D usb_msd_realize_storage; + uc->realize =3D usb_msd_storage_realize; uc->unrealize =3D usb_msd_unrealize_storage; dc->props =3D msd_properties; } @@ -828,26 +828,26 @@ static void usb_msd_instance_init(Object *obj) object_property_set_int(obj, -1, "bootindex", NULL); } =20 -static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data) +static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data) { USBDeviceClass *uc =3D USB_DEVICE_CLASS(klass); =20 - uc->realize =3D usb_msd_realize_bot; - uc->unrealize =3D usb_msd_unrealize_bot; + uc->realize =3D usb_msd_bot_realize; + uc->unrealize =3D usb_msd_bot_unrealize; uc->attached_settable =3D true; } =20 static const TypeInfo msd_info =3D { .name =3D "usb-storage", .parent =3D TYPE_USB_STORAGE, - .class_init =3D usb_msd_class_initfn_storage, + .class_init =3D usb_msd_class_storage_initfn, .instance_init =3D usb_msd_instance_init, }; =20 static const TypeInfo bot_info =3D { .name =3D "usb-bot", .parent =3D TYPE_USB_STORAGE, - .class_init =3D usb_msd_class_initfn_bot, + .class_init =3D usb_msd_class_bot_initfn, }; =20 static void usb_msd_register_types(void) --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 1513696930974461.9776172300077; Tue, 19 Dec 2017 07:22:10 -0800 (PST) Received: from localhost ([::1]:49323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJiO-0003Ln-P4 for importer@patchew.org; Tue, 19 Dec 2017 10:21:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZK-0004TS-Fi for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZJ-0006hv-NC for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48140) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZJ-0006hV-HW for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:33 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFAEAC01BCB4; Tue, 19 Dec 2017 15:12:32 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D7A918673; Tue, 19 Dec 2017 15:12:28 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:27 +0000 Message-Id: <20171219151144.11120-7-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Dec 2017 15:12:32 +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] [PULL v2 06/23] qdev: drop unused #include "sysemu/iothread.h" 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: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 1351d1ec89eabebc9fdff20451a62c413d7accc1 ("qdev: drop iothread property type") forgot to remove this include. Signed-off-by: Stefan Hajnoczi Message-id: 20171205133954.31006-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/core/qdev-properties-system.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index c17364655c..46b3843cf8 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -22,7 +22,6 @@ #include "qapi/visitor.h" #include "chardev/char-fe.h" #include "sysemu/tpm_backend.h" -#include "sysemu/iothread.h" =20 static void get_pointer(Object *obj, Visitor *v, Property *prop, char *(*print)(void *ptr), --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697102052288.0317392851889; Tue, 19 Dec 2017 07:25:02 -0800 (PST) Received: from localhost ([::1]:49339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJlF-0005lw-Tr for importer@patchew.org; Tue, 19 Dec 2017 10:24:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZS-0004Yh-IQ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZO-0006kX-3o for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45988) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZN-0006kF-T7 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:38 -0500 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 232732D5A0A; Tue, 19 Dec 2017 15:12:37 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3894460C80; Tue, 19 Dec 2017 15:12:34 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:28 +0000 Message-Id: <20171219151144.11120-8-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@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.29]); Tue, 19 Dec 2017 15:12:37 +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] [PULL v2 07/23] blockdev: hold AioContext for bdrv_unref() in external_snapshot_clean() 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: Peter Maydell , Stefan Hajnoczi 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" bdrv_unref() requires the AioContext lock because bdrv_flush() uses BDRV_POLL_WHILE(), which assumes the AioContext is currently held. If BDRV_POLL_WHILE() runs without AioContext held the pthread_mutex_unlock() call in aio_context_release() fails. This patch moves bdrv_unref() into the AioContext locked region to solve the following pthread_mutex_unlock() failure: #0 0x00007f566181969b in raise () at /lib64/libc.so.6 #1 0x00007f566181b3b1 in abort () at /lib64/libc.so.6 #2 0x00005592cd590458 in error_exit (err=3D, msg=3Dmsg@en= try=3D0x5592cdaf6d60 <__func__.23977> "qemu_mutex_unlock") at util/qemu-thr= ead-posix.c:36 #3 0x00005592cd96e738 in qemu_mutex_unlock (mutex=3Dmutex@entry=3D0x5592= ce9505e0) at util/qemu-thread-posix.c:96 #4 0x00005592cd969b69 in aio_context_release (ctx=3Dctx@entry=3D0x5592ce= 950580) at util/async.c:507 #5 0x00005592cd8ead78 in bdrv_flush (bs=3Dbs@entry=3D0x5592cfa87210) at = block/io.c:2478 #6 0x00005592cd89df30 in bdrv_close (bs=3D0x5592cfa87210) at block.c:3207 #7 0x00005592cd89df30 in bdrv_delete (bs=3D0x5592cfa87210) at block.c:33= 95 #8 0x00005592cd89df30 in bdrv_unref (bs=3D0x5592cfa87210) at block.c:4418 #9 0x00005592cd6b7f86 in qmp_transaction (dev_list=3D, ha= s_props=3D, props=3D, errp=3Derrp@entry=3D0x7= ffe4a1fc9d8) at blockdev.c:2308 Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 56a6b24a0b..3c8d994ced 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1812,8 +1812,8 @@ static void external_snapshot_clean(BlkActionState *c= ommon) DO_UPCAST(ExternalSnapshotState, common, comm= on); if (state->aio_context) { bdrv_drained_end(state->old_bs); - aio_context_release(state->aio_context); bdrv_unref(state->new_bs); + aio_context_release(state->aio_context); } } =20 --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513697280276782.5250530494042; Tue, 19 Dec 2017 07:28:00 -0800 (PST) Received: from localhost ([::1]:49360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJo4-0008Mz-4c for importer@patchew.org; Tue, 19 Dec 2017 10:27:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZX-0004cp-07 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZV-0006s6-D4 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36334) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZV-0006qg-2S for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:45 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51FC35BEC9; Tue, 19 Dec 2017 15:12:44 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id B37F35C552; Tue, 19 Dec 2017 15:12:38 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:29 +0000 Message-Id: <20171219151144.11120-9-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:12:44 +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] [PULL v2 08/23] block: don't keep AioContext acquired after external_snapshot_prepare() 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: Peter Maydell , Stefan Hajnoczi 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" It is not necessary to hold AioContext across transactions anymore since bdrv_drained_begin/end() is used to keep the nodes quiesced. In fact, using the AioContext lock for this purpose was always buggy. This patch reduces the scope of AioContext locked regions. This is not just a cleanup but also fixes hangs that occur in BDRV_POLL_WHILE() because it is unware of recursive locking and does not release the AioContext the necessary number of times to allow progress to be made. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 71 ++++++++++++++++++++++++++++++++++++++++++----------------= ---- 1 file changed, 48 insertions(+), 23 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3c8d994ced..3b598f8f0e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1606,7 +1606,6 @@ typedef struct ExternalSnapshotState { BlkActionState common; BlockDriverState *old_bs; BlockDriverState *new_bs; - AioContext *aio_context; bool overlay_appended; } ExternalSnapshotState; =20 @@ -1626,6 +1625,7 @@ static void external_snapshot_prepare(BlkActionState = *common, ExternalSnapshotState *state =3D DO_UPCAST(ExternalSnapshotState, common, comm= on); TransactionAction *action =3D common->action; + AioContext *aio_context; =20 /* 'blockdev-snapshot' and 'blockdev-snapshot-sync' have similar * purpose but a different set of parameters */ @@ -1662,31 +1662,32 @@ static void external_snapshot_prepare(BlkActionStat= e *common, return; } =20 - /* Acquire AioContext now so any threads operating on old_bs stop */ - state->aio_context =3D bdrv_get_aio_context(state->old_bs); - aio_context_acquire(state->aio_context); + aio_context =3D bdrv_get_aio_context(state->old_bs); + aio_context_acquire(aio_context); + + /* Paired with .clean() */ bdrv_drained_begin(state->old_bs); =20 if (!bdrv_is_inserted(state->old_bs)) { error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, device); - return; + goto out; } =20 if (bdrv_op_is_blocked(state->old_bs, BLOCK_OP_TYPE_EXTERNAL_SNAPSHOT, errp)) { - return; + goto out; } =20 if (!bdrv_is_read_only(state->old_bs)) { if (bdrv_flush(state->old_bs)) { error_setg(errp, QERR_IO_ERROR); - return; + goto out; } } =20 if (!bdrv_is_first_non_filter(state->old_bs)) { error_setg(errp, QERR_FEATURE_DISABLED, "snapshot"); - return; + goto out; } =20 if (action->type =3D=3D TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC= ) { @@ -1698,13 +1699,13 @@ static void external_snapshot_prepare(BlkActionStat= e *common, =20 if (node_name && !snapshot_node_name) { error_setg(errp, "New snapshot node name missing"); - return; + goto out; } =20 if (snapshot_node_name && bdrv_lookup_bs(snapshot_node_name, snapshot_node_name, NULL)) { error_setg(errp, "New snapshot node name already in use"); - return; + goto out; } =20 flags =3D state->old_bs->open_flags; @@ -1717,7 +1718,7 @@ static void external_snapshot_prepare(BlkActionState = *common, int64_t size =3D bdrv_getlength(state->old_bs); if (size < 0) { error_setg_errno(errp, -size, "bdrv_getlength failed"); - return; + goto out; } bdrv_img_create(new_image_file, format, state->old_bs->filename, @@ -1725,7 +1726,7 @@ static void external_snapshot_prepare(BlkActionState = *common, NULL, size, flags, false, &local_err); if (local_err) { error_propagate(errp, local_err); - return; + goto out; } } =20 @@ -1740,30 +1741,30 @@ static void external_snapshot_prepare(BlkActionStat= e *common, errp); /* We will manually add the backing_hd field to the bs later */ if (!state->new_bs) { - return; + goto out; } =20 if (bdrv_has_blk(state->new_bs)) { error_setg(errp, "The snapshot is already in use"); - return; + goto out; } =20 if (bdrv_op_is_blocked(state->new_bs, BLOCK_OP_TYPE_EXTERNAL_SNAPSHOT, errp)) { - return; + goto out; } =20 if (state->new_bs->backing !=3D NULL) { error_setg(errp, "The snapshot already has a backing image"); - return; + goto out; } =20 if (!state->new_bs->drv->supports_backing) { error_setg(errp, "The snapshot does not support backing images"); - return; + goto out; } =20 - bdrv_set_aio_context(state->new_bs, state->aio_context); + bdrv_set_aio_context(state->new_bs, aio_context); =20 /* This removes our old bs and adds the new bs. This is an operation t= hat * can fail, so we need to do it in .prepare; undoing it for abort is @@ -1772,15 +1773,22 @@ static void external_snapshot_prepare(BlkActionStat= e *common, bdrv_append(state->new_bs, state->old_bs, &local_err); if (local_err) { error_propagate(errp, local_err); - return; + goto out; } state->overlay_appended =3D true; + +out: + aio_context_release(aio_context); } =20 static void external_snapshot_commit(BlkActionState *common) { ExternalSnapshotState *state =3D DO_UPCAST(ExternalSnapshotState, common, comm= on); + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->old_bs); + aio_context_acquire(aio_context); =20 /* We don't need (or want) to use the transactional * bdrv_reopen_multiple() across all the entries at once, because we @@ -1789,6 +1797,8 @@ static void external_snapshot_commit(BlkActionState *= common) bdrv_reopen(state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDW= R, NULL); } + + aio_context_release(aio_context); } =20 static void external_snapshot_abort(BlkActionState *common) @@ -1797,11 +1807,18 @@ static void external_snapshot_abort(BlkActionState = *common) DO_UPCAST(ExternalSnapshotState, common, comm= on); if (state->new_bs) { if (state->overlay_appended) { + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->old_bs); + aio_context_acquire(aio_context); + bdrv_ref(state->old_bs); /* we can't let bdrv_set_backind_hd= () close state->old_bs; we need it = */ bdrv_set_backing_hd(state->new_bs, NULL, &error_abort); bdrv_replace_node(state->new_bs, state->old_bs, &error_abort); bdrv_unref(state->old_bs); /* bdrv_replace_node() ref'ed old_b= s */ + + aio_context_release(aio_context); } } } @@ -1810,11 +1827,19 @@ static void external_snapshot_clean(BlkActionState = *common) { ExternalSnapshotState *state =3D DO_UPCAST(ExternalSnapshotState, common, comm= on); - if (state->aio_context) { - bdrv_drained_end(state->old_bs); - bdrv_unref(state->new_bs); - aio_context_release(state->aio_context); + AioContext *aio_context; + + if (!state->old_bs) { + return; } + + aio_context =3D bdrv_get_aio_context(state->old_bs); + aio_context_acquire(aio_context); + + bdrv_drained_end(state->old_bs); + bdrv_unref(state->new_bs); + + aio_context_release(aio_context); } =20 typedef struct DriveBackupState { --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696996916373.1600616273246; Tue, 19 Dec 2017 07:23:16 -0800 (PST) Received: from localhost ([::1]:49327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJjS-0004Eu-Vs for importer@patchew.org; Tue, 19 Dec 2017 10:23:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZb-0004in-DX for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZX-0006v7-FZ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZX-0006tX-4f for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:47 -0500 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 21A97C047B6D; Tue, 19 Dec 2017 15:12:46 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA311619AF; Tue, 19 Dec 2017 15:12:45 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:30 +0000 Message-Id: <20171219151144.11120-10-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@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.31]); Tue, 19 Dec 2017 15:12:46 +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] [PULL v2 09/23] block: don't keep AioContext acquired after drive_backup_prepare() 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: Peter Maydell , Stefan Hajnoczi 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: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-4-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3b598f8f0e..5a56a1abf2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1845,7 +1845,6 @@ static void external_snapshot_clean(BlkActionState *c= ommon) typedef struct DriveBackupState { BlkActionState common; BlockDriverState *bs; - AioContext *aio_context; BlockJob *job; } DriveBackupState; =20 @@ -1857,6 +1856,7 @@ static void drive_backup_prepare(BlkActionState *comm= on, Error **errp) DriveBackupState *state =3D DO_UPCAST(DriveBackupState, common, common= ); BlockDriverState *bs; DriveBackup *backup; + AioContext *aio_context; Error *local_err =3D NULL; =20 assert(common->action->type =3D=3D TRANSACTION_ACTION_KIND_DRIVE_BACKU= P); @@ -1867,24 +1867,36 @@ static void drive_backup_prepare(BlkActionState *co= mmon, Error **errp) return; } =20 - /* AioContext is released in .clean() */ - state->aio_context =3D bdrv_get_aio_context(bs); - aio_context_acquire(state->aio_context); + aio_context =3D bdrv_get_aio_context(bs); + aio_context_acquire(aio_context); + + /* Paired with .clean() */ bdrv_drained_begin(bs); + state->bs =3D bs; =20 state->job =3D do_drive_backup(backup, common->block_job_txn, &local_e= rr); if (local_err) { error_propagate(errp, local_err); - return; + goto out; } + +out: + aio_context_release(aio_context); } =20 static void drive_backup_commit(BlkActionState *common) { DriveBackupState *state =3D DO_UPCAST(DriveBackupState, common, common= ); + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + assert(state->job); block_job_start(state->job); + + aio_context_release(aio_context); } =20 static void drive_backup_abort(BlkActionState *common) @@ -1892,18 +1904,32 @@ static void drive_backup_abort(BlkActionState *comm= on) DriveBackupState *state =3D DO_UPCAST(DriveBackupState, common, common= ); =20 if (state->job) { + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + block_job_cancel_sync(state->job); + + aio_context_release(aio_context); } } =20 static void drive_backup_clean(BlkActionState *common) { DriveBackupState *state =3D DO_UPCAST(DriveBackupState, common, common= ); + AioContext *aio_context; =20 - if (state->aio_context) { - bdrv_drained_end(state->bs); - aio_context_release(state->aio_context); + if (!state->bs) { + return; } + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + + bdrv_drained_end(state->bs); + + aio_context_release(aio_context); } =20 typedef struct BlockdevBackupState { --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513696628217848.5697290582297; Tue, 19 Dec 2017 07:17:08 -0800 (PST) Received: from localhost ([::1]:49276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJde-0007nh-3s for importer@patchew.org; Tue, 19 Dec 2017 10:17:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZd-0004kw-O2 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZZ-0006vo-6O for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZY-0006vP-TK for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:49 -0500 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 00E4F267D8; Tue, 19 Dec 2017 15:12:48 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 845A2619AF; Tue, 19 Dec 2017 15:12:47 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:31 +0000 Message-Id: <20171219151144.11120-11-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@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.30]); Tue, 19 Dec 2017 15:12:48 +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] [PULL v2 10/23] block: don't keep AioContext acquired after blockdev_backup_prepare() 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: Peter Maydell , Stefan Hajnoczi 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: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-5-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5a56a1abf2..d7ad76416e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1936,7 +1936,6 @@ typedef struct BlockdevBackupState { BlkActionState common; BlockDriverState *bs; BlockJob *job; - AioContext *aio_context; } BlockdevBackupState; =20 static BlockJob *do_blockdev_backup(BlockdevBackup *backup, BlockJobTxn *t= xn, @@ -1947,6 +1946,7 @@ static void blockdev_backup_prepare(BlkActionState *c= ommon, Error **errp) BlockdevBackupState *state =3D DO_UPCAST(BlockdevBackupState, common, = common); BlockdevBackup *backup; BlockDriverState *bs, *target; + AioContext *aio_context; Error *local_err =3D NULL; =20 assert(common->action->type =3D=3D TRANSACTION_ACTION_KIND_BLOCKDEV_BA= CKUP); @@ -1962,29 +1962,39 @@ static void blockdev_backup_prepare(BlkActionState = *common, Error **errp) return; } =20 - /* AioContext is released in .clean() */ - state->aio_context =3D bdrv_get_aio_context(bs); - if (state->aio_context !=3D bdrv_get_aio_context(target)) { - state->aio_context =3D NULL; + aio_context =3D bdrv_get_aio_context(bs); + if (aio_context !=3D bdrv_get_aio_context(target)) { error_setg(errp, "Backup between two IO threads is not implemented= "); return; } - aio_context_acquire(state->aio_context); + aio_context_acquire(aio_context); state->bs =3D bs; + + /* Paired with .clean() */ bdrv_drained_begin(state->bs); =20 state->job =3D do_blockdev_backup(backup, common->block_job_txn, &loca= l_err); if (local_err) { error_propagate(errp, local_err); - return; + goto out; } + +out: + aio_context_release(aio_context); } =20 static void blockdev_backup_commit(BlkActionState *common) { BlockdevBackupState *state =3D DO_UPCAST(BlockdevBackupState, common, = common); + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + assert(state->job); block_job_start(state->job); + + aio_context_release(aio_context); } =20 static void blockdev_backup_abort(BlkActionState *common) @@ -1992,18 +2002,32 @@ static void blockdev_backup_abort(BlkActionState *c= ommon) BlockdevBackupState *state =3D DO_UPCAST(BlockdevBackupState, common, = common); =20 if (state->job) { + AioContext *aio_context; + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + block_job_cancel_sync(state->job); + + aio_context_release(aio_context); } } =20 static void blockdev_backup_clean(BlkActionState *common) { BlockdevBackupState *state =3D DO_UPCAST(BlockdevBackupState, common, = common); + AioContext *aio_context; =20 - if (state->aio_context) { - bdrv_drained_end(state->bs); - aio_context_release(state->aio_context); + if (!state->bs) { + return; } + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + + bdrv_drained_end(state->bs); + + aio_context_release(aio_context); } =20 typedef struct BlockDirtyBitmapState { --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696811926669.0170769795923; Tue, 19 Dec 2017 07:20:11 -0800 (PST) Received: from localhost ([::1]:49305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJga-0001lz-Fv for importer@patchew.org; Tue, 19 Dec 2017 10:20:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZe-0004mO-VO for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZd-0006xv-LQ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZd-0006xN-Cz for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:53 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 796AE49026; Tue, 19 Dec 2017 15:12:52 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55A4A18668; Tue, 19 Dec 2017 15:12:49 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:32 +0000 Message-Id: <20171219151144.11120-12-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:12:52 +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] [PULL v2 11/23] block: don't keep AioContext acquired after internal_snapshot_prepare() 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: Peter Maydell , Stefan Hajnoczi 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: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-6-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/blockdev.c b/blockdev.c index d7ad76416e..6332a249ea 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1454,7 +1454,6 @@ struct BlkActionState { typedef struct InternalSnapshotState { BlkActionState common; BlockDriverState *bs; - AioContext *aio_context; QEMUSnapshotInfo sn; bool created; } InternalSnapshotState; @@ -1485,6 +1484,7 @@ static void internal_snapshot_prepare(BlkActionState = *common, qemu_timeval tv; BlockdevSnapshotInternal *internal; InternalSnapshotState *state; + AioContext *aio_context; int ret1; =20 g_assert(common->action->type =3D=3D @@ -1506,32 +1506,33 @@ static void internal_snapshot_prepare(BlkActionStat= e *common, return; } =20 - /* AioContext is released in .clean() */ - state->aio_context =3D bdrv_get_aio_context(bs); - aio_context_acquire(state->aio_context); + aio_context =3D bdrv_get_aio_context(bs); + aio_context_acquire(aio_context); =20 state->bs =3D bs; + + /* Paired with .clean() */ bdrv_drained_begin(bs); =20 if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, errp)) { - return; + goto out; } =20 if (bdrv_is_read_only(bs)) { error_setg(errp, "Device '%s' is read only", device); - return; + goto out; } =20 if (!bdrv_can_snapshot(bs)) { error_setg(errp, "Block format '%s' used by device '%s' " "does not support internal snapshots", bs->drv->format_name, device); - return; + goto out; } =20 if (!strlen(name)) { error_setg(errp, "Name is empty"); - return; + goto out; } =20 /* check whether a snapshot with name exist */ @@ -1539,12 +1540,12 @@ static void internal_snapshot_prepare(BlkActionStat= e *common, &local_err); if (local_err) { error_propagate(errp, local_err); - return; + goto out; } else if (ret) { error_setg(errp, "Snapshot with name '%s' already exists on device '%s'", name, device); - return; + goto out; } =20 /* 3. take the snapshot */ @@ -1560,11 +1561,14 @@ static void internal_snapshot_prepare(BlkActionStat= e *common, error_setg_errno(errp, -ret1, "Failed to create snapshot '%s' on device '%s'", name, device); - return; + goto out; } =20 /* 4. succeed, mark a snapshot is created */ state->created =3D true; + +out: + aio_context_release(aio_context); } =20 static void internal_snapshot_abort(BlkActionState *common) @@ -1573,12 +1577,16 @@ static void internal_snapshot_abort(BlkActionState = *common) DO_UPCAST(InternalSnapshotState, common, comm= on); BlockDriverState *bs =3D state->bs; QEMUSnapshotInfo *sn =3D &state->sn; + AioContext *aio_context; Error *local_error =3D NULL; =20 if (!state->created) { return; } =20 + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + if (bdrv_snapshot_delete(bs, sn->id_str, sn->name, &local_error) < 0) { error_reportf_err(local_error, "Failed to delete snapshot with id '%s' and " @@ -1586,19 +1594,26 @@ static void internal_snapshot_abort(BlkActionState = *common) sn->id_str, sn->name, bdrv_get_device_name(bs)); } + + aio_context_release(aio_context); } =20 static void internal_snapshot_clean(BlkActionState *common) { InternalSnapshotState *state =3D DO_UPCAST(InternalSnapshotState, common, common); + AioContext *aio_context; =20 - if (state->aio_context) { - if (state->bs) { - bdrv_drained_end(state->bs); - } - aio_context_release(state->aio_context); + if (!state->bs) { + return; } + + aio_context =3D bdrv_get_aio_context(state->bs); + aio_context_acquire(aio_context); + + bdrv_drained_end(state->bs); + + aio_context_release(aio_context); } =20 /* external snapshot private data */ --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513696645669324.63570549413384; Tue, 19 Dec 2017 07:17:25 -0800 (PST) Received: from localhost ([::1]:49277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJds-0007wQ-Gq for importer@patchew.org; Tue, 19 Dec 2017 10:17:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZg-0004nw-Df for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZf-00070v-FT for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZf-0006zm-8v for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:55 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81AE849022; Tue, 19 Dec 2017 15:12:54 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16FF918667; Tue, 19 Dec 2017 15:12:53 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:33 +0000 Message-Id: <20171219151144.11120-13-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:12:54 +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] [PULL v2 12/23] block: drop unused BlockDirtyBitmapState->aio_context field 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: Peter Maydell , Stefan Hajnoczi 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" The dirty bitmap actions in qmp_transaction have not used AioContext since the dirty bitmap locking discipline was introduced in commit 2119882c7eb7e2c612b24fc0c8d86f5887d6f1c3 ("block: introduce dirty_bitmap_mutex"). Remove the unused field. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-7-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- blockdev.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/blockdev.c b/blockdev.c index 6332a249ea..e865ae4873 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2049,7 +2049,6 @@ typedef struct BlockDirtyBitmapState { BlkActionState common; BdrvDirtyBitmap *bitmap; BlockDriverState *bs; - AioContext *aio_context; HBitmap *backup; bool prepared; } BlockDirtyBitmapState; @@ -2128,7 +2127,6 @@ static void block_dirty_bitmap_clear_prepare(BlkActio= nState *common, } =20 bdrv_clear_dirty_bitmap(state->bitmap, &state->backup); - /* AioContext is released in .clean() */ } =20 static void block_dirty_bitmap_clear_abort(BlkActionState *common) @@ -2149,16 +2147,6 @@ static void block_dirty_bitmap_clear_commit(BlkActio= nState *common) hbitmap_free(state->backup); } =20 -static void block_dirty_bitmap_clear_clean(BlkActionState *common) -{ - BlockDirtyBitmapState *state =3D DO_UPCAST(BlockDirtyBitmapState, - common, common); - - if (state->aio_context) { - aio_context_release(state->aio_context); - } -} - static void abort_prepare(BlkActionState *common, Error **errp) { error_setg(errp, "Transaction aborted using Abort action"); @@ -2219,7 +2207,6 @@ static const BlkActionOps actions[] =3D { .prepare =3D block_dirty_bitmap_clear_prepare, .commit =3D block_dirty_bitmap_clear_commit, .abort =3D block_dirty_bitmap_clear_abort, - .clean =3D block_dirty_bitmap_clear_clean, } }; =20 --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697449881765.3170290603239; Tue, 19 Dec 2017 07:30:49 -0800 (PST) Received: from localhost ([::1]:49558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJqm-0002bZ-I7 for importer@patchew.org; Tue, 19 Dec 2017 10:30:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZj-0004rC-BF for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZh-00073z-V2 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48480) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZh-00073B-P4 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:12:57 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04B7FC049E39; Tue, 19 Dec 2017 15:12:57 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 869D260C20; Tue, 19 Dec 2017 15:12:56 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:34 +0000 Message-Id: <20171219151144.11120-14-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Dec 2017 15:12:57 +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] [PULL v2 13/23] iothread: add iothread_by_id() API 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: Peter Maydell , Stefan Hajnoczi 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" Encapsulate IOThread QOM object lookup so that callers don't need to know how and where IOThread objects live. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-8-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- include/sysemu/iothread.h | 1 + iothread.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index 110329b2b4..55de1715c7 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -42,6 +42,7 @@ typedef struct { OBJECT_CHECK(IOThread, obj, TYPE_IOTHREAD) =20 char *iothread_get_id(IOThread *iothread); +IOThread *iothread_by_id(const char *id); AioContext *iothread_get_aio_context(IOThread *iothread); void iothread_stop_all(void); GMainContext *iothread_get_g_main_context(IOThread *iothread); diff --git a/iothread.c b/iothread.c index 27a4288578..e7b93e02a3 100644 --- a/iothread.c +++ b/iothread.c @@ -380,3 +380,10 @@ void iothread_destroy(IOThread *iothread) { object_unparent(OBJECT(iothread)); } + +/* Lookup IOThread by its id. Only finds user-created objects, not intern= al + * iothread_create() objects. */ +IOThread *iothread_by_id(const char *id) +{ + return IOTHREAD(object_resolve_path_type(id, TYPE_IOTHREAD, NULL)); +} --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697167128970.4035783376617; Tue, 19 Dec 2017 07:26:07 -0800 (PST) Received: from localhost ([::1]:49347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJmJ-0006l2-Ss for importer@patchew.org; Tue, 19 Dec 2017 10:25:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZo-0004uL-0b for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZl-00077a-Nb for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZl-00076V-Ee for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:01 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E2073D957; Tue, 19 Dec 2017 15:13:00 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60C7B1964A; Tue, 19 Dec 2017 15:12:58 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:35 +0000 Message-Id: <20171219151144.11120-15-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 19 Dec 2017 15:13:00 +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] [PULL v2 14/23] blockdev: add x-blockdev-set-iothread testing command 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: Peter Maydell , Stefan Hajnoczi 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" Currently there is no easy way for iotests to ensure that a BDS is bound to a particular IOThread. Normally the virtio-blk device calls blk_set_aio_context() when dataplane is enabled during guest driver initialization. This never happens in iotests since -machine accel=3Dqtest means there is no guest activity (including device driver initialization). This patch adds a QMP command to explicitly assign IOThreads in test cases. See qapi/block-core.json for a description of the command. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-9-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 36 ++++++++++++++++++++++++++++++++++++ blockdev.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index dd763dcf87..741d6c4367 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3949,3 +3949,39 @@ 'data' : { 'parent': 'str', '*child': 'str', '*node': 'str' } } + +## +# @x-blockdev-set-iothread: +# +# Move @node and its children into the @iothread. If @iothread is null th= en +# move @node and its children into the main loop. +# +# The node must not be attached to a BlockBackend. +# +# @node-name: the name of the block driver node +# +# @iothread: the name of the IOThread object or null for the main loop +# +# Note: this command is experimental and intended for test cases that need +# control over IOThreads only. +# +# Since: 2.12 +# +# Example: +# +# 1. Move a node into an IOThread +# -> { "execute": "x-blockdev-set-iothread", +# "arguments": { "node-name": "disk1", +# "iothread": "iothread0" } } +# <- { "return": {} } +# +# 2. Move a node into the main loop +# -> { "execute": "x-blockdev-set-iothread", +# "arguments": { "node-name": "disk1", +# "iothread": null } } +# <- { "return": {} } +# +## +{ 'command': 'x-blockdev-set-iothread', + 'data' : { 'node-name': 'str', + 'iothread': 'StrOrNull' } } diff --git a/blockdev.c b/blockdev.c index e865ae4873..f75c01f664 100644 --- a/blockdev.c +++ b/blockdev.c @@ -45,6 +45,7 @@ #include "qapi/qmp/qerror.h" #include "qapi/qobject-output-visitor.h" #include "sysemu/sysemu.h" +#include "sysemu/iothread.h" #include "block/block_int.h" #include "qmp-commands.h" #include "block/trace.h" @@ -4129,6 +4130,46 @@ BlockJobInfoList *qmp_query_block_jobs(Error **errp) return head; } =20 +void qmp_x_blockdev_set_iothread(const char *node_name, StrOrNull *iothrea= d, + Error **errp) +{ + AioContext *old_context; + AioContext *new_context; + BlockDriverState *bs; + + bs =3D bdrv_find_node(node_name); + if (!bs) { + error_setg(errp, "Cannot find node %s", node_name); + return; + } + + /* If we want to allow more extreme test scenarios this guard could be + * removed. For now it protects against accidents. */ + if (bdrv_has_blk(bs)) { + error_setg(errp, "Node %s is in use", node_name); + return; + } + + if (iothread->type =3D=3D QTYPE_QSTRING) { + IOThread *obj =3D iothread_by_id(iothread->u.s); + if (!obj) { + error_setg(errp, "Cannot find iothread %s", iothread->u.s); + return; + } + + new_context =3D iothread_get_aio_context(obj); + } else { + new_context =3D qemu_get_aio_context(); + } + + old_context =3D bdrv_get_aio_context(bs); + aio_context_acquire(old_context); + + bdrv_set_aio_context(bs, new_context); + + aio_context_release(old_context); +} + QemuOptsList qemu_common_drive_opts =3D { .name =3D "drive", .head =3D QTAILQ_HEAD_INITIALIZER(qemu_common_drive_opts.head), --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696875415161.5472490474216; Tue, 19 Dec 2017 07:21:15 -0800 (PST) Received: from localhost ([::1]:49314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJhb-0002hX-Vq for importer@patchew.org; Tue, 19 Dec 2017 10:21:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJZs-0004wQ-A2 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZr-0007Bn-28 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZq-0007B4-PJ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:06 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 051C14E4C1; Tue, 19 Dec 2017 15:13:06 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 143E95C541; Tue, 19 Dec 2017 15:13:01 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:36 +0000 Message-Id: <20171219151144.11120-16-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 19 Dec 2017 15:13:06 +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] [PULL v2 15/23] qemu-iotests: add 202 external snapshots IOThread test 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: Peter Maydell , Stefan Hajnoczi 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" QMP 'transaction' blockdev-snapshot-sync with multiple disks in an IOThread is an untested code path. Several bugs have been found in connection with this command. This patch adds a test case to prevent future regressions. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake Message-id: 20171206144550.22295-10-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/202 | 95 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/202.out | 11 ++++++ tests/qemu-iotests/group | 1 + 3 files changed, 107 insertions(+) create mode 100755 tests/qemu-iotests/202 create mode 100644 tests/qemu-iotests/202.out diff --git a/tests/qemu-iotests/202 b/tests/qemu-iotests/202 new file mode 100755 index 0000000000..581ca34d79 --- /dev/null +++ b/tests/qemu-iotests/202 @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# +# Copyright (C) 2017 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Creator/Owner: Stefan Hajnoczi +# +# Check that QMP 'transaction' blockdev-snapshot-sync with multiple drives= on a +# single IOThread completes successfully. This particular command trigger= ed a +# hang due to recursive AioContext locking and BDRV_POLL_WHILE(). Protect +# against regressions. + +import iotests + +iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.verify_platform(['linux']) + +with iotests.FilePath('disk0.img') as disk0_img_path, \ + iotests.FilePath('disk1.img') as disk1_img_path, \ + iotests.FilePath('disk0-snap.img') as disk0_snap_img_path, \ + iotests.FilePath('disk1-snap.img') as disk1_snap_img_path, \ + iotests.VM() as vm: + + img_size =3D '10M' + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk0_img_path, = img_size) + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk1_img_path, = img_size) + + iotests.log('Launching VM...') + vm.launch() + + iotests.log('Adding IOThread...') + iotests.log(vm.qmp('object-add', + qom_type=3D'iothread', + id=3D'iothread0')) + + iotests.log('Adding blockdevs...') + iotests.log(vm.qmp('blockdev-add', + driver=3Diotests.imgfmt, + node_name=3D'disk0', + file=3D{ + 'driver': 'file', + 'filename': disk0_img_path, + })) + iotests.log(vm.qmp('blockdev-add', + driver=3Diotests.imgfmt, + node_name=3D'disk1', + file=3D{ + 'driver': 'file', + 'filename': disk1_img_path, + })) + + iotests.log('Setting iothread...') + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'disk0', + iothread=3D'iothread0')) + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'disk1', + iothread=3D'iothread0')) + + iotests.log('Creating external snapshots...') + iotests.log(vm.qmp( + 'transaction', + actions=3D[ + { + 'data': { + 'node-name': 'disk0', + 'snapshot-file': disk0_snap_img_path, + 'snapshot-node-name': 'disk0-snap', + 'mode': 'absolute-paths', + 'format': iotests.imgfmt, + }, + 'type': 'blockdev-snapshot-sync' + }, { + 'data': { + 'node-name': 'disk1', + 'snapshot-file': disk1_snap_img_path, + 'snapshot-node-name': 'disk1-snap', + 'mode': 'absolute-paths', + 'format': iotests.imgfmt + }, + 'type': 'blockdev-snapshot-sync' + } + ])) diff --git a/tests/qemu-iotests/202.out b/tests/qemu-iotests/202.out new file mode 100644 index 0000000000..d5ea374e17 --- /dev/null +++ b/tests/qemu-iotests/202.out @@ -0,0 +1,11 @@ +Launching VM... +Adding IOThread... +{u'return': {}} +Adding blockdevs... +{u'return': {}} +{u'return': {}} +Setting iothread... +{u'return': {}} +{u'return': {}} +Creating external snapshots... +{u'return': {}} diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 3e688678dd..d0ee1e2e55 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -197,3 +197,4 @@ 197 rw auto quick 198 rw auto 200 rw auto +202 rw auto quick --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697067906759.8831021502002; Tue, 19 Dec 2017 07:24:27 -0800 (PST) Received: from localhost ([::1]:49334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJkW-00058R-L4 for importer@patchew.org; Tue, 19 Dec 2017 10:24:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJa3-00056d-BJ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZv-0007Ez-FQ for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZv-0007EK-9C for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:11 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 815EB5D68B; Tue, 19 Dec 2017 15:13:10 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6384B62660; Tue, 19 Dec 2017 15:13:07 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:37 +0000 Message-Id: <20171219151144.11120-17-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 19 Dec 2017 15:13:10 +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] [PULL v2 16/23] virtio-blk: make queue size configurable 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: Peter Maydell , Stefan Hajnoczi 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" From: Mark Kanda Depending on the configuration, it can be beneficial to adjust the virtio-b= lk queue size to something other than the current default of 128. Add a new property to make the queue size configurable. Signed-off-by: Mark Kanda Reviewed-by: Karl Heubaum Reviewed-by: Martin K. Petersen Reviewed-by: Ameya More Message-id: 52e6d742811f10dbd16e996e86cf375b9577c187.1513005190.git.mark.ka= nda@oracle.com Signed-off-by: Stefan Hajnoczi --- include/hw/virtio/virtio-blk.h | 1 + hw/block/virtio-blk.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index d3c8a6fa8c..5117431d96 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -39,6 +39,7 @@ struct VirtIOBlkConf uint32_t config_wce; uint32_t request_merging; uint16_t num_queues; + uint16_t queue_size; }; =20 struct VirtIOBlockDataPlane; diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 41a4ccdede..66ab0b19c8 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -928,6 +928,13 @@ static void virtio_blk_device_realize(DeviceState *dev= , Error **errp) error_setg(errp, "num-queues property must be larger than 0"); return; } + if (!is_power_of_2(conf->queue_size) || + conf->queue_size > VIRTQUEUE_MAX_SIZE) { + error_setg(errp, "invalid queue-size property (%" PRIu16 "), " + "must be a power of 2 (max %d)", + conf->queue_size, VIRTQUEUE_MAX_SIZE); + return; + } =20 blkconf_serial(&conf->conf, &conf->serial); if (!blkconf_apply_backend_options(&conf->conf, @@ -950,7 +957,7 @@ static void virtio_blk_device_realize(DeviceState *dev,= Error **errp) s->sector_mask =3D (s->conf.conf.logical_block_size / BDRV_SECTOR_SIZE= ) - 1; =20 for (i =3D 0; i < conf->num_queues; i++) { - virtio_add_queue(vdev, 128, virtio_blk_handle_output); + virtio_add_queue(vdev, conf->queue_size, virtio_blk_handle_output); } virtio_blk_data_plane_create(vdev, conf, &s->dataplane, &err); if (err !=3D NULL) { @@ -1009,6 +1016,7 @@ 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_UINT16("queue-size", VirtIOBlock, conf.queue_size, 128), DEFINE_PROP_LINK("iothread", VirtIOBlock, conf.iothread, TYPE_IOTHREAD, IOThread *), DEFINE_PROP_END_OF_LIST(), --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513696822170554.412986116391; Tue, 19 Dec 2017 07:20:22 -0800 (PST) Received: from localhost ([::1]:49306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJgk-0001vY-Rt for importer@patchew.org; Tue, 19 Dec 2017 10:20:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJa5-00058a-O7 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJZz-0007Hf-QU for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42750) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJZz-0007H0-Jb for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:15 -0500 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 C882980C0E; Tue, 19 Dec 2017 15:13:14 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id DED8F60C80; Tue, 19 Dec 2017 15:13:11 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:38 +0000 Message-Id: <20171219151144.11120-18-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@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.26]); Tue, 19 Dec 2017 15:13:14 +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] [PULL v2 17/23] virtio-blk: reject configs with logical block size > physical block size 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: Peter Maydell , Stefan Hajnoczi 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" From: Mark Kanda virtio-blk logical block size should never be larger than physical block size because it doesn't make sense to have such configurations. QEMU doesn't have a way to effectively express this condition; the best it can do is report the physical block exponent as 0 - indicating the logical block size equals the physical block size. This is identical to commit 3da023b5827543ee4c022986ea2ad9d1274410b2 but applied to virtio-blk (instead of virtio-scsi). Signed-off-by: Mark Kanda Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Ameya More Reviewed-by: Martin K. Petersen Reviewed-by: Stefan Hajnoczi Message-id: 773169891f9f2deb4cb7c4ef2655580dbe24c1d1.1513005190.git.mark.ka= nda@oracle.com Signed-off-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 66ab0b19c8..b1532e4e91 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -949,6 +949,13 @@ static void virtio_blk_device_realize(DeviceState *dev= , Error **errp) =20 blkconf_blocksizes(&conf->conf); =20 + if (conf->conf.logical_block_size > + conf->conf.physical_block_size) { + error_setg(errp, + "logical_block_size > physical_block_size not supported= "); + return; + } + virtio_init(vdev, "virtio-blk", VIRTIO_ID_BLOCK, sizeof(struct virtio_blk_config)); =20 --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) 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 1513697342851892.0417318746154; Tue, 19 Dec 2017 07:29:02 -0800 (PST) Received: from localhost ([::1]:49395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJp3-0000vW-KK for importer@patchew.org; Tue, 19 Dec 2017 10:28:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJa7-000592-C7 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJa1-0007Iq-HS for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60912) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJa1-0007IC-Ai for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:17 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87753C0587CE; Tue, 19 Dec 2017 15:13:16 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B6D85EE11; Tue, 19 Dec 2017 15:13:15 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:39 +0000 Message-Id: <20171219151144.11120-19-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 19 Dec 2017 15:13:16 +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] [PULL v2 18/23] block: avoid recursive AioContext acquire in bdrv_inactivate_all() 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: Peter Maydell , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini BDRV_POLL_WHILE() does not support recursive AioContext locking. It only releases the AioContext lock once regardless of how many times the caller has acquired it. This results in a hang since the IOThread does not make progress while the AioContext is still locked. The following steps trigger the hang: $ qemu-system-x86_64 -M accel=3Dkvm -m 1G -cpu host \ -object iothread,id=3Diothread0 \ -device virtio-scsi-pci,iothread=3Diothread0 \ -drive if=3Dnone,id=3Ddrive0,file=3Dtest.img,format= =3Draw \ -device scsi-hd,drive=3Ddrive0 \ -drive if=3Dnone,id=3Ddrive1,file=3Dtest.img,format= =3Draw \ -device scsi-hd,drive=3Ddrive1 $ qemu-system-x86_64 ...same options... \ -incoming tcp::1234 (qemu) migrate tcp:127.0.0.1:1234 ...hang... Tested-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Message-id: 20171207201320.19284-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- block.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 9a1a0d1e73..1c37ce4554 100644 --- a/block.c +++ b/block.c @@ -4320,9 +4320,15 @@ int bdrv_inactivate_all(void) BdrvNextIterator it; int ret =3D 0; int pass; + GSList *aio_ctxs =3D NULL, *ctx; =20 for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { - aio_context_acquire(bdrv_get_aio_context(bs)); + AioContext *aio_context =3D bdrv_get_aio_context(bs); + + if (!g_slist_find(aio_ctxs, aio_context)) { + aio_ctxs =3D g_slist_prepend(aio_ctxs, aio_context); + aio_context_acquire(aio_context); + } } =20 /* We do two passes of inactivation. The first pass calls to drivers' @@ -4340,9 +4346,11 @@ int bdrv_inactivate_all(void) } =20 out: - for (bs =3D bdrv_first(&it); bs; bs =3D bdrv_next(&it)) { - aio_context_release(bdrv_get_aio_context(bs)); + for (ctx =3D aio_ctxs; ctx !=3D NULL; ctx =3D ctx->next) { + AioContext *aio_context =3D ctx->data; + aio_context_release(aio_context); } + g_slist_free(aio_ctxs); =20 return ret; } --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697226610658.7884988204604; Tue, 19 Dec 2017 07:27:06 -0800 (PST) Received: from localhost ([::1]:49353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJnH-0007fq-8q for importer@patchew.org; Tue, 19 Dec 2017 10:26:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJaD-0005EB-M0 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJa7-0007NV-P2 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJa7-0007MZ-IK for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:23 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C382E72D14; Tue, 19 Dec 2017 15:13:22 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DEE26DA8B; Tue, 19 Dec 2017 15:13:17 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:40 +0000 Message-Id: <20171219151144.11120-20-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Dec 2017 15:13:22 +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] [PULL v2 19/23] docs: mark nested AioContext locking as a legacy API 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: Peter Maydell , Stefan Hajnoczi 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" See the patch for why nested AioContext locking is no longer allowed. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- docs/devel/multiple-iothreads.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/devel/multiple-iothreads.txt b/docs/devel/multiple-iothre= ads.txt index e4d340bbb7..4f9012d154 100644 --- a/docs/devel/multiple-iothreads.txt +++ b/docs/devel/multiple-iothreads.txt @@ -1,4 +1,4 @@ -Copyright (c) 2014 Red Hat Inc. +Copyright (c) 2014-2017 Red Hat Inc. =20 This work is licensed under the terms of the GNU GPL, version 2 or later. = See the COPYING file in the top-level directory. @@ -92,8 +92,9 @@ aio_context_acquire()/aio_context_release() for mutual ex= clusion. Once the context is acquired no other thread can access it or run event loop iterat= ions in this AioContext. =20 -aio_context_acquire()/aio_context_release() calls may be nested. This -means you can call them if you're not sure whether #2 applies. +Legacy code sometimes nests aio_context_acquire()/aio_context_release() ca= lls. +Do not use nesting anymore, it is incompatible with the BDRV_POLL_WHILE() = macro +used in the block layer and can lead to hangs. =20 There is currently no lock ordering rule if a thread needs to acquire mult= iple AioContexts simultaneously. Therefore, it is only safe for code holding t= he --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 1513697635813119.60168817457168; Tue, 19 Dec 2017 07:33:55 -0800 (PST) Received: from localhost ([::1]:49824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJtv-00065Q-N8 for importer@patchew.org; Tue, 19 Dec 2017 10:33:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJaC-0005D2-BT for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJaB-0007Sr-8Q for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48928) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJaB-0007Qw-2T for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:27 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CCEDC01BCB4; Tue, 19 Dec 2017 15:13:26 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 634895EE11; Tue, 19 Dec 2017 15:13:24 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:41 +0000 Message-Id: <20171219151144.11120-21-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 19 Dec 2017 15:13:26 +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] [PULL v2 20/23] blockdev: add x-blockdev-set-iothread force boolean 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: Peter Maydell , Stefan Hajnoczi 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" When a node is already associated with a BlockBackend the x-blockdev-set-iothread command refuses to set the IOThread. This is to prevent accidentally changing the IOThread when the nodes are in use. When the nodes are created with -drive they automatically get a BlockBackend. In that case we know nothing is using them yet and it's safe to set the IOThread. Add a force boolean to override the check. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-4-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 6 +++++- blockdev.c | 11 ++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 741d6c4367..a8cdbc300b 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -3962,6 +3962,9 @@ # # @iothread: the name of the IOThread object or null for the main loop # +# @force: true if the node and its children should be moved when a BlockBa= ckend +# is already attached +# # Note: this command is experimental and intended for test cases that need # control over IOThreads only. # @@ -3984,4 +3987,5 @@ ## { 'command': 'x-blockdev-set-iothread', 'data' : { 'node-name': 'str', - 'iothread': 'StrOrNull' } } + 'iothread': 'StrOrNull', + '*force': 'bool' } } diff --git a/blockdev.c b/blockdev.c index f75c01f664..9c3a430cfb 100644 --- a/blockdev.c +++ b/blockdev.c @@ -4131,7 +4131,7 @@ BlockJobInfoList *qmp_query_block_jobs(Error **errp) } =20 void qmp_x_blockdev_set_iothread(const char *node_name, StrOrNull *iothrea= d, - Error **errp) + bool has_force, bool force, Error **errp) { AioContext *old_context; AioContext *new_context; @@ -4143,10 +4143,11 @@ void qmp_x_blockdev_set_iothread(const char *node_n= ame, StrOrNull *iothread, return; } =20 - /* If we want to allow more extreme test scenarios this guard could be - * removed. For now it protects against accidents. */ - if (bdrv_has_blk(bs)) { - error_setg(errp, "Node %s is in use", node_name); + /* Protects against accidents. */ + if (!(has_force && force) && bdrv_has_blk(bs)) { + error_setg(errp, "Node %s is associated with a BlockBackend and co= uld " + "be in use (use force=3Dtrue to override this che= ck)", + node_name); return; } =20 --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513697007098336.49062491657446; Tue, 19 Dec 2017 07:23:27 -0800 (PST) Received: from localhost ([::1]:49328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJjh-0004PO-VQ for importer@patchew.org; Tue, 19 Dec 2017 10:23:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJaI-0005Ht-55 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJaG-0007YR-3u for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJaF-0007XX-UE for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:32 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E6256A7C9; Tue, 19 Dec 2017 15:13:31 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B71719CB3; Tue, 19 Dec 2017 15:13:27 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:42 +0000 Message-Id: <20171219151144.11120-22-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Dec 2017 15:13:31 +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] [PULL v2 21/23] iotests: add VM.add_object() 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: Peter Maydell , Stefan Hajnoczi 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" The VM.add_object() method can be used to add IOThreads or memory backend objects. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-5-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/iotests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6f057904a9..44477e9295 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -197,6 +197,11 @@ class VM(qtest.QEMUQtestMachine): socket_scm_helper=3Dsocket_scm_helper) self._num_drives =3D 0 =20 + def add_object(self, opts): + self._args.append('-object') + self._args.append(opts) + return self + def add_device(self, opts): self._args.append('-device') self._args.append(opts) --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513697361449540.5262568326831; Tue, 19 Dec 2017 07:29:21 -0800 (PST) Received: from localhost ([::1]:49396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJpJ-00017L-B4 for importer@patchew.org; Tue, 19 Dec 2017 10:29:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJaN-0005NA-PU for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJaI-0007aF-Cw for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJaI-0007ZS-3j for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:34 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EAED78EC1; Tue, 19 Dec 2017 15:13:33 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9202319658; Tue, 19 Dec 2017 15:13:32 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:43 +0000 Message-Id: <20171219151144.11120-23-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 19 Dec 2017 15:13:33 +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] [PULL v2 22/23] iothread: fix iothread_stop() race condition 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: Peter Maydell , Stefan Hajnoczi 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" There is a small chance that iothread_stop() hangs as follows: Thread 3 (Thread 0x7f63eba5f700 (LWP 16105)): #0 0x00007f64012c09b6 in ppoll () at /lib64/libc.so.6 #1 0x000055959992eac9 in ppoll (__ss=3D0x0, __timeout=3D0x0, __nfds=3D, __fds=3D) at /usr/include/bits/poll2.h:77 #2 0x000055959992eac9 in qemu_poll_ns (fds=3D, nfds=3D, timeout=3D) at util/qemu-timer.c:322 #3 0x0000559599930711 in aio_poll (ctx=3D0x55959bdb83c0, blocking=3Dbloc= king@entry=3Dtrue) at util/aio-posix.c:629 #4 0x00005595996806fe in iothread_run (opaque=3D0x55959bd78400) at iothr= ead.c:59 #5 0x00007f640159f609 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f64012cce6f in clone () at /lib64/libc.so.6 Thread 1 (Thread 0x7f640b45b280 (LWP 16103)): #0 0x00007f64015a0b6d in pthread_join () at /lib64/libpthread.so.0 #1 0x00005595999332ef in qemu_thread_join (thread=3D) at = util/qemu-thread-posix.c:547 #2 0x00005595996808ae in iothread_stop (iothread=3D) at i= othread.c:91 #3 0x000055959968094d in iothread_stop_iter (object=3D, o= paque=3D) at iothread.c:102 #4 0x0000559599857d97 in do_object_child_foreach (obj=3Dobj@entry=3D0x55= 959bdb8100, fn=3Dfn@entry=3D0x559599680930 , opaque=3Do= paque@entry=3D0x0, recurse=3Drecurse@entry=3Dfalse) at qom/object.c:852 #5 0x0000559599859477 in object_child_foreach (obj=3Dobj@entry=3D0x55959= bdb8100, fn=3Dfn@entry=3D0x559599680930 , opaque=3Dopaq= ue@entry=3D0x0) at qom/object.c:867 #6 0x0000559599680a6e in iothread_stop_all () at iothread.c:341 #7 0x000055959955b1d5 in main (argc=3D, argv=3D, envp=3D) at vl.c:4913 The relevant code from iothread_run() is: while (!atomic_read(&iothread->stopping)) { aio_poll(iothread->ctx, true); and iothread_stop(): iothread->stopping =3D true; aio_notify(iothread->ctx); ... qemu_thread_join(&iothread->thread); The following scenario can occur: 1. IOThread: while (!atomic_read(&iothread->stopping)) -> stopping=3Dfalse 2. Main loop: iothread->stopping =3D true; aio_notify(iothread->ctx); 3. IOThread: aio_poll(iothread->ctx, true); -> hang The bug is explained by the AioContext->notify_me doc comments: "If this field is 0, everything (file descriptors, bottom halves, timers) will be re-evaluated before the next blocking poll(), thus the event_notifier_set call can be skipped." The problem is that "everything" does not include checking iothread->stopping. This means iothread_run() will block in aio_poll() if aio_notify() was called just before aio_poll(). This patch fixes the hang by replacing aio_notify() with aio_bh_schedule_oneshot(). This makes aio_poll() or g_main_loop_run() to return. Implementing this properly required a new bool running flag. The new flag prevents races that are tricky if we try to use iothread->stopping. Now iothread->stopping is purely for iothread_stop() and iothread->running is purely for the iothread_run() thread. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-6-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- include/sysemu/iothread.h | 3 ++- iothread.c | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index 55de1715c7..799614ffd2 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -29,7 +29,8 @@ typedef struct { GOnce once; QemuMutex init_done_lock; QemuCond init_done_cond; /* is thread initialization done? */ - bool stopping; + bool stopping; /* has iothread_stop() been called? */ + bool running; /* should iothread_run() continue? */ int thread_id; =20 /* AioContext poll parameters */ diff --git a/iothread.c b/iothread.c index e7b93e02a3..d8b6c1fb27 100644 --- a/iothread.c +++ b/iothread.c @@ -55,7 +55,7 @@ static void *iothread_run(void *opaque) qemu_cond_signal(&iothread->init_done_cond); qemu_mutex_unlock(&iothread->init_done_lock); =20 - while (!atomic_read(&iothread->stopping)) { + while (iothread->running) { aio_poll(iothread->ctx, true); =20 if (atomic_read(&iothread->worker_context)) { @@ -78,16 +78,25 @@ static void *iothread_run(void *opaque) return NULL; } =20 +/* Runs in iothread_run() thread */ +static void iothread_stop_bh(void *opaque) +{ + IOThread *iothread =3D opaque; + + iothread->running =3D false; /* stop iothread_run() */ + + if (iothread->main_loop) { + g_main_loop_quit(iothread->main_loop); + } +} + void iothread_stop(IOThread *iothread) { if (!iothread->ctx || iothread->stopping) { return; } iothread->stopping =3D true; - aio_notify(iothread->ctx); - if (atomic_read(&iothread->main_loop)) { - g_main_loop_quit(iothread->main_loop); - } + aio_bh_schedule_oneshot(iothread->ctx, iothread_stop_bh, iothread); qemu_thread_join(&iothread->thread); } =20 @@ -134,6 +143,7 @@ static void iothread_complete(UserCreatable *obj, Error= **errp) char *name, *thread_name; =20 iothread->stopping =3D false; + iothread->running =3D true; iothread->thread_id =3D -1; iothread->ctx =3D aio_context_new(&local_error); if (!iothread->ctx) { --=20 2.14.3 From nobody Mon Apr 29 03:37:09 2024 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.zohomail.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 151369717611684.71493624609388; Tue, 19 Dec 2017 07:26:16 -0800 (PST) Received: from localhost ([::1]:49348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJmV-0006w1-D7 for importer@patchew.org; Tue, 19 Dec 2017 10:26:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRJaM-0005Lc-3R for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRJaK-0007bf-N3 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eRJaK-0007az-Dy for qemu-devel@nongnu.org; Tue, 19 Dec 2017 10:13:36 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A22A58046E; Tue, 19 Dec 2017 15:13:35 +0000 (UTC) Received: from localhost (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D8C168B13; Tue, 19 Dec 2017 15:13:34 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 19 Dec 2017 15:11:44 +0000 Message-Id: <20171219151144.11120-24-stefanha@redhat.com> In-Reply-To: <20171219151144.11120-1-stefanha@redhat.com> References: <20171219151144.11120-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 19 Dec 2017 15:13:35 +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] [PULL v2 23/23] qemu-iotests: add 203 savevm with IOThreads test 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: Peter Maydell , Stefan Hajnoczi 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" This test case will prevent future regressions with savevm and IOThreads. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Message-id: 20171207201320.19284-7-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/203 | 59 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/203.out | 6 +++++ tests/qemu-iotests/group | 1 + 3 files changed, 66 insertions(+) create mode 100755 tests/qemu-iotests/203 create mode 100644 tests/qemu-iotests/203.out diff --git a/tests/qemu-iotests/203 b/tests/qemu-iotests/203 new file mode 100755 index 0000000000..2c811917d8 --- /dev/null +++ b/tests/qemu-iotests/203 @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# +# Copyright (C) 2017 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Creator/Owner: Stefan Hajnoczi +# +# Check that QMP 'migrate' with multiple drives on a single IOThread compl= etes +# successfully. This particular command triggered a hang in the source QE= MU +# process due to recursive AioContext locking in bdrv_invalidate_all() and +# BDRV_POLL_WHILE(). + +import iotests + +iotests.verify_image_format(supported_fmts=3D['qcow2']) +iotests.verify_platform(['linux']) + +with iotests.FilePath('disk0.img') as disk0_img_path, \ + iotests.FilePath('disk1.img') as disk1_img_path, \ + iotests.VM() as vm: + + img_size =3D '10M' + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk0_img_path, = img_size) + iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk1_img_path, = img_size) + + iotests.log('Launching VM...') + (vm.add_object('iothread,id=3Diothread0') + .add_drive(disk0_img_path, 'node-name=3Ddrive0-node', interface=3D'= none') + .add_drive(disk1_img_path, 'node-name=3Ddrive1-node', interface=3D'= none') + .launch()) + + iotests.log('Setting IOThreads...') + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive0-node', iothread=3D'iothread0', + force=3DTrue)) + iotests.log(vm.qmp('x-blockdev-set-iothread', + node_name=3D'drive1-node', iothread=3D'iothread0', + force=3DTrue)) + + iotests.log('Starting migration...') + iotests.log(vm.qmp('migrate', uri=3D'exec:cat >/dev/null')) + while True: + vm.get_qmp_event(wait=3D60.0) + result =3D vm.qmp('query-migrate') + status =3D result.get('return', {}).get('status', None) + if status =3D=3D 'completed': + break diff --git a/tests/qemu-iotests/203.out b/tests/qemu-iotests/203.out new file mode 100644 index 0000000000..3f1ff900e4 --- /dev/null +++ b/tests/qemu-iotests/203.out @@ -0,0 +1,6 @@ +Launching VM... +Setting IOThreads... +{u'return': {}} +{u'return': {}} +Starting migration... +{u'return': {}} diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index d0ee1e2e55..93d96fb22f 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -198,3 +198,4 @@ 198 rw auto 200 rw auto 202 rw auto quick +203 rw auto --=20 2.14.3