Received: from eggs.gnu.org ([140.186.70.92]:59464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGSin-0005x3-33 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 05:46:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGSil-00051A-SZ for qemu-devel@nongnu.org; Wed, 19 Oct 2011 05:46:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGSil-00050u-9A for qemu-devel@nongnu.org; Wed, 19 Oct 2011 05:45:59 -0400 From: Markus Armbruster References: Date: Wed, 19 Oct 2011 11:45:43 +0200 In-Reply-To: (Peter Maydell's message of "Wed, 19 Oct 2011 09:46:27 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] hw/nand hw/onenand and read-only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: riku.voipio@iki.fi, Juha.Riihimaki@nokia.com, qemu-devel@nongnu.org Peter Maydell writes: > On 19 October 2011 09:03, Markus Armbruster wrote: >> 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 dr= ive >>> 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. =C2=A0Then reject read-only drives onl= y in >> persistent mode, i.e. when the property is false. =C2=A0Feels 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().