From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtz4A-0003nq-GS for qemu-devel@nongnu.org; Thu, 27 Nov 2014 08:25:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtz45-0001Is-E7 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 08:25:02 -0500 Message-ID: <54772616.4080204@redhat.com> Date: Thu, 27 Nov 2014 14:24:38 +0100 From: Max Reitz MIME-Version: 1.0 References: <1416924485-13304-1-git-send-email-mreitz@redhat.com> <1416924485-13304-4-git-send-email-mreitz@redhat.com> <20141125144142.GE4641@noname.redhat.com> <5474970E.5030308@redhat.com> In-Reply-To: <5474970E.5030308@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/12] block/nfs: Add create_opts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-stable@nongnu.org, Peter Lieven , Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi On 2014-11-25 at 15:49, Max Reitz wrote: > On 2014-11-25 at 15:41, Kevin Wolf wrote: >> Am 25.11.2014 um 15:07 hat Max Reitz geschrieben: >>> The nfs protocol driver is capable of creating images, but did not >>> specify any creation options. Fix it. >>> >>> Cc: qemu-stable@nongnu.org >>> Signed-off-by: Max Reitz >> As you'll respin anyway: Can you mention how this would fail? (I suppose >> some segfault when trying to access the options?) > > I'd have to try, but I guess it actually doesn't fail in most cases > because the size option is part of the format drivers options anyway. > I can imagine something being broken when doing preallocation in > qcow2, though, which makes the qcow2 reset the size option. Indeed it doesn't fail because the size option is part of the format driver. The interesting thing is that all format block drivers take the QemuOpts object which is basically the original options QDict absorbed into their *and the protocol's* creation options QemuOptsList (with the size option set etc. pp.), then take out the options they understand and pass along the rest to the protocol driver. This leads to the funny constellation that if a format driver does not understand some option, it's passed on (you can use preallocation=full with any format block driver, as long as the protocol is raw-posix), but if it does, it's not (if you use qcow2, the protocol block driver will only be given the preallocation option if qcow2 was so kind and set it itself). It seems too intentional to me to call it a bug... However, as for this patch, I could indeed produce a failure case: $ qemu-img create -f nfs nfs://127.0.0.1/foo.qcow2 64M [1] 14582 segmentation fault (core dumped) Maybe we want qemu-img to check whether the format given through -f or -O is indeed a format... But for now, all the better for me as it gives me something which I'm fixing. I won't make this an iotest, though, because -f $protocol is not something that should actually work. Max