From nobody Tue Feb 10 13:36:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=yandex-team.ru ARC-Seal: i=1; a=rsa-sha256; t=1683731241; cv=none; d=zohomail.com; s=zohoarc; b=AUxPi5wXL3YPNkAfsqLBMYDJRHlbtbWmnzQGGlklJqLwrzvTXK6KoTvV7C+fv+2Vzy3IpWvWcAPaiibYT7PGJzOrofDX+bXTSRZJyx/2ryxlIQnaMYk+9kTGGzi2APZ+OEXOxezl3ekyrod3IqYU+mZeK0TvQMjCboH/FJ73jYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683731241; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=465Y2GCAk0u1xjDhcIluHJncr/ojQOcPTtUz0nyztJg=; b=SATwYRKsF+64QnfCewGtrtso6CfVqBEi7LUEPic+X4Q9lvIeVmFXBFEKhye6VYoP98N+qCZkrW5dGNfyMW9BvwpRwyDorh3NRiiBm9jFP/U6N6HrgUgY+unL5nnWDmP8qYbZJHwVEuFPbEww3dePhe6i7Hr0DWnkFxusxZKAtb4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683731241034408.84923176526877; Wed, 10 May 2023 08:07:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwlPB-0006on-7z; Wed, 10 May 2023 11:07:01 -0400 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 1pwlP5-0006nH-JN; Wed, 10 May 2023 11:06:55 -0400 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwlP0-0001TH-Bk; Wed, 10 May 2023 11:06:55 -0400 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:a884:0:640:947b:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTP id 35E67600FD; Wed, 10 May 2023 18:06:38 +0300 (MSK) Received: from vsementsov-nix.yandex-team.ru (unknown [2a02:6b8:b081:2::1:11]) by mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id P6XgPR0OpqM0-Dsht6kRv; Wed, 10 May 2023 18:06:37 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1683731197; bh=465Y2GCAk0u1xjDhcIluHJncr/ojQOcPTtUz0nyztJg=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=M/k6UngCz/I2OiIoIHUp29PkQuS3wmFCANqFXg3MJiXdci24Wvz0+0y0QQc3MKFii DedHvYzEmHq8YMNjQrcJXvxGW55m9Yrxv51OmbyEK3HYd/+yFe9YgoM+DJ5U4RUsL5 okLSu4hchib7/qIGRg253QKIjd66WzGIS4gzjgEo= Authentication-Results: mail-nwsmtp-smtp-corp-main-44.iva.yp-c.yandex.net; dkim=pass header.i=@yandex-team.ru From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com, vsementsov@yandex-team.ru, den@openvz.org, alexander.ivanov@virtuozzo.com Subject: [PATCH v9 2/6] blockdev: transactions: rename some things Date: Wed, 10 May 2023 18:06:20 +0300 Message-Id: <20230510150624.310640-3-vsementsov@yandex-team.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230510150624.310640-1-vsementsov@yandex-team.ru> References: <20230510150624.310640-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=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-ZohoMail-DKIM: pass (identity @yandex-team.ru) X-ZM-MESSAGEID: 1683731243975100001 Content-Type: text/plain; charset="utf-8" Look at qmp_transaction(): dev_list is not obvious name for list of actions. Let's look at qapi spec, this argument is "actions". Let's follow the common practice of using same argument names in qapi scheme and code. To be honest, rename props to properties for same reason. Next, we have to rename global map of actions, to not conflict with new name for function argument. Rename also dev_entry loop variable accordingly to new name of the list. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf --- blockdev.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/blockdev.c b/blockdev.c index 82e5b6905b..f72084d206 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2281,7 +2281,7 @@ static void abort_commit(void *opaque) g_assert_not_reached(); /* this action never succeeds */ } =20 -static const BlkActionOps actions[] =3D { +static const BlkActionOps actions_map[] =3D { [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT] =3D { .instance_size =3D sizeof(ExternalSnapshotState), .action =3D external_snapshot_action, @@ -2363,12 +2363,12 @@ static TransactionProperties *get_transaction_prope= rties( * * Always run under BQL. */ -void qmp_transaction(TransactionActionList *dev_list, - struct TransactionProperties *props, +void qmp_transaction(TransactionActionList *actions, + struct TransactionProperties *properties, Error **errp) { - TransactionActionList *dev_entry =3D dev_list; - bool has_props =3D !!props; + TransactionActionList *act =3D actions; + bool has_properties =3D !!properties; JobTxn *block_job_txn =3D NULL; Error *local_err =3D NULL; Transaction *tran =3D tran_new(); @@ -2378,8 +2378,8 @@ void qmp_transaction(TransactionActionList *dev_list, /* Does this transaction get canceled as a group on failure? * If not, we don't really need to make a JobTxn. */ - props =3D get_transaction_properties(props); - if (props->completion_mode !=3D ACTION_COMPLETION_MODE_INDIVIDUAL) { + properties =3D get_transaction_properties(properties); + if (properties->completion_mode !=3D ACTION_COMPLETION_MODE_INDIVIDUAL= ) { block_job_txn =3D job_txn_new(); } =20 @@ -2387,24 +2387,24 @@ void qmp_transaction(TransactionActionList *dev_lis= t, bdrv_drain_all(); =20 /* We don't do anything in this loop that commits us to the operations= */ - while (NULL !=3D dev_entry) { + while (NULL !=3D act) { TransactionAction *dev_info =3D NULL; const BlkActionOps *ops; BlkActionState *state; =20 - dev_info =3D dev_entry->value; - dev_entry =3D dev_entry->next; + dev_info =3D act->value; + act =3D act->next; =20 - assert(dev_info->type < ARRAY_SIZE(actions)); + assert(dev_info->type < ARRAY_SIZE(actions_map)); =20 - ops =3D &actions[dev_info->type]; + ops =3D &actions_map[dev_info->type]; assert(ops->instance_size > 0); =20 state =3D g_malloc0(ops->instance_size); state->ops =3D ops; state->action =3D dev_info; state->block_job_txn =3D block_job_txn; - state->txn_props =3D props; + state->txn_props =3D properties; =20 state->ops->action(state, tran, &local_err); if (local_err) { @@ -2422,8 +2422,8 @@ delete_and_fail: /* failure, and it is all-or-none; roll back all operations */ tran_abort(tran); exit: - if (!has_props) { - qapi_free_TransactionProperties(props); + if (!has_properties) { + qapi_free_TransactionProperties(properties); } job_txn_unref(block_job_txn); } --=20 2.34.1