From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YROyc-0002ae-0k for qemu-devel@nongnu.org; Fri, 27 Feb 2015 12:45:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YROyZ-0005WR-2P for qemu-devel@nongnu.org; Fri, 27 Feb 2015 12:45:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YROyY-0005WF-QC for qemu-devel@nongnu.org; Fri, 27 Feb 2015 12:45:23 -0500 Message-ID: <54F0AD2E.3010904@redhat.com> Date: Fri, 27 Feb 2015 10:45:18 -0700 From: Eric Blake MIME-Version: 1.0 References: <1425057113-26940-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1425057113-26940-1-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gJAqHbmtJm4MQ0Swv9iIHKqeHfXdV2F27" Subject: Re: [Qemu-devel] [PATCH v2] virtio-scsi: Allocate op blocker reason before blocking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Paolo Bonzini , Fam Zheng , Markus Armbruster , Anthony Liguori , "Michael S. Tsirkin" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gJAqHbmtJm4MQ0Swv9iIHKqeHfXdV2F27 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/27/2015 10:11 AM, Max Reitz wrote: > s->blocker is really only used in hw/scsi/virtio-scsi.c; the only place= s > where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is > allocated and when it is freed. That does not make a whole lot of sense= > (and is actually wrong because this leads to s->blocker potentially > being NULL when blk_op_block_all() is called in virtio-scsi.c), so move= > the allocation and destruction of s->blocker to the device realization > and unrealization in virtio-scsi.c, respectively. >=20 >=20 > Signed-off-by: Max Reitz > --- > v2: > - Put the reproducer into the commit message [Markus] and modified its > wording to be more fitting of a commit message ("Case in point" > instead of the imperative "Try"). > - As noted by Fam on my bdrv_close_all() series, there can be multiple > block devices per virtio-scsi bus; therefore, it's wrong to delete th= e > blocker if one of these is unplugged. Instead, just allocate the > blocker with the virtio-scsi device itself and free it when the devic= e > is unrealized. > --- > hw/scsi/virtio-scsi-dataplane.c | 4 ---- > hw/scsi/virtio-scsi.c | 4 ++++ > 2 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gJAqHbmtJm4MQ0Swv9iIHKqeHfXdV2F27 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU8K0vAAoJEKeha0olJ0Nq3S0H/0OXENayBA/UxkZ//aMgV2Oa pJHxPT6nEZtgMQxSKpH0zGf2SChIf6w1rw4Qb35pxFv9sRZpH8bustlBM21o42Kb blZojOphad/BZAkYXFsKa7yKJi38LPom7rcyhNhTnIlU6hWxbS3eSywu0K0KOdK5 9oBD1Zg9SLl78+OBYue50xHZoJiHrH5OuwdC8pTVAcFuqjEyEv8HNB3mmM8r6n5o s41SMbCSIcbRP/P/DGwsMMQ9gGrWLr0hBeRh9Nxdp8j6wutXzGyKrh2hflMZ6SaQ N5a9PidbzaxWD5VxEl98nV03sNikW/LvWJLixXDKOcqzg/q05oaUcMrz2FMg/sA= =lzhg -----END PGP SIGNATURE----- --gJAqHbmtJm4MQ0Swv9iIHKqeHfXdV2F27--