Received: from eggs.gnu.org ([2001:4830:134:3::10]:41313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkDpD-0001yY-Bd for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xk8bV-0007vX-VC for qemu-devel@nongnu.org; Fri, 31 Oct 2014 05:34:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xk8bV-0007vP-Na for qemu-devel@nongnu.org; Fri, 31 Oct 2014 05:34:45 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9V9YivF006112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 31 Oct 2014 05:34:45 -0400 Date: Fri, 31 Oct 2014 10:34:42 +0100 From: Kevin Wolf Message-ID: <20141031093442.GB4496@noname.str.redhat.com> References: <1414671976-5353-1-git-send-email-kwolf@redhat.com> <1414671976-5353-4-git-send-email-kwolf@redhat.com> <54524ABC.1070406@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <54524ABC.1070406@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/4] raw: Prohibit dangerous writes for probed images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: jcody@redhat.com, mreitz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 30.10.2014 um 15:27 hat Eric Blake geschrieben: > On 10/30/2014 06:26 AM, Kevin Wolf wrote: > >=20 > > The other differences of this patch to the old one are that it doesn't > > silently write something different than the guest requested by zeroing > > out some bytes (it fails the request instead) and that it doesn't > > maintain a list of signatures in the raw driver (it calls the usual > > probe function instead). > >=20 > > Signed-off-by: Kevin Wolf > > --- > > block.c | 5 +++-- >=20 > > + > > + drv =3D bdrv_probe_all(buf, 512, NULL); > > + if (drv !=3D bs->drv) { > > + ret =3D -EPERM; > > + goto fail; > > + } >=20 > So, what happens when this returns -EPERM? If the guest is configured > to halt on write errors, does this halt the guest and send an event to > management? How does it compare to the case of halting on ENOSPACE? Is > this particular failure mode something that the host should be able to > easily distinguish from other failure modes? This -EPERM is returned the same way as error that come directly from the kernel, so the usual werror/rerror rules apply. It can easily be distinguished from ENOSPC (nospace=3Dfalse in the QMP event, io-status=3Dfailed in BlockInfo for query-block), but it looks the same as a regular I/O error. > But I definitely like that you only do this failure on probed images, > and that a user that requests an explicit raw format will never trip up. Right, a management tool should always be passing the format explicitly and shouldn't need to deal with this error case at all. Kevin --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJUU1eyAAoJEH8JsnLIjy/WzcMP/ituglSNA0sFoP5U0UffLbO/ fa5kThoJL8wl10agKjLMYQtMO2k7bKvTd8ulljYwQ+ADKUNOJWA218OFcYD3Sl/r r6cy8mHy4jkEDAkORg4zIXVerV+YLU9KjNQYgylTgh7fv+Yf3D5zvDzw5OIdXv9q /lr89Gq3B3B82n+mlodeV6EeTXLSwyOBwUV4B1VBMUrzPGKTZKQLpcq82aqD8zmc I5PaxoQ+UqB7cLfe3h0fIhHmYrOXBbC9C4onEarnd1ADQkSPOe7b9Rnf6iuk0OrC X0F0cLQSnMF3N1h51wng/RzCV9JLUEITotRoCZO3KHuDMSrUHiSsVjiAB24Ij0mf B0QTSCF25f9cYZTiiDqD5AuvJuJIY0gJTNnXREv3IJgsgOVzLrUtWMIfKMlsGyyJ i/IfsXSyv6aAO6Fu4WlEX9x76iaGD13qV7IqmVz5RboEqFPYwWu7oE1wphdC/HzE eMwYhfcOe53ZiXMj/MIcbNXI31JeI0/egIr0XigPeNtHUsP0Rh7AqRcWyQfTGLDB 2+/M8EA0aGGWY2l5ZdkPDG3wH2kKB3Ae43j1wsQ+kfYyqrWvuJTbEd50WCMbMRg7 1l8SpjAhJJajSAgmyHk56iUdkhaB1DK/UFXQMoqa693ZAQcRITQ8CyQi9+Msv8l0 +84rvIRYyHFOzaxAvkfr =s/OP -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o--