From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSyWT-0002LR-Sq for qemu-devel@nongnu.org; Thu, 07 Jan 2010 14:59:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSyWP-0002GC-SR for qemu-devel@nongnu.org; Thu, 07 Jan 2010 14:59:57 -0500 Received: from [199.232.76.173] (port=60228 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSyWP-0002FR-Mr for qemu-devel@nongnu.org; Thu, 07 Jan 2010 14:59:53 -0500 Received: from mail-yw0-f176.google.com ([209.85.211.176]:45595) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSyWN-0006NM-Eu for qemu-devel@nongnu.org; Thu, 07 Jan 2010 14:59:52 -0500 Received: by ywh6 with SMTP id 6so18800452ywh.4 for ; Thu, 07 Jan 2010 11:59:49 -0800 (PST) Message-ID: <4B463D33.6050301@codemonkey.ws> Date: Thu, 07 Jan 2010 13:59:47 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] Added 'access' option to -drive flag References: <4B338293.4000306@redhat.com> In-Reply-To: <4B338293.4000306@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org On 12/24/2009 09:02 AM, Naphtali Sprei wrote: > The new option is: access=[rw|ro|auto] > rw: open the drive's file with Read and Write permission, don't continue if failed > ro: open the file only with Read permission > auto: open the file with Read and Write permission, if failed, try only Read permision > > For compatibility reasons, the default is 'auto'. Should be changed later on. > > This option replaces the 'readonly' options added lately. > > Instead of using the field 'readonly' of the BlockDriverState struct for passing the request, > pass the request in the flags parameter to the function. > > The BDRV_O_RDWR/RDONLY becomes just one bit, BDRV_O_RDONLY gone. > Users shouldn't be involved in deciding how an image is open. Instead, marking a drive read only (via readonly) should cause a file to be open read-only. By default, when media=cdrom, we should toggle the readonly flag. As for the behaviour with trying read-write and then read-only, let's just drop it. It's a bug and I've seen it reported half a dozen times as such. Regards, Anthony Liguori