From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z86bY-0004g6-7d for qemu-devel@nongnu.org; Thu, 25 Jun 2015 08:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z86bV-0003au-0K for qemu-devel@nongnu.org; Thu, 25 Jun 2015 08:50:08 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:36124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z86bU-0003Yq-QK for qemu-devel@nongnu.org; Thu, 25 Jun 2015 08:50:04 -0400 Received: by wguu7 with SMTP id u7so61665725wgu.3 for ; Thu, 25 Jun 2015 05:50:04 -0700 (PDT) Date: Thu, 25 Jun 2015 13:50:01 +0100 From: Stefan Hajnoczi Message-ID: <20150625125001.GD4419@stefanha-thinkpad.redhat.com> References: <1434103761-29871-1-git-send-email-stefanha@redhat.com> <1434103761-29871-6-git-send-email-stefanha@redhat.com> <558AF8F7.7010803@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DiL7RhKs8rK9YGuF" Content-Disposition: inline In-Reply-To: <558AF8F7.7010803@redhat.com> Subject: Re: [Qemu-devel] [RFC 5/9] block: add block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , famz@redhat.com, Jeff Cody , qemu-devel@nongnu.org, vsementsov@parallels.com, Stefan Hajnoczi , John Snow --DiL7RhKs8rK9YGuF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 24, 2015 at 08:37:43PM +0200, Max Reitz wrote: > On 12.06.2015 12:09, Stefan Hajnoczi wrote: > >+void block_job_txn_add_job(BlockJobTxn *txn, BlockJob *job) > >+{ > >+ if (!txn) { > >+ return; > >+ } >=20 > Do you plan on making use of this case? I'm asking because while I'm usua= lly > in favor of handling everything gracefully as long as it's easy to > implement, here I can't think of a case where using NULL with this functi= on > makes sense, that is to me it would seem like the caller made some bad > mistake. This in turn would mean that dereferencing a NULL pointer or > failing an assertion were preferable to hiding that mistake. >=20 > Other than this small thing and that it doesn't compile (until patch 7, I > presume), looks good. Yes. It is used by backup_start(), which may be called with txn =3D=3D NULL by do_drive_backup() from qmp_drive_backup(). It means that blockjob code never needs to check whether it is running inside a transaction or not. Blockjob code always calls add_job() and prepare_to_complete() regardless. Stefan --DiL7RhKs8rK9YGuF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVi/j5AAoJEJykq7OBq3PIlNEH/0syjHHaLvkHWOiar6Th362c q1kxIxt2N4nLOzQF3giFcxs0jVpvLC6mYx2EvVyuhsi/xTSmJ5kT3Z9RuSTqpMKz 66jUXFoL9iRZ5v3uHQZcuzSnCUhsAV+3Gi4ptpToXE5ceKWkJxUsCUKRo/WDvkYJ 9ijr1oIr8ZQLig3+eMfRMyXHbybgQ24lLpplkfv+Hq7rIQ0GYkhDP2MSER66B4JW TeXA72x9SMpE3BSGvhvcMaZzweXmgH+T/xJp5o3jSHmA9JXjANx4P+hVewIowx8j Qh+tNaABH9FGTYke4lp3014mZ96yd2X/fDGzUdFFdoaujNcFI+Sd8C7XprXosxY= =LfLX -----END PGP SIGNATURE----- --DiL7RhKs8rK9YGuF--