From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycbk2-0000rT-Tg for qemu-devel@nongnu.org; Mon, 30 Mar 2015 11:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycbjx-00058P-Ki for qemu-devel@nongnu.org; Mon, 30 Mar 2015 11:36:42 -0400 Date: Mon, 30 Mar 2015 17:36:34 +0200 From: Kevin Wolf Message-ID: <20150330153634.GC4305@noname.redhat.com> References: <55151DB7.3090200@msgid.tls.msk.ru> <55156DE0.4050209@redhat.com> <551578F4.9010400@msgid.tls.msk.ru> <55158F8B.9090607@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <55158F8B.9090607@redhat.com> Subject: Re: [Qemu-devel] block-commit & dropping privs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Michael Tokarev , qemu-devel , qemu-block@nongnu.org --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 27.03.2015 um 18:12 hat Eric Blake geschrieben: > On 03/27/2015 09:36 AM, Michael Tokarev wrote: > > Wonder how to specify cache mode, or should I open these with proper > > O_DIRECT/O_SYNC/whatever? It looks like it's possible to change O_DIRE= CT > > at runtime but not O_SYNC. > >=20 > > And the more interesting question is how to do that from shell. >=20 > Redirections only get you so far in shell; you may need a wrapper C > program go get O_DIRECT and/or O_SYNC pre-set. Then again, if you use > QMP and pass over the Unix socket, you need a C program anyways. O_DIRECT can be set with fcntl(), so qemu takes care of that. O_SYNC is completely unused on Linux these days, so that shouldn't be a problem either. (Other platforms use it as a misguided attempt of approximating O_DIRECT. We should really error out instead.) So if I'm not mistaken, just having one read-only and one read-write fd should be enough for any configuration in practice. Kevin --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJVGW2BAAoJEH8JsnLIjy/W3t4P/0rjixNJ6teM/9I+1KIKoPlS 8Gm1+ie022bcwNHT2IkGfKHbNkF3BksJ/QPjT4DTC8ky/q748JchKW8JWBxdEjqZ VbrIj6X754gxOYKgwloAM16wOxkDko4vV+D+9e7CQ3z3CE1B3hMccju+n3Vn1RG2 Pl2IHz5VUZ7Trruu0u40OfqTi5zijwjCnY7VxPIF+4WezaW1OVxaEYDXU+lQvRXb t8pv5wtbwDdabcu0VBzjRa0WUtYPBXCQxK8NBWiggDG+gpI9LJI8WCpILcb+Wimk JXBvH8zfAq1itFYW6oXcB/TYe7BvY7yuLdU/EVIs7uz9KPDT0hgj0Q0T8dUfoqmx 1g1HPK4BkTfXGroBbFQCRZrHZfSfHELclFEIMgkwqsLZ9vjODNfwxiX6l0Pgn1CE Zx30ghSYFTOF+iuufEc1ToIterNSxaDRuPoLy2g+cI46kRjdMcfNBdrdorMS1/jA M/CIhg0ny8us3rnvCqfLl+DgoTPwOm93oXXwVV0Jy2+gWsjWODi/eJwSBBu9VXtL wZTZmqiz9PvAZuzcDb7jGN5UuMCwKXCL6EVBnjh7Dk6SrFkTCFlYbBp40UOjqmOg PaHNyUW3in2llKy28ml05CA907frR16TXCGeDFZ2ZWJf8YeJZL8T3Geaajy6TsLl 2DsijkylVy+5c4umQC3c =jHt2 -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--