From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzURZ-0000Q6-Gv for qemu-devel@nongnu.org; Wed, 07 Apr 2010 08:33:17 -0400 Received: from [140.186.70.92] (port=42682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzURX-0000Nr-76 for qemu-devel@nongnu.org; Wed, 07 Apr 2010 08:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzURV-0005V9-Kv for qemu-devel@nongnu.org; Wed, 07 Apr 2010 08:33:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2552) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzURV-0005Uu-DZ for qemu-devel@nongnu.org; Wed, 07 Apr 2010 08:33:13 -0400 Message-ID: <4BBC7B62.7060607@redhat.com> Date: Wed, 07 Apr 2010 14:32:34 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: reject O_RDWR open for read-only images References: <20100407115753.GB12452@lst.de> In-Reply-To: <20100407115753.GB12452@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Am 07.04.2010 13:57, schrieb Christoph Hellwig: > Various obscure image format drivers do not allow write access. > Instead of silently falling back to read-only access reject attempts > to open these images for write access. > > Signed-off-by: Christoph Hellwig I'm not sure about this patch. I don't have any such images around, so I can't test it easily, but it looks to me as if you'd need to explicitly specify readonly=on if you want to use such formats. This in turn means that old style shortcuts like -hda don't work any more. Is it that important to avoid implicit fallbacks for obscure formats that we're willing to sacrifice compatibility? That said, personally I don't care about those format all that much anyway and the change would make things more consistent. If people consider it okay to break compatibility in this way, I won't stand in your way. But if we wanted to implement this, have you thought about doing it in one place in block.c? You could check if a driver supports bdrv_write or bdrv_aio_write, and if it doesn't support either I think you can assume it's read-only. Kevin