From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuOTH-0005LM-H8 for qemu-devel@nongnu.org; Thu, 05 Nov 2015 12:37:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuOTG-0001Lr-Ae for qemu-devel@nongnu.org; Thu, 05 Nov 2015 12:37:11 -0500 References: <1446663467-22485-1-git-send-email-mreitz@redhat.com> <1446663467-22485-15-git-send-email-mreitz@redhat.com> <563B8EBA.8070506@redhat.com> From: Max Reitz Message-ID: <563B93BD.2080805@redhat.com> Date: Thu, 5 Nov 2015 18:37:01 +0100 MIME-Version: 1.0 In-Reply-To: <563B8EBA.8070506@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tUH4gR245k71Ue2aHq33o5iMsIlCq48ba" Subject: Re: [Qemu-devel] [PATCH v6 14/15] block: Rewrite bdrv_close_all() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-block@nongnu.org Cc: Kevin Wolf , Alberto Garcia , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tUH4gR245k71Ue2aHq33o5iMsIlCq48ba Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 05.11.2015 18:15, Paolo Bonzini wrote: >=20 >=20 > On 04/11/2015 19:57, Max Reitz wrote: >> BdrvAioNotifier *ban, *ban_next; >> =20 >> - if (bs->job) { >> - block_job_cancel_sync(bs->job); >> - } >> + assert(!bs->job); >> =20 >=20 > Who does this when ejecting a BDS from a BB? Nobody, which one can see as good or bad, depending on whether you liked it or not (it's mostly bad, though). So by removing this without replacement, block jobs continue to work on their BDS (and own it) until they're completed. One stance you can take is: Block jobs work on the BDS, so ejecting the BDS from the BB should not have an impact anyway (the BB name is only used as a shorthand for identifying the BDS). Another stance you can take is: The user only sees that the block job takes a device name, so it looks like it's working on the BB level and should behave as such. The first point becomes moot when one realizes that you can no longer complete a running block job once its BDS has been detached from the BB, since the block job commands take BB names. However, let's just try it: $ x86_64-softmmu/qemu-system-x86_64 -qmp stdio \ -drive if=3Dnone,file=3Dtest.qcow2,id=3Ddrive0,node-name=3Dnode0 {"QMP": {"version": {"qemu": {"micro": 50, "minor": 4, "major": 2}, "package": ""}, "capabilities": []}} {'execute':'qmp_capabilities'} {"return": {}} {'execute':'drive-backup','arguments':{'device':'drive0','target':'out.qc= ow2','format':'qcow2','sync':'none'}} Formatting 'out.qcow2', fmt=3Dqcow2 size=3D67108864 backing_file=3Dtest.q= cow2 backing_fmt=3Dqcow2 encryption=3Doff cluster_size=3D65536 lazy_refcounts=3D= off refcount_bits=3D16 {"return": {}} {'execute':'eject','arguments':{'device':'drive0'}} {"error": {"class": "GenericError", "desc": "Node 'drive0' is busy: block device is in use by block job: backup"}} So... Nobody does it, but apparently nobody has to because you cannot eject (to be more specific: use blockdev-remove-medium) a BDS from a BB while a block job is running on the BDS. Max --tUH4gR245k71Ue2aHq33o5iMsIlCq48ba 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 iQEcBAEBCAAGBQJWO5O9AAoJEDuxQgLoOKytdZoH/RTm9cM5PJMEEcmp4nT2lY6R 626y59rAXiKr0FvLG7I871b+gj1XoUW1mTybuqI1kweZPhkOcTw0UXo5gLCwk2BS LlLkFGXj/+FFEyb9gaLK9PJOaVHnASu5E6uuNR+NxiwSwyChNARIAs5hDEXzkkIb EBb1PeVusqt1LNpcy8RspI7dKCqDjhN1tJQY14cVPJoRCJpCeuFZBcSS7NcbiR6L BrGZAsLAVgKHj3ou408ZG5vkoljAbxhy/oXcvlSwIdKMJTzjaPlXWBYDHOjAwhfS 5yIEUr53RIVmmuxk3Coic9kFugkQLmgbNwb3BHLBLj5rhnXdvdJgdf44LB4t1J0= =HKxk -----END PGP SIGNATURE----- --tUH4gR245k71Ue2aHq33o5iMsIlCq48ba--