Received: from eggs.gnu.org ([2001:4830:134:3::10]:56038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQGL-0001AC-2C for qemu-devel@nongnu.org; Tue, 24 Jun 2014 08:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzQGB-0005k1-N4 for qemu-devel@nongnu.org; Tue, 24 Jun 2014 08:55:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzQGB-0005ji-2H for qemu-devel@nongnu.org; Tue, 24 Jun 2014 08:55:39 -0400 Date: Tue, 24 Jun 2014 14:55:30 +0200 From: Kevin Wolf Message-ID: <20140624125530.GH3458@noname.redhat.com> References: <20140619091716.GS21236@stefanha-thinkpad.redhat.com> <20140619162600.GB6096@localhost.localdomain> <53A314B0.9030508@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline In-Reply-To: <53A314B0.9030508@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 for 2.1 00/10] Modify block jobs to use node-names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: benoit.canet@irqsave.net, pkrempa@redhat.com, famz@redhat.com, Stefan Hajnoczi , Jeff Cody , qemu-devel@nongnu.org, stefanha@redhat.com --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 19.06.2014 um 18:49 hat Eric Blake geschrieben: > On 06/19/2014 10:26 AM, Jeff Cody wrote: > >> b. Is it a good idea to perform op blocker checks on the root node? > >> It's inconsistent with resize, snapshot-sync, etc. Permissions in > >> BDS graphs with multiple root nodes (e.g. guest device and NBD > >> run-time server) will be different depending on which root you > >> specify. > >=20 > > I don't think (b) is the ultimate solution. It is used as a stop-gap > > because op blockers in the current implementation is essentially > > analogous to the in-use flag. But is it good enough for 2.1? If > > *everything* checks the topmost node in 2.1, then I think we are OK in > > all cases except where images files share a common BDS. What's the problem again with just propagating all blockers down the chain using bs->backing_hd and then checking just the affected nodes rather than trying to figure out a root? It would probably be more restrictive than necessary, but it looked like a safe first step. > > The ability for internal BDSs to share a common base BDS makes some > > block jobs unsafe currently, I believe. A crude and ugly fix is to > > only allow a single block-job to occur at any given time, but that > > doesn't seem feasible, so let's ignore that. >=20 > Can we even create a common base BDS in qemu 2.1? I know that the > blockdev-add command was designed with this possibility in mind, but to > my knowledge, we have not actually wired it up yet. You can create such chains, I just tried it: x86_64-softmmu/qemu-system-x86_64 \ -drive if=3Dnone,id=3Dbacking,file=3D/tmp/backing.qcow2 \ -drive file=3D/tmp/empty.qcow2,backing.file=3Dbacking \ -drive file=3D/tmp/empty2.qcow2,backing.file=3Dbacking Gives me the same disk twice, and I can independently change them as you would expect. > >> The answer seems to be that op blockers should be propagated to all > >> child nodes and commands should test the node, not the drive/root node. > >> That gives us the flexibility for per-node op blockers in the future a= nd > >> maintains compatibility with existing node-name users. > >> > >=20 > > Long term thoughts: > >=20 > > So if I think of operations that are done on block devices from a > > block job, and chuck them into categories, I think we have: > >=20 > > 1) Read of guest-visible data > > 2) Write of guest-visible data > > 3) Read of host-visible data (e.g. image file metadata) > > 4) Write of host-visible data (e.g. image file metadata, such as > > the backing-file) > > 5) Block chain manipulations (e.g. movement of a BDS, change to r/w > > instead of r/o, etc..) > > 6) I/O attribute changes (e.g. throttling, etc..) > >=20 > > Does this make sense, and did I miss any (likely so)? It seems like > > we should issue blockers not based on specific commands (e.g. > > BLOCK_OP_TYPE_COMMIT), but rather based on what specific category of > > interaction on a BDS we want to prohibit / allow. >=20 > Yes, I like that train of thought - it's not the operation that we are > blocking, but the access category(ies) required by that operation. Yes, I argued something similar in our block meeting in Stuttgart, and I still think it's a good idea in principle. The problem with it is that the right categories aren't quite obvious. For example, I think guest/host writes really means writes that change the visible contents of this image. A shared backing file would require that its contents never changes, but that's not really related to the guest. A commit operation does a "guest" write on the base node because its contents changes when you look only at the specific node. Kevin --TB36FDmn/VVEgNH/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTqXVCAAoJEH8JsnLIjy/WmV8QAKx77z4AjZorHB4e37PodFBa kN1H2PbUbKHedPHczwql4nvFUmiT/ECbP/xyzzscOVWdpgzgroThq+mTF54vaB8d 0xfathj/+IcvbIhDxkH9K2Y3YQcOvPe+aqQYSa6HB6tBv/57X90GN2fY+28jCu7i FnEdbp8v24JoizbwQ63uaLCVP+I1zqQWi7/z/hMWYkZ9POUKAtDR+kWeYZSeYSjC YUtJxkHZawwVW2ygfisRM2Zb6nclUjc2Sq+hLt7wgsiaHD1zo05ExKaOWU/c3+LR JnrNlzOUj+maGh2BW1TsGwQ3EVgBpmMy7sakCLzexImUaIqOJ8mrn/w3EskI2nhn qvEMfclXqkJU/ctBx1elimU38XYoktXVXJwx2C8XBbiq2n2KR6u4bOg5BdFmhigE xSjcu1xENtkBGw65moH867Eg6e8MRw47f8e9sVmZ50rs1tB3pkP1ZK5PxQRDsDWU m0CLCMqRsUdtInlXuVb+GV7hEJMkvVMTrv0W84IbRPKAZwhS3ttFTv6ZpJ7gphVK 8OqMd9tqOOu5hUGyrklvh8pOM3J1Cw7rt9fiF8NggeTuRymZFZ+xaxE7sjfBjbJu QFb+nLYEsm3BMmWzpbi0uK9wDSCKdp6QsnI66ZlgAOGsDBtEDinb6JItghbuPAv+ 57kxGQDHLQE7DTOHjEHA =5bVF -----END PGP SIGNATURE----- --TB36FDmn/VVEgNH/--