From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, hreitz@redhat.com,
den@openvz.org, alexander.ivanov@virtuozzo.com
Subject: Re: [PATCH v8 4/5] blockdev: transaction: refactor handling transaction properties
Date: Wed, 10 May 2023 13:21:19 +0200 [thread overview]
Message-ID: <ZFt+LwvfBi15tVZ9@redhat.com> (raw)
In-Reply-To: <20230421115327.907104-5-vsementsov@yandex-team.ru>
Am 21.04.2023 um 13:53 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Only backup supports GROUPED mode. Make this logic more clear. And
> avoid passing extra thing to each action.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
> blockdev.c | 92 +++++++++++-------------------------------------------
> 1 file changed, 19 insertions(+), 73 deletions(-)
> @@ -2376,18 +2310,34 @@ void qmp_transaction(TransactionActionList *actions,
> Error **errp)
> {
> TransactionActionList *act;
> - bool has_properties = !!properties;
> JobTxn *block_job_txn = NULL;
> Error *local_err = NULL;
> Transaction *tran = tran_new();
> + ActionCompletionMode comp_mode =
> + properties ? properties->completion_mode :
> + ACTION_COMPLETION_MODE_INDIVIDUAL;
>
> GLOBAL_STATE_CODE();
>
> /* Does this transaction get canceled as a group on failure?
> * If not, we don't really need to make a JobTxn.
> */
> - properties = get_transaction_properties(properties);
> - if (properties->completion_mode != ACTION_COMPLETION_MODE_INDIVIDUAL) {
> + if (comp_mode != ACTION_COMPLETION_MODE_INDIVIDUAL) {
> + for (act = actions; act; act = act->next) {
> + TransactionActionKind type = act->value->type;
> +
> + if (type != TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP &&
> + type != TRANSACTION_ACTION_KIND_DRIVE_BACKUP)
> + {
> + error_setg(errp,
> + "Action '%s' does not support Transaction property "
Should this be lower case "transaction"?
> + "completion-mode = %s",
> + TransactionActionKind_str(type),
> + ActionCompletionMode_str(comp_mode));
> + return;
This leaks tran.
> + }
> + }
> +
> block_job_txn = job_txn_new();
> }
Kevin
next prev parent reply other threads:[~2023-05-10 11:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-21 11:53 [PATCH v8 0/5] block: refactor blockdev transactions Vladimir Sementsov-Ogievskiy
2023-04-21 11:53 ` [PATCH v8 1/5] blockdev: refactor transaction to use Transaction API Vladimir Sementsov-Ogievskiy
2023-05-10 11:10 ` Kevin Wolf
2023-04-21 11:53 ` [PATCH v8 2/5] blockdev: transactions: rename some things Vladimir Sementsov-Ogievskiy
2023-05-10 11:16 ` Kevin Wolf
2023-04-21 11:53 ` [PATCH v8 3/5] blockdev: qmp_transaction: refactor loop to classic for Vladimir Sementsov-Ogievskiy
2023-05-10 11:17 ` Kevin Wolf
2023-04-21 11:53 ` [PATCH v8 4/5] blockdev: transaction: refactor handling transaction properties Vladimir Sementsov-Ogievskiy
2023-05-10 11:21 ` Kevin Wolf [this message]
2023-04-21 11:53 ` [PATCH v8 5/5] blockdev: qmp_transaction: drop extra generic layer Vladimir Sementsov-Ogievskiy
2023-05-10 11:47 ` Kevin Wolf
2023-05-10 13:37 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZFt+LwvfBi15tVZ9@redhat.com \
--to=kwolf@redhat.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=den@openvz.org \
--cc=hreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.