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-sta...@nongnu.org
Signed-off-by: Max Reitz <mre...@redhat.com>
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