From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF4FP-00073u-01 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 14:48:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF4FN-0001gC-QF for qemu-devel@nongnu.org; Mon, 20 Jun 2016 14:48:35 -0400 References: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> From: Eric Blake Message-ID: <57683A7A.7020103@redhat.com> Date: Mon, 20 Jun 2016 12:48:26 -0600 MIME-Version: 1.0 In-Reply-To: <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="n2XgWBOv2XjtIrgI8xHhGnCdsBwEv57hI" Subject: Re: [Qemu-devel] [PATCH 03/15] blockjob: Add block_job_get() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Jeff Cody This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --n2XgWBOv2XjtIrgI8xHhGnCdsBwEv57hI From: Eric Blake To: Max Reitz , Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Jeff Cody Message-ID: <57683A7A.7020103@redhat.com> Subject: Re: [PATCH 03/15] blockjob: Add block_job_get() References: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> In-Reply-To: <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/20/2016 10:24 AM, Max Reitz wrote: > On 09.06.2016 10:20, Alberto Garcia wrote: >> Currently the way to look for a specific block job is to iterate the >> list manually using block_job_next(). >> >> Since we want to be able to identify a job primarily by its ID it >> makes sense to have a function that does just that. >> >> Signed-off-by: Alberto Garcia >> --- >> blockjob.c | 13 +++++++++++++ >> include/block/blockjob.h | 10 ++++++++++ >> 2 files changed, 23 insertions(+) >=20 > Reviewed-by: Max Reitz >=20 > Just to throw out a suggestion, I'm not sure how useful it will be afte= r > the rest of the series: >=20 > Would it make sense to prevent name clashes between block job IDs and > device IDs (i.e. BlockBackend names)? If we did that, this function > could be used to identify a block job both based on its name and its de= vice. Adding the restriction now, and then relaxing it later, is easier than keeping it relaxed and wishing we could tighten it later. >=20 > Just a suggestion, though, I don't think it will be necessary. Legacy > applications will always create jobs with auto-generated IDs that canno= t > clash with BB names anyway. If we require applications that do name > their block jobs manually to always use this ID when specifying a block= > job, everything will be fine even if block job and BB names do clash. But I think you're right here - legacy users will be just fine (at most one job per device, never using the id but also never clashing an id with device names), and new users should just always assign a job id and use that rather than relying on device names. So I don't think we need the extra restriction of merging device and job id namespaces into one. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --n2XgWBOv2XjtIrgI8xHhGnCdsBwEv57hI 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXaDp6AAoJEKeha0olJ0NqfJsH/jr2NMdIb86Q7a4uzt2eXyPd tavJEgTWaWrnUogn+E9MFuSHvGSKvffTJAlV0mBGwMMPZDdyfp/h+wLT6oiIw15h VXTBv9fdOhDmgZ6UeK2gVcBCinQP0Wvf65xYKYb4Ze3a/tPyKJH4Fv9yp8qAvPNM /kH9IhLfDbKOFDTWl0yETJpz9ne8Xxz4+vR8OXDGUr3CCpWuPbkdU+CavhqXGAee SS8Sfr+6x+22lZRhi8k9KvfwijX1MgtuYo/MuGiRWfzFUukVZHYsM7b1ADDVOEmo POS7sF1lLwHJHo84uBOLtZ7FLBOKjSjShXPouwrwC3c6Bt6HKgN31bQBFji12Ac= =DNNx -----END PGP SIGNATURE----- --n2XgWBOv2XjtIrgI8xHhGnCdsBwEv57hI--