Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ngvtf-0007Zt-Fn for qemu-devel@nongnu.org; Mon, 15 Feb 2010 03:01:35 -0500 Received: from [199.232.76.173] (port=33291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ngvte-0007ZM-38 for qemu-devel@nongnu.org; Mon, 15 Feb 2010 03:01:34 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ngvtb-0006j3-PW for qemu-devel@nongnu.org; Mon, 15 Feb 2010 03:01:33 -0500 Received: from mx20.gnu.org ([199.232.41.8]:22268) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ngvtb-0006iy-8E for qemu-devel@nongnu.org; Mon, 15 Feb 2010 03:01:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NgvtZ-0004Gc-Re for qemu-devel@nongnu.org; Mon, 15 Feb 2010 03:01:30 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1F81Qqo013775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Feb 2010 03:01:27 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [BUG] Regression: readonly raw images no longer work References: <4B771C34.4040308@mail.berlios.de> Date: Mon, 15 Feb 2010 09:01:23 +0100 In-Reply-To: (Paolo Bonzini's message of "Sat, 13 Feb 2010 23:38:12 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini writes: > 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. Maybe drive_enable_snapshot() should set readonly in opts as well.