qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/12] block/nfs: Add create_opts


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 03/12] block/nfs: Add create_opts
Date: Thu, 27 Nov 2014 14:24:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

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: address@hidden
Signed-off-by: Max Reitz <address@hidden>
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]