From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuLLr-0001Tx-Ec for qemu-devel@nongnu.org; Mon, 18 May 2015 09:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuLLm-00066F-CU for qemu-devel@nongnu.org; Mon, 18 May 2015 09:45:03 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:32894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuLLm-000667-5U for qemu-devel@nongnu.org; Mon, 18 May 2015 09:44:58 -0400 Received: by wgjc11 with SMTP id c11so27671017wgj.0 for ; Mon, 18 May 2015 06:44:57 -0700 (PDT) Date: Mon, 18 May 2015 14:44:52 +0100 From: Stefan Hajnoczi Message-ID: <20150518134452.GJ24319@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n8884J15jRwcBTvu" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] virtio: Question on VRING_DESC_F_WRITE flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Subhashini Venkataraman Cc: "qemu-devel@nongnu.org" --n8884J15jRwcBTvu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 13, 2015 at 07:16:13PM +0000, Subhashini Venkataraman wrote: > I have a question on VRING_DESC_F_WRITE flag. As per the specifications, if this flag is set, then the corresponding buffer pointed by the descriptor is Write only, otherwise Read Only. I am trying to understand why there is no READ_AND_WRITE option, i.e. a buffer could be Read by device emulation and written back into. All virtio devices are designed so that descriptors are read-only or write-only. A typical request looks like this: [header (RO)][data (RO)][status (WO)] or [header (RO)][data (WO)][status (WO)] Not sure what the original requirement for this design was, but the read-only/write-only approach means that buffers could be sent over a transport (like a pipe or TCP socket). If a buffer was read-write then it would be involve sending back a modified copy, which is unnecessary. Stefan --n8884J15jRwcBTvu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVWezUAAoJEJykq7OBq3PIRPkH/jjXNvIWqFra0M+3CmRVmlH3 xqIwrtUA4g53mwCC+eI6+IgH5bBwKZ0trRwz4A5ebNRpCeCVbr/qcVN1MyUgHLVI id5GLuq5En7Ef30UGC8Yfd9MW+Tl+Jm9+5nLRCSfzg1rrHw4KRhoFNnOhZqgFdzn 5oy04DFYdBKoIt0/ZFwpSOQWWunhAj64/dGOHvF3C94njysWR40KJQENpjGS/VQ7 nan25Rl/TqEUPGDTOsTwRT/BPj2/jWpY+BYY3rFQw4S88IK7o/ELM5TYEPwJ34Ej +FFR+kDTrqYaAvU41O+ZyhUgyrwf5XZw7YxQJngP+/pfTeSiwqvGF6Q7WO03O8c= =JrQS -----END PGP SIGNATURE----- --n8884J15jRwcBTvu--