Received: from eggs.gnu.org ([2001:4830:134:3::10]:51613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5HmK-0006S4-Hy for qemu-devel@nongnu.org; Fri, 11 Nov 2016 14:46:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5HmJ-0000bp-EF for qemu-devel@nongnu.org; Fri, 11 Nov 2016 14:46:24 -0500 References: <20161102175539.4375-1-mreitz@redhat.com> <87y4113sjx.fsf@dusky.pond.sub.org> <87zilbzoor.fsf@dusky.pond.sub.org> <6ae9faf0-b47e-7f01-5d1f-c23a6cc132d9@redhat.com> <87eg2mmoi5.fsf@dusky.pond.sub.org> <20161109191534.GA15138@localhost.localdomain> From: Max Reitz Message-ID: Date: Fri, 11 Nov 2016 20:46:11 +0100 MIME-Version: 1.0 In-Reply-To: <20161109191534.GA15138@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bXpiarXVcbB9MWGaMr4sDVB1MXKUgLRBk" Subject: Re: [Qemu-devel] [PATCH for-2.8? 0/3] block/curl: Drop TFTP "support" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , Markus Armbruster Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bXpiarXVcbB9MWGaMr4sDVB1MXKUgLRBk From: Max Reitz To: Jeff Cody , Markus Armbruster Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org Message-ID: Subject: Re: [Qemu-devel] [PATCH for-2.8? 0/3] block/curl: Drop TFTP "support" References: <20161102175539.4375-1-mreitz@redhat.com> <87y4113sjx.fsf@dusky.pond.sub.org> <87zilbzoor.fsf@dusky.pond.sub.org> <6ae9faf0-b47e-7f01-5d1f-c23a6cc132d9@redhat.com> <87eg2mmoi5.fsf@dusky.pond.sub.org> <20161109191534.GA15138@localhost.localdomain> In-Reply-To: <20161109191534.GA15138@localhost.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 09.11.2016 20:15, Jeff Cody wrote: > On Tue, Nov 08, 2016 at 08:14:58AM +0100, Markus Armbruster wrote: >> Max Reitz writes: >> >>> On 07.11.2016 09:20, Markus Armbruster wrote: >>>> Max Reitz writes: >>>> >>>>> On 03.11.2016 08:56, Markus Armbruster wrote: >>>>>> Max Reitz writes: >>>>>> >>>>>>> See patch 3 for the reason why we have actually never supported T= FTP at >>>>>>> all (except for very small files (i.e. below 256 kB or so)). >>>>>> >>>>>> Care to explain why it works "for very small files" in a bit more >>>>>> detail? PATCH 3 gives a "does not support byte ranges" hint, but = to go >>>>>> from there to "very small files", you need to know more about how = the >>>>>> block layer works than I can remember right now. >>>>> >>>>> Our curl block drivers caches data and uses a readahead cache, whic= h by >>>>> default has a size of 256 kB. Therefore, if the start of the file i= s >>>>> read first (which it usually is, if just for format probing), then = the >>>>> correct data will be read for that size. >>>>> >>>>> Yes, you can adjust the readahead size. No, I cannot guarantee that= >>>>> there are no users that just set readahead to the image size and th= us >>>>> made it work. I can't really imagine that, though, because at that = point >>>>> you can just copy the file to tmpfs and have the same result. >>>>> >>>>> Also, if I were a user, I probably wouldn't use 256 kB images, and = thus >>>>> I would just notice tftp to be broken. I don't think I would experi= ment >>>>> with the readahead option to find out that it works if I set it to = the >>>>> image size and then just use it that way. I definitely think I woul= d >>>>> give up before that and just copy the file to the local system. >>>> >>>> I'm not trying to make you explain why it's okay to drop TFTP. I'm >>>> trying to make you explain what exactly worked and what exactly didn= 't. >>>> Such explanations generally involve a certain degree of "why". >>> >>> Well, I'm trying to explain both. :-) >>> >>>> Your first paragraph provides a few more hints, but I'm still guessi= ng. >>>> Here's my current best guess: >>>> >>>> * Commonly, images smaller than 256 KiB work, and larger images don'= t. >>> >>> Yes. Unless you set the "readahead" option to something different (it= >>> just defaults to 256 kB), then it'll commonly work for that images up= to >>> that size. >>> >>> Oh, and I just realized it's not called "readahead" for nothing: It g= ets >>> added to the size of the read operation, so if your first read operat= ion >>> has a size of 1 GB... Well, then all of that will be correctly cached= =2E >>> So both the size and the offset of the first read operation are signi= ficant. >>> >>>> * "Don't work" means the block layer returns garbled data. >>> >>> Right. It will be data from the image, but not from the offset you wa= nt. >>> >>>> * "Commonly" means when the first read is for offset zero. Begs the= >>>> question when exactly that's the case. You mentioned format probi= ng. >>>> What if the user specified a format? It's okay not to answer this= >>>> question. I'm not demanding exhaustive analysis, I'm fishing for = a >>>> better commit message. Such a message may leave some of its quest= ions >>>> unanswered. >>> >>> Well, qcow2 will always start at offset zero anyway (because it reads= >>> the header first). For raw images, the offset can be anywhere, but if= >>> you're starting a VM from it, offset zero is obviously likely to be r= ead >>> first, too. >>> >>> (And as a side note, the first read operation for qcow2 images will >>> always be 64 kB in size.) >>> >>> But, yes, for raw images the offset can be anywhere and if it is not >>> zero, the answer what works and what doesn't becomes a bit more compl= icated: >>> >>> >>> Suppose the first offset read from is 64k. curl will return data from= >>> offset 0 anyway, so it's pretty much garbage. But if you then do anot= her >>> read operation from 0, that will return correct data. >>> >>> If after that you try to read data from the area that has been covere= d >>> by both read operations... Then it depends on which buffer the curl >>> driver sees first, which is most likely the first one, i.e. you'll ge= t >>> broken data again. >>> >> >> There's a lovely addition to your commit message struggling to get out= >> of your reply. >=20 > I'm going to go ahead and apply the series; I think the relevant point > for the commit message is that TFTP is not usable and never has been. = If > Max has no objections, I'll pull some wording in from his reply here in= to > his commit message for patch 3, and squash all the patches into one. =20 >=20 > Max, any objections? No, that sounds good to me. Thank you very much! Max --bXpiarXVcbB9MWGaMr4sDVB1MXKUgLRBk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYJiADEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQJy+ B/9rfiwHYZ5Vym2EmhDOLf1c6MpFedZ0B8MbjXqCn6A0h1TsvaUBE2n39YDr9EJu At5i+Ma/q8M5ZIwdvrlCwnfTHlVucX6BRObd/PY9Rx9KsHK4OdzSA7rFr3KpD6No YRF9VwR4GP1G1ebeXI5jlKhW+SPHqnxpHBVRcoCrH1873eo1j9ih6p+lJ53r4flE O8J8UyXMa3ybk/j3k861K/7s1fPKKv4XTaWoXln3A8p53BXyXXDZPpNdFTsCrqq3 aHIPF1Tm8dGdZutaw4eoSPKBo5pO42WhePaGThMTJWx8ShTMrTtwEyh8VX2zip2W h6o/Tttw8nQ31pF4u7nWEzBq =LnMx -----END PGP SIGNATURE----- --bXpiarXVcbB9MWGaMr4sDVB1MXKUgLRBk--