Peter Maydell <peter.mayd...@linaro.org> writes: > On 19 October 2011 09:03, Markus Armbruster <arm...@redhat.com> wrote: >> <juha.riihim...@nokia.com> writes: >>> both device models already support running without a drive as well by >>> using a memory buffer instead so it would also be possible to make them >>> use a read-only drive in a way that initial NAND/OneNAND contents would be >>> read from the drive but any changes would not be written back to the drive >>> and would be lost when QEMU is killed. >> >> Sounds like it could be useful, but it's not what I'd expect for >> "readonly". >> >> You could create a boolean device property to make memory contents >> transient rather than persistent. Then reject read-only drives only in >> persistent mode, i.e. when the property is false. Feels cleaner to me. > > That doesn't sound very onenand/nand specific to me, though.
Better ideas welcome :) First thing to decide is whether it's a property of the device or one of its backend. Similar devices have similar properties. Sometimes we factor out common ones. See for instance DEFINE_BLOCK_PROPERTIES().