Skip to content

Commit

Permalink
blockdev: qmp_transaction: refactor loop to classic for
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and kevmw committed May 19, 2023
1 parent 2403969 commit 30c96b5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
Expand Down

0 comments on commit 30c96b5

Please sign in to comment.