From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuN54-0006f7-U8 for qemu-devel@nongnu.org; Mon, 18 May 2015 11:35:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuN53-0001nV-Ng for qemu-devel@nongnu.org; Mon, 18 May 2015 11:35:50 -0400 Date: Mon, 18 May 2015 16:35:39 +0100 From: Stefan Hajnoczi Message-ID: <20150518153539.GA27654@stefanha-thinkpad.redhat.com> References: <1431385466-4868-1-git-send-email-jsnow@redhat.com> <1431385466-4868-10-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <1431385466-4868-10-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 09/11] block: drive_backup transaction callback support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, famz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, vsementsov@parallels.com --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 11, 2015 at 07:04:24PM -0400, John Snow wrote: > +static void drive_backup_cb(BlkActionState *common) > +{ > + BlkActionCallbackData *cb_data = common->cb_data; > + BlockDriverState *bs = cb_data->opaque; > + DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common); > + > + assert(state->bs == bs); > + if (bs->job) { > + assert(state->job == bs->job); > + } What is the purpose of the if statement? Why is it not okay for a new job to have started? > + > + state->aio_context = bdrv_get_aio_context(bs); > + aio_context_acquire(state->aio_context); The bs->job access above should be protected by aio_context_acquire(). --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVWgbLAAoJEJykq7OBq3PI130IAIgAOpdc9iW4xjnvw/9WbP3d sDII8/HfX/BJQfYKniKz47yCKCg3qoqMRvdmEkriZWBEz0CtEjy3PHYp06LV7ENh b6OvS27VG6EfIzAVuw5q02wZE9esjfhyKre+Fyq/Yvhh5v5VJ0vBtOh6G8xu1FZP XPu2wFANwJBnQizUf3MwT4rh22kYhbmJhZRXkDiECJkVNNASf9J+Q/yxvMQIEEMx 1GUGQfaF++gqPtEaMpbYQNOKsPhlfmxVC8bm/rYSOJT4J6qvyNUSNh3MTQJb2ZbO +lRnEMJnbGmIc0MJ3Wtr5AM+Evuy9deCQfK3bpJN2i/otFt56a5Txwl5DdKOylo= =DRVR -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn--