From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyecA-0000Xz-Go for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xyec3-00085u-G6 for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xyec3-00085i-7q for qemu-devel@nongnu.org; Wed, 10 Dec 2014 05:35:19 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBAAZIXo013552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 10 Dec 2014 05:35:18 -0500 From: Kevin Wolf Date: Wed, 10 Dec 2014 11:34:04 +0100 Message-Id: <1418207679-32260-39-git-send-email-kwolf@redhat.com> In-Reply-To: <1418207679-32260-1-git-send-email-kwolf@redhat.com> References: <1418207679-32260-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 38/73] blockdev: update outdated qmp_transaction() comments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com From: Stefan Hajnoczi 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 Reviewed-by: Max Reitz Message-id: 1416566940-4430-2-git-send-email-stefanha@redhat.com Signed-off-by: Kevin Wolf --- blockdev.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/blockdev.c b/blockdev.c index a52f205..490f698 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1173,7 +1173,7 @@ out_aio_context: return NULL; } -/* New and old BlockDriverState structs for group snapshots */ +/* New and old BlockDriverState structs for atomic group operations */ typedef struct BlkTransactionState BlkTransactionState; @@ -1544,9 +1544,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) { @@ -1557,10 +1556,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; @@ -1595,10 +1594,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); -- 1.8.3.1