From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NgQdR-000154-Ee for qemu-devel@nongnu.org; Sat, 13 Feb 2010 17:38:45 -0500 Received: from [199.232.76.173] (port=55162 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgQdQ-00014w-5G for qemu-devel@nongnu.org; Sat, 13 Feb 2010 17:38:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NgQdP-00057i-F7 for qemu-devel@nongnu.org; Sat, 13 Feb 2010 17:38:44 -0500 Received: from lo.gmane.org ([80.91.229.12]:60231) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NgQdP-00057c-4h for qemu-devel@nongnu.org; Sat, 13 Feb 2010 17:38:43 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NgQdN-0008No-Iy for qemu-devel@nongnu.org; Sat, 13 Feb 2010 23:38:41 +0100 Received: from 85.93.118.17 ([85.93.118.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Feb 2010 23:38:41 +0100 Received: from pbonzini by 85.93.118.17 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Feb 2010 23:38:41 +0100 From: Paolo Bonzini Date: Sat, 13 Feb 2010 23:38:12 +0100 Message-ID: References: <4B771C34.4040308@mail.berlios.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <4B771C34.4040308@mail.berlios.de> Sender: news Subject: [Qemu-devel] Re: [BUG] Regression: readonly raw images no longer work List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 02/13/2010 10:40 PM, Stefan Weil wrote: > This command used to work, but fails now: > > $ i386-softmmu/qemu -snapshot /dev/sda > qemu: could not open disk image /dev/sda: Permission denied > > $ ls -l /dev/sda > brw-rw-r-- 1 root disk 8, 0 13. Feb 08:55 /dev/sda > > The original file of a snapshot needs only read access, > but QEMU tries read/write access and fails. > > Variants of above command using -hda or -drive > also fail with the same error message. > > I did not test whether the regression affects other > kinds of images, too. Maybe only raw images trigger > no longer work. Caused by commit 03cbdac7efc20994d0a87015e24e835d0139df7b Author: Naphtali Sprei 2010-01-17 15:48:15 Committer: Anthony Liguori 2010-01-20 15:25:22 Follows: v0.12.0-rc0 Disable fall-back to read-only when cannot open drive's file for read-write Signed-off-by: Naphtali Sprei Signed-off-by: Anthony Liguori ... because before that it was working like this: open("/dev/sda", O_RDWR|O_SYNC|O_CLOEXEC) = -1 EACCES open("/dev/sda", O_RDONLY|O_SYNC|O_CLOEXEC) = 10 BTW, because of other bugs in the middle of the history you need a command line "-hda /dev/null -drive file=/dev/sda,snapshot=on" to bisect it. Paolo