From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
mreitz@redhat.com
Subject: [Qemu-devel] [PATCH 1/4] blockdev: update outdated qmp_transaction() comments
Date: Fri, 21 Nov 2014 10:48:57 +0000 [thread overview]
Message-ID: <1416566940-4430-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1416566940-4430-1-git-send-email-stefanha@redhat.com>
Originally the transaction QMP command was just for taking snapshots.
The command became more general when drive-backup and abort were added.
It is more accurate to say the command is about performing operations on
an atomic group than to say it is about snapshots.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
blockdev.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 57910b8..778509b 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1159,7 +1159,7 @@ SnapshotInfo *qmp_blockdev_snapshot_delete_internal_sync(const char *device,
return info;
}
-/* New and old BlockDriverState structs for group snapshots */
+/* New and old BlockDriverState structs for atomic group operations */
typedef struct BlkTransactionState BlkTransactionState;
@@ -1530,9 +1530,8 @@ static const BdrvActionOps actions[] = {
};
/*
- * 'Atomic' group snapshots. The snapshots are taken as a set, and if any fail
- * then we do not pivot any of the devices in the group, and abandon the
- * snapshots
+ * 'Atomic' group operations. The operations are performed as a set, and if
+ * any fail then we roll back all operations in the group.
*/
void qmp_transaction(TransactionActionList *dev_list, Error **errp)
{
@@ -1543,10 +1542,10 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp)
QSIMPLEQ_HEAD(snap_bdrv_states, BlkTransactionState) snap_bdrv_states;
QSIMPLEQ_INIT(&snap_bdrv_states);
- /* drain all i/o before any snapshots */
+ /* drain all i/o before any operations */
bdrv_drain_all();
- /* We don't do anything in this loop that commits us to the snapshot */
+ /* We don't do anything in this loop that commits us to the operations */
while (NULL != dev_entry) {
TransactionAction *dev_info = NULL;
const BdrvActionOps *ops;
@@ -1581,10 +1580,7 @@ void qmp_transaction(TransactionActionList *dev_list, Error **errp)
goto exit;
delete_and_fail:
- /*
- * failure, and it is all-or-none; abandon each new bs, and keep using
- * the original bs for all images
- */
+ /* failure, and it is all-or-none; roll back all operations */
QSIMPLEQ_FOREACH(state, &snap_bdrv_states, entry) {
if (state->ops->abort) {
state->ops->abort(state);
--
2.1.0
next prev parent reply other threads:[~2014-11-21 10:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 10:48 [Qemu-devel] [PATCH 0/4] blockdev: support dataplane in QMP 'transaction' command Stefan Hajnoczi
2014-11-21 10:48 ` Stefan Hajnoczi [this message]
2014-11-21 13:22 ` [Qemu-devel] [PATCH 1/4] blockdev: update outdated qmp_transaction() comments Max Reitz
2014-11-21 13:30 ` Max Reitz
2014-11-21 10:48 ` [Qemu-devel] [PATCH 2/4] blockdev: drop unnecessary DriveBackupState field assignment Stefan Hajnoczi
2014-11-21 13:25 ` Max Reitz
2014-11-21 10:48 ` [Qemu-devel] [PATCH 3/4] blockdev: acquire AioContext in QMP 'transaction' actions Stefan Hajnoczi
2014-11-21 13:51 ` Max Reitz
2014-11-24 13:57 ` Stefan Hajnoczi
2014-11-21 10:49 ` [Qemu-devel] [PATCH 4/4] blockdev: check for BLOCK_OP_TYPE_EXTERNAL_SNAPSHOT Stefan Hajnoczi
2014-11-21 11:58 ` Paolo Bonzini
2014-11-24 13:58 ` Stefan Hajnoczi
2014-11-24 16:13 ` Max Reitz
2014-11-26 16:41 ` [Qemu-devel] [PATCH 0/4] blockdev: support dataplane in QMP 'transaction' command Stefan Hajnoczi
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=1416566940-4430-2-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).