[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/18] blockdev: qmp_transaction: refactor loop to classic for
From: |
Kevin Wolf |
Subject: |
[PULL 03/18] blockdev: qmp_transaction: refactor loop to classic for |
Date: |
Wed, 17 May 2023 18:51:01 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230510150624.310640-4-vsementsov@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
blockdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 75e313f403..dd0e98bbe1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2377,7 +2377,7 @@ void qmp_transaction(TransactionActionList *actions,
struct TransactionProperties *properties,
Error **errp)
{
- TransactionActionList *act = actions;
+ TransactionActionList *act;
bool has_properties = !!properties;
JobTxn *block_job_txn = NULL;
Error *local_err = NULL;
@@ -2397,14 +2397,11 @@ void qmp_transaction(TransactionActionList *actions,
bdrv_drain_all();
/* We don't do anything in this loop that commits us to the operations */
- while (NULL != act) {
- TransactionAction *dev_info = NULL;
+ for (act = actions; act; act = act->next) {
+ TransactionAction *dev_info = act->value;
const BlkActionOps *ops;
BlkActionState *state;
- dev_info = act->value;
- act = act->next;
-
assert(dev_info->type < ARRAY_SIZE(actions_map));
ops = &actions_map[dev_info->type];
--
2.40.1
- [PULL 00/18] Block layer patches, Kevin Wolf, 2023/05/17
- [PULL 01/18] blockdev: refactor transaction to use Transaction API, Kevin Wolf, 2023/05/17
- [PULL 02/18] blockdev: transactions: rename some things, Kevin Wolf, 2023/05/17
- [PULL 03/18] blockdev: qmp_transaction: refactor loop to classic for,
Kevin Wolf <=
- [PULL 07/18] docs/interop/qcow2.txt: fix description about "zlib" clusters, Kevin Wolf, 2023/05/17
- [PULL 05/18] blockdev: use state.bitmap in block-dirty-bitmap-add action, Kevin Wolf, 2023/05/17
- [PULL 04/18] blockdev: transaction: refactor handling transaction properties, Kevin Wolf, 2023/05/17
- [PULL 06/18] blockdev: qmp_transaction: drop extra generic layer, Kevin Wolf, 2023/05/17
- [PULL 08/18] block: Call .bdrv_co_create(_opts) unlocked, Kevin Wolf, 2023/05/17
- [PULL 10/18] qcow2: Unlock the graph in qcow2_do_open() where necessary, Kevin Wolf, 2023/05/17
- [PULL 09/18] block/export: Fix null pointer dereference in error path, Kevin Wolf, 2023/05/17
- [PULL 12/18] test-bdrv-drain: Take graph lock more selectively, Kevin Wolf, 2023/05/17
- [PULL 11/18] qemu-img: Take graph lock more selectively, Kevin Wolf, 2023/05/17
- [PULL 14/18] blockjob: Adhere to rate limit even when reentered early, Kevin Wolf, 2023/05/17