From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJLno-00017y-7M for qemu-devel@nongnu.org; Sat, 02 Jul 2016 10:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJLnm-000332-5m for qemu-devel@nongnu.org; Sat, 02 Jul 2016 10:21:47 -0400 References: <9cb85b871a8d6b9e2b5f644730931445ef22994e.1467386530.git.berto@igalia.com> From: Max Reitz Message-ID: <1e7dee46-2a3f-9cdf-9ddf-39cd15c17a53@redhat.com> Date: Sat, 2 Jul 2016 16:21:33 +0200 MIME-Version: 1.0 In-Reply-To: <9cb85b871a8d6b9e2b5f644730931445ef22994e.1467386530.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ih4DDWDG31S8o26V9aDG3ssJeRx1NVX5s" Subject: Re: [Qemu-devel] [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ih4DDWDG31S8o26V9aDG3ssJeRx1NVX5s From: Max Reitz To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody , John Snow Message-ID: <1e7dee46-2a3f-9cdf-9ddf-39cd15c17a53@redhat.com> Subject: Re: [PATCH v3 10/11] qemu-img: Set the ID of the block job in img_commit() References: <9cb85b871a8d6b9e2b5f644730931445ef22994e.1467386530.git.berto@igalia.com> In-Reply-To: <9cb85b871a8d6b9e2b5f644730931445ef22994e.1467386530.git.berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 01.07.2016 17:52, Alberto Garcia wrote: > img_commit() creates a block job without an ID. This is no longer > allowed now that we require it to be unique and well-formed. We were > solving this by having a fallback in block_job_create(), but now that > we extended the API of commit_active_start() we can finally set an > explicit ID and revert that change. >=20 > Signed-off-by: Alberto Garcia > --- > blockjob.c | 6 ------ > qemu-img.c | 2 +- > 2 files changed, 1 insertion(+), 7 deletions(-) >=20 > diff --git a/blockjob.c b/blockjob.c > index 511c0db..3b9cec7 100644 > --- a/blockjob.c > +++ b/blockjob.c > @@ -132,12 +132,6 @@ void *block_job_create(const char *job_id, const B= lockJobDriver *driver, > =20 > if (job_id =3D=3D NULL) { > job_id =3D bdrv_get_device_name(bs); > - /* Assign a default ID if the BDS does not have a device > - * name. We'll get rid of this soon when we finish extending > - * the API of all commands that create block jobs. */ > - if (job_id[0] =3D=3D '\0') { > - job_id =3D "default_job"; > - } I think keeping an assertion here makes sense, though. In any case: Reviewed-by: Max Reitz > } > =20 > if (!id_wellformed(job_id)) { > diff --git a/qemu-img.c b/qemu-img.c > index a78f598..521724c 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -921,7 +921,7 @@ static int img_commit(int argc, char **argv) > .bs =3D bs, > }; > =20 > - commit_active_start(NULL, bs, base_bs, 0, BLOCKDEV_ON_ERROR_REPORT= , > + commit_active_start("commit", bs, base_bs, 0, BLOCKDEV_ON_ERROR_RE= PORT, > common_block_job_cb, &cbi, &local_err); > if (local_err) { > goto done; >=20 --Ih4DDWDG31S8o26V9aDG3ssJeRx1NVX5s 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 iQEvBAEBCAAZBQJXd83tEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrWlY CACmBY8N/PT1n7vZe5QDPW4Otm4RFVSgvIp9bXwKeeXXAGd6ch/eTuuiKE/NNC+5 N9l1I3VXJSGpOQhlC0hXWU37/7Iv7gyEV9kFQ24r7vtpDbuJU/SJe54HLBf9kF0j CJ7bstSqxo+eiRY6IIzuMd3SGgxTeVPyKmbIsNzF0BYYaozK/f1wUReALxO6hBfY b9TI3QnGuM2Jt+C6I8Gcem2QuQwcWgfm9zMcWxAm6TM9hCWmcSEnqONTmBxDXuP1 IFtcIVU+npUvNNHTcTDgdUOUK8Dt9aSCLNxtiI5FpT4Qfltj/5deVsF9oBirotl3 +laugdLAsYQ2Yo3W+/iOkti4 =6XoS -----END PGP SIGNATURE----- --Ih4DDWDG31S8o26V9aDG3ssJeRx1NVX5s--