From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaFVv-0006sX-8w for qemu-devel@nongnu.org; Thu, 19 Feb 2009 15:28:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaFVs-0006rv-PW for qemu-devel@nongnu.org; Thu, 19 Feb 2009 15:28:53 -0500 Received: from [199.232.76.173] (port=41821 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaFVs-0006rp-H9 for qemu-devel@nongnu.org; Thu, 19 Feb 2009 15:28:52 -0500 Received: from mail2.shareable.org ([80.68.89.115]:44718) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LaFVs-0005aV-1u for qemu-devel@nongnu.org; Thu, 19 Feb 2009 15:28:52 -0500 Date: Thu, 19 Feb 2009 20:28:49 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] migration: adding migration to/from a file (v2) Message-ID: <20090219202849.GE22319@shareable.org> References: <499D4654.9000305@redhat.com> <499D652D.60803@codemonkey.ws> <499D8564.1070007@redhat.com> <499D8E05.2060207@codemonkey.ws> <499DADBB.4080008@redhat.com> <499DBB8E.6030705@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <499DBB8E.6030705@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Anthony Liguori wrote: > >Sure looks like a bug. > I wish! It's Unix suckiness. Windows is the same. It's a more of a conceptual problem than it looks, not merely an API bug. It comes down to "what would 'readable' and 'writable' mean on a file?". For a pipe or socket, readability depends on whether it's connected and some data has been received from another process. That's well-defined. For a file, readability depends on the OS knowing in advance that you _want_ to read the file so it can issue a request to the underlying device - but it doesn't know you want to read the file until you call read() at a specific offset and length, so readability is not well-defined. Writability is similar but also depends on dynamic memory availability. That's why AIO is more fundemantally required for files than streams. AIO is how you tell the OS "I'm going to want to read or write this bit". -- Jamie