From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqfST-0002PU-9w for qemu-devel@nongnu.org; Fri, 08 May 2015 06:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqfSQ-0002Es-3B for qemu-devel@nongnu.org; Fri, 08 May 2015 06:24:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqfSP-0002Ec-RW for qemu-devel@nongnu.org; Fri, 08 May 2015 06:24:37 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t48AOaAn007665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 8 May 2015 06:24:36 -0400 Date: Fri, 8 May 2015 11:24:34 +0100 From: Stefan Hajnoczi Message-ID: <20150508102434.GH11717@stefanha-thinkpad.redhat.com> References: <1431013548-22492-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ISKrrfpKsPiF35CV" Content-Disposition: inline In-Reply-To: <1431013548-22492-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: return EPERM on writes or discards to read-only devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com --ISKrrfpKsPiF35CV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 07, 2015 at 05:45:48PM +0200, Paolo Bonzini wrote: > This is the behavior in the operating system, for example Linux's > blkdev_write_iter has the following: >=20 > if (bdev_read_only(I_BDEV(bd_inode))) > return -EPERM; >=20 > This does not apply to opening a device for read/write, when the > device only supports read-only operation. In this case any of > EACCES, EPERM or EROFS is acceptable depending on why writing is > not possible. >=20 > Signed-off-by: Paolo Bonzini > --- > block/io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --ISKrrfpKsPiF35CV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVTI7iAAoJEJykq7OBq3PImuIH/17Pw5X++25t641xtc08cBiD OLWCGJsS1+3oIQK36NTTQeHuOLwuyCraiZf7IjToOyBhEPYqyEgFW44kqfyV6lyM jeTuQflytcbiLzCk6ljJaoMOp5NNVmEwcQzYsjy8Jki9xkTMX1G+qKQOc64JgsLO trfdA894CWKMqF4iOmdjfxkO6r2x7KID1VowhmWQs07nn73btAJsQ3VTz7/EtJhB oTRKmX4wHdSEnkICHvQuYvorZUwuaCIoHVc7FspOilffiXVsGLk32mTdwOaQcgu2 GLUSotKMbChoKo6qKvdaf11zzCzM73NEbkF72JYKwDgU6BH6vm/oPj56oy000CA= =SBEk -----END PGP SIGNATURE----- --ISKrrfpKsPiF35CV--