From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxNYs-0001H9-2p for qemu-devel@nongnu.org; Mon, 12 Oct 2009 12:15:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxNYn-00015J-Ay for qemu-devel@nongnu.org; Mon, 12 Oct 2009 12:15:49 -0400 Received: from [199.232.76.173] (port=33872 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxNYn-000153-7e for qemu-devel@nongnu.org; Mon, 12 Oct 2009 12:15:45 -0400 Received: from isrv.corpit.ru ([81.13.33.159]:40806) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxNYm-0007eb-U2 for qemu-devel@nongnu.org; Mon, 12 Oct 2009 12:15:45 -0400 Message-ID: <4AD3562F.8000106@msgid.tls.msk.ru> Date: Mon, 12 Oct 2009 20:15:43 +0400 From: Michael Tokarev MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Add readonly flag to -drive command References: <4AD32550.8040901@redhat.com> <4AD32DF6.4050100@redhat.com> <20091012135032.GA13560@shareable.org> <4AD33D6D.9020900@codemonkey.ws> In-Reply-To: <4AD33D6D.9020900@codemonkey.ws> 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: Anthony Liguori Cc: Kevin Wolf , Naphtali Sprei , qemu-devel@nongnu.org Anthony Liguori wrote: > Jamie Lokier wrote: >> Kevin Wolf wrote: >> >>> Am 12.10.2009 14:47, schrieb Naphtali Sprei: >>> >>>> In order to safely share an image between guests (as read only >>>> drive), add a 'readonly' flag >>>> to the -drive command (qemu command line and monitor). >> >> Heh. I've been sharing images between guests for ages - using "chmod -r" :-) > > Were it not for backwards compatibility, I would remove that and have it > error out. > > I've had multiple people end up with strangely broken guests because > they didn't realize the image was read only. And I had this issue too. But for me it's still not clear. Some disk drives out there can be switched to read-only mode at runtime by using appropriate command. Certain (USB and especially SD) flash drives can be read-only too (usually a tiny swith does that). Even old good floppy drives had a "write protect" switch. How the system determines if such devices are read-only? For a HDD or a flash drive, I *guess* the drive return appropriate error message, no? But qemu - apparently - just ignores writes in this case, which results in stalled guest which expects some answer to the write command.. I guess, because it was always the stalls. /mjt