From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF20A-00088t-UZ for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:24:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF209-0004Aa-Rn for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:24:42 -0400 References: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> From: Max Reitz Message-ID: <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> Date: Mon, 20 Jun 2016 18:24:30 +0200 MIME-Version: 1.0 In-Reply-To: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IbAStj3p3NiGfvDE9ta2pNJ9GVb6WaLsH" 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: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IbAStj3p3NiGfvDE9ta2pNJ9GVb6WaLsH From: Max Reitz To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody Message-ID: <6977c422-0899-baee-0282-41e32fa7782c@redhat.com> Subject: Re: [PATCH 03/15] blockjob: Add block_job_get() References: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> In-Reply-To: <3d3617592f14762be20abff8d4a3937e79b133dc.1465459496.git.berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable 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(). >=20 > 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. >=20 > Signed-off-by: Alberto Garcia > --- > blockjob.c | 13 +++++++++++++ > include/block/blockjob.h | 10 ++++++++++ > 2 files changed, 23 insertions(+) Reviewed-by: Max Reitz Just to throw out a suggestion, I'm not sure how useful it will be after the rest of the series: 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 devi= ce. Just a suggestion, though, I don't think it will be necessary. Legacy applications will always create jobs with auto-generated IDs that cannot 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. Max --IbAStj3p3NiGfvDE9ta2pNJ9GVb6WaLsH 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 iQEcBAEBCAAGBQJXaBi+AAoJEDuxQgLoOKytcsgH/AjeAJARE/a69Eun2YYtzxMT S8SluWG5xHkqthBSsYKbvTUyayg7sLeoktJc3Ps1HuhWKai+ujB0xYxFsXZ7frxA uAxlgxgY+yn/WF+dazhnKfNgT9+O90GW+HGCyOlKwn8M2a8m95+tttvtWygmrbG+ qfAmsKmbQKMOWCSBahaTbVdhKGE0L6q6zX/sDlLp7iSzYA7g4qGki0QfIvMjUcNQ 4MWtwDWUs9zgvK78S7f/a8MGdA2wECw3E2gPnBHmq9YYvO9Qszxwgofg0LjA5RQp /2xNl6FP3zdpU8TUXaF4GNRE5M0UwOtPYlCAvC2j7uG7nv4+05p0nBLCcRB3VTA= =00v/ -----END PGP SIGNATURE----- --IbAStj3p3NiGfvDE9ta2pNJ9GVb6WaLsH--