From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO6qL-0006VO-JI for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:24:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO6qK-0008NR-D6 for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:24:05 -0400 References: <1468499383-17840-1-git-send-email-den@openvz.org> <1468499383-17840-4-git-send-email-den@openvz.org> <5787B83C.5020306@redhat.com> <578899F3.3080605@virtuozzo.com> From: Eric Blake Message-ID: <57891C2D.5010004@redhat.com> Date: Fri, 15 Jul 2016 11:23:57 -0600 MIME-Version: 1.0 In-Reply-To: <578899F3.3080605@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WdIOsKqmCTV3gCv0qrSj8ro8WiLrmDaj5" Subject: Re: [Qemu-devel] [PATCH v6 3/6] tests: in IDE and AHCI tests perform DMA write before flushing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Evgeny Yakovlev , "Denis V. Lunev" , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Max Reitz , Stefan Hajnoczi , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WdIOsKqmCTV3gCv0qrSj8ro8WiLrmDaj5 From: Eric Blake To: Evgeny Yakovlev , "Denis V. Lunev" , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Max Reitz , Stefan Hajnoczi , John Snow Message-ID: <57891C2D.5010004@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 3/6] tests: in IDE and AHCI tests perform DMA write before flushing References: <1468499383-17840-1-git-send-email-den@openvz.org> <1468499383-17840-4-git-send-email-den@openvz.org> <5787B83C.5020306@redhat.com> <578899F3.3080605@virtuozzo.com> In-Reply-To: <578899F3.3080605@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/15/2016 02:08 AM, Evgeny Yakovlev wrote: >>> + * Write sector 0 with random data to make AHCI storage dirty >> If we ever have a case where we open a disk without specifying -raw, t= he >> random data _might_ resemble some other format and cause probe to >> misbehave; as such, we also have code in the block layer that >> specifically prevents writes to sector 0 for some data. Should you pic= k >> a different sector than 0, so as to avoid any (remote) possibility tha= t >> the random data could change probe results or be rejected? >> >=20 > Not sure if i understand the problem you're referring to here. Those ar= e > blkdebug tests, those disks are created, emulated with blkdebug backend= , > flushed and then thrown away. So is there really any possibility for > reopening the image and accidentally parsing a partition table in secto= r 0? >=20 > Also, not sure what you mean by "code in the block layer that > specifically prevents writes to sector 0 for some data". Can you explai= n > that bit, because it sounds pretty scary. How can we deny guest VM to > write anything to sector 0 on its emulated disk? Read block/raw_bsd.c:raw_co_writev_flags() for the gory details. If the guest ever gets a raw format driver because the user forgot to say '--format $foo', then we prevent the guest from writing anything into sector 0 that would be probed as non-raw. It means there are only a handful of patterns that the guest cannot write into the first sector, but it IS a non-zero number of patterns. How the guest behaves if such a write is attempted depends on the error policy you have on that device; it might show up as an EIO error to the guest, or it might stop the guest from executing and raise a qemu event to the management application, but the point is that we actively prohibit some writes to sector 0 on a probed raw disk. Using any sector other than 0 doesn't have this limitation, or you can ensure that your test ALWAYS passes the appropriate --format $foo so that the disk is never probed as another way to avoid limitations on sector 0. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WdIOsKqmCTV3gCv0qrSj8ro8WiLrmDaj5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXiRwtAAoJEKeha0olJ0NqDOgH/RE97W4iYgOTV8Oy0TsjQ4zA vRDG5uOlKERq4FVGPyeVM47gotjMccBl/OQefWPGHzPNQRuEYZmRdVxY6ra2NdqR ULfzguJAMXLPqthlUJSIry6bahjHF5NHX2DnMz9DxM7yIAHAjsS05aaCy8coeMZj 6vhRLw3QR5YxkqmOIomnA8k18ieo4Hs8bXRGA2va8aGuNjAhqVMqGUB4e/Ma9JDP jRiuEDXTzNcLD+k+Ry1kG7uWYygEfr6QD4FfHGMC4OeMQVhf5d4WiGVCP/D/a7FJ Ym8qVLoI4S6rfkHboIH8NfsYZL0mtLUfJ7+JDM9O9d8FZTQ6bdo7oDrJh19Z9Ac= =Ec1a -----END PGP SIGNATURE----- --WdIOsKqmCTV3gCv0qrSj8ro8WiLrmDaj5--