blockdev: qmp_transaction: refactor loop to classic for

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>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2023-05-10 18:06:21 +03:00 committed by Kevin Wolf
parent 240396965f
commit 30c96b5559

View File

@ -2377,7 +2377,7 @@ void qmp_transaction(TransactionActionList *actions,
struct TransactionProperties *properties, struct TransactionProperties *properties,
Error **errp) Error **errp)
{ {
TransactionActionList *act = actions; TransactionActionList *act;
bool has_properties = !!properties; bool has_properties = !!properties;
JobTxn *block_job_txn = NULL; JobTxn *block_job_txn = NULL;
Error *local_err = NULL; Error *local_err = NULL;
@ -2397,14 +2397,11 @@ void qmp_transaction(TransactionActionList *actions,
bdrv_drain_all(); bdrv_drain_all();
/* We don't do anything in this loop that commits us to the operations */ /* We don't do anything in this loop that commits us to the operations */
while (NULL != act) { for (act = actions; act; act = act->next) {
TransactionAction *dev_info = NULL; TransactionAction *dev_info = act->value;
const BlkActionOps *ops; const BlkActionOps *ops;
BlkActionState *state; BlkActionState *state;
dev_info = act->value;
act = act->next;
assert(dev_info->type < ARRAY_SIZE(actions_map)); assert(dev_info->type < ARRAY_SIZE(actions_map));
ops = &actions_map[dev_info->type]; ops = &actions_map[dev_info->type];