From nobody Wed Feb 11 00:59:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=yandex-team.ru Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676994695170349.84232280419815; Tue, 21 Feb 2023 07:51:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUUqt-0006TP-Pf; Tue, 21 Feb 2023 10:46:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUqp-0006PD-Sm; Tue, 21 Feb 2023 10:46:43 -0500 Received: from forwardcorp1c.mail.yandex.net ([178.154.239.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUUqm-0003S2-VQ; Tue, 21 Feb 2023 10:46:43 -0500 Received: from mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net (mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:8923:0:640:c717:0]) by forwardcorp1c.mail.yandex.net (Yandex) with ESMTP id 51DAE5FBC2; Tue, 21 Feb 2023 18:46:31 +0300 (MSK) Received: from vsementsov-win.yandex-team.ru (unknown [2a02:6b8:b081:b584::1:19]) by mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id IksB910KfuQ0-X2NP5hRh; Tue, 21 Feb 2023 18:46:30 +0300 X-Yandex-Fwd: 1 Authentication-Results: mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net; dkim=pass From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, hreitz@redhat.com, kwolf@redhat.com, alexander.ivanov@virtuozzo.com, den@openvz.org, Vladimir Sementsov-Ogievskiy , Vladimir Sementsov-Ogievskiy Subject: [PATCH v6 3/5] blockdev: qmp_transaction: refactor loop to classic for Date: Tue, 21 Feb 2023 18:46:15 +0300 Message-Id: <20230221154617.745341-4-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230221154617.745341-1-vsementsov@yandex-team.ru> References: <20230221154617.745341-1-vsementsov@yandex-team.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.200; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1c.mail.yandex.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1676994696613100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 2174ab2694..89c573a094 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2375,7 +2375,7 @@ void qmp_transaction(TransactionActionList *actions, struct TransactionProperties *properties, Error **errp) { - TransactionActionList *act =3D actions; + TransactionActionList *act; bool has_properties =3D !!properties; JobTxn *block_job_txn =3D NULL; Error *local_err =3D NULL; @@ -2395,14 +2395,11 @@ void qmp_transaction(TransactionActionList *actions, bdrv_drain_all(); =20 /* We don't do anything in this loop that commits us to the operations= */ - while (NULL !=3D act) { - TransactionAction *dev_info =3D NULL; + for (act =3D actions; act; act =3D act->next) { + TransactionAction *dev_info =3D act->value; const BlkActionOps *ops; BlkActionState *state; =20 - dev_info =3D act->value; - act =3D act->next; - assert(dev_info->type < ARRAY_SIZE(actions_map)); =20 ops =3D &actions_map[dev_info->type]; --=20 2.34.1