From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyNR8-0001lQ-KH for qemu-devel@nongnu.org; Thu, 15 Oct 2009 06:19:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyNR3-0001fD-6a for qemu-devel@nongnu.org; Thu, 15 Oct 2009 06:19:57 -0400 Received: from [199.232.76.173] (port=43335 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyNR3-0001f3-2V for qemu-devel@nongnu.org; Thu, 15 Oct 2009 06:19:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13823) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyNR2-0001rS-Km for qemu-devel@nongnu.org; Thu, 15 Oct 2009 06:19:52 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9FAJpoD001643 for ; Thu, 15 Oct 2009 06:19:51 -0400 Message-ID: <4AD6F704.2020508@redhat.com> Date: Thu, 15 Oct 2009 12:18:44 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Pass the drive's readonly attribute to the guest OS References: <4AD5F3BD.2040402@redhat.com> <4AD5FEF2.2000308@redhat.com> <4AD6ED3B.1030902@redhat.com> <20091015094331.GE30889@redhat.com> <4AD6F06F.7060209@redhat.com> <20091015095426.GF30889@redhat.com> <4AD6F188.2070103@redhat.com> <20091015100120.GG30889@redhat.com> <4AD6F3F5.8000803@redhat.com> <20091015101131.GH30889@redhat.com> In-Reply-To: <20091015101131.GH30889@redhat.com> 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: Gleb Natapov Cc: Naphtali Sprei , qemu-devel@nongnu.org Am 15.10.2009 12:11, schrieb Gleb Natapov: > On Thu, Oct 15, 2009 at 12:05:41PM +0200, Kevin Wolf wrote: >>>>>>>> If the right response to a write on a read-only device is defined in the >>>>>>>> specification (and it most probably is), we should still give the right >>>>>>>> response, even though the OS is doing something wrong. >>>>>>>> >>>>>>> And since our response to write error may be pausing a VM we shouldn't >>>>>>> allow this to be triggered by a guest OS. >>>>>> >>>>>> I thought we only pause the VM if we get an host IO error? But if you do >>>>>> want to stop it for all errors, you shouldn't start suppressing errors >>>>>> so that it doesn't stop. >>>>>> >>>>> We pause only on host IO errors, but if we open underlying file as >>>>> read only (do we?) and try to write into it we will get an IO error >>>>> in the host. >>>> >>>> No, we'll return an error before a write request to the host is even issued. >>>> >>> Who is "we"? If "we" == "bdrv_write()/dma_bdrv_write()" then it's all the same. >>> Upper layers don't actually care why block driver failed. >> >> Right, "we" is the qemu block layer. If the devices don't use the error >> code returned, they better should be fixed, I think? >> > Fixed in what way? There is an option to pause VM on any write error. If > block layer returns write error for whatever reason VM will be paused. > If scsi/ide/virtio knows that the media is read only it shouldn't > issue writes to block layer, but handle it like real HW would. Ok, I agree if you want to do it this way. How it's done I really don't care too much, but in the end the guest OS should see the right error. I had the impression that Naphtali and you wanted to silently ignore writes to a read-only disk, which would be just wrong. Kevin