From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zctia-0003FI-KC for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:20:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZctiU-0000d5-6J for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:20:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZctiT-0000c5-LN for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:20:34 -0400 References: <1442297513-7001-1-git-send-email-famz@redhat.com> <1442297513-7001-11-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <55FBF37B.8010201@redhat.com> Date: Fri, 18 Sep 2015 13:20:27 +0200 MIME-Version: 1.0 In-Reply-To: <1442297513-7001-11-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QgLBhbtlIlrFeCQSVS6RmuNbVC2XtHn4D" Subject: Re: [Qemu-devel] [PATCH v6 10/14] blockdev: make BlockJobTxn available to qmp 'transaction' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , vsementsov@parallels.com, stefanha@redhat.com, John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QgLBhbtlIlrFeCQSVS6RmuNbVC2XtHn4D Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 15.09.2015 08:11, Fam Zheng wrote: > From: Stefan Hajnoczi >=20 > Provide a BlockJobTxn to actions executed in a qmp 'transaction' > command. This allows actions to make their block jobs either complete > as a group or fail/cancel together. >=20 > The next patch adds the first user. >=20 > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Fam Zheng > Reviewed-by: John Snow I'm still wondering which covert channel you are using to get these R-bs from John. Until I know I myself will have to resort to this open channel here: Reviewed-by: Max Reitz > Signed-off-by: Fam Zheng > --- > blockdev.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/blockdev.c b/blockdev.c > index 4ebded8..93a9eef 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -1285,6 +1285,7 @@ typedef struct BlkActionOps { > struct BlkActionState { > TransactionAction *action; > const BlkActionOps *ops; > + BlockJobTxn *block_job_txn; > QSIMPLEQ_ENTRY(BlkActionState) entry; > }; > =20 > @@ -1889,12 +1890,15 @@ static const BlkActionOps actions[] =3D { > void qmp_transaction(TransactionActionList *dev_list, Error **errp) > { > TransactionActionList *dev_entry =3D dev_list; > + BlockJobTxn *block_job_txn; > BlkActionState *state, *next; > Error *local_err =3D NULL; > =20 > QSIMPLEQ_HEAD(snap_bdrv_states, BlkActionState) snap_bdrv_states; > QSIMPLEQ_INIT(&snap_bdrv_states); > =20 > + block_job_txn =3D block_job_txn_new(); > + > /* drain all i/o before any operations */ > bdrv_drain_all(); > =20 > @@ -1914,6 +1918,7 @@ void qmp_transaction(TransactionActionList *dev_l= ist, Error **errp) > state =3D g_malloc0(ops->instance_size); > state->ops =3D ops; > state->action =3D dev_info; > + state->block_job_txn =3D block_job_txn; > QSIMPLEQ_INSERT_TAIL(&snap_bdrv_states, state, entry); > =20 > state->ops->prepare(state, &local_err); > @@ -1946,6 +1951,7 @@ exit: > } > g_free(state); > } > + block_job_txn_unref(block_job_txn); > } > =20 > =20 >=20 --QgLBhbtlIlrFeCQSVS6RmuNbVC2XtHn4D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV+/N7AAoJEDuxQgLoOKytvQkH/2g71uGz99FJJ5/0Tzb+QGPc BZOsFYmO/nNMJMdtCHRZro2E4yu3BWaFHu0HLeSFRobkw8sl273wGe73xTrZMhoE Ef16ANn0IAghVKrBPy1gPP3X2v2WZ74sRz18zPlCNwkWPGiYvF3vEnMuxdUyESbw toakFtktH5dy+uK9snP+0p+3aQxomOflrcqrNe0ufdaHly42KIz8OAvncX6hFQvQ VYwgZhYYMo6GDVxgaFy3QFqiGZtK/ka0h83bihY6o5/1fRL/e6I8mqHGP8DEK5I9 54ZYRZVjBQqSGFIPvmH1H8k6e4qxhJJkPEzCEaImYo1WAs1ueng9dYf4fae+QSo= =nP0m -----END PGP SIGNATURE----- --QgLBhbtlIlrFeCQSVS6RmuNbVC2XtHn4D--