qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/3] blockdev: Add read-only option to change-bl


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 0/3] blockdev: Add read-only option to change-blockdev
Date: Tue, 02 Dec 2014 10:16:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2014-11-28 at 16:43, Markus Armbruster wrote:
Kevin Wolf <address@hidden> writes:

Am 20.11.2014 um 13:44 hat Max Reitz geschrieben:
The 'change' QMP and HMP command allows replacing the medium in drives
which support this, e.g. floppy disk drives. For some drives, the medium
carries information about whether it can be written to or not (again,
floppy drives). Therefore, it should be possible to change the read-only
state of block devices when changing the loaded medium.

This series adds an optional additional parameter to the 'change' QMP
and HMP command which allows changing the read-only state in four ways:

- 'retain': Just keep the status as it was before; this is the current
   behavior and thus this will be the default.
- 'ro': Force read-only access
- 'rw': Force writable access
- 'auto': This opens the new file R/W first, if that fails, the file is
   opened read-only.
Not sure if 'auto' is worth implementing (it's a typical HMP default
action that no QMP client would use, except that it isn't even the
default for HMP), but the implementation looks correct at least.
QMP eschews magic.  I'd prefer to keep 'auto' out.

HMP can offer it regardless, if it's useful.  But I doubt it will be.
Few users will need to control this, and fewer will realize they can by
giving an extra argument.

Well, Kevin made the good point of the user generally knowing whether a file should be written to or not. Furthermore, I don't think it would be too hard to use rw, then see that access was denied, and then use ro, manually. Maybe that's even better than auto, somehow.

Max

I wish I could tell you to leave change alone because it's a legacy
dungpile.  Alas, it's still only a dungpile.  I hope we can create a set
of sane media control commands relatively soon now.




reply via email to

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