From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaJRP-0002IH-LR for qemu-devel@nongnu.org; Thu, 19 Feb 2009 19:40:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaJRN-0002HT-Bi for qemu-devel@nongnu.org; Thu, 19 Feb 2009 19:40:30 -0500 Received: from [199.232.76.173] (port=52469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaJRM-0002HK-VP for qemu-devel@nongnu.org; Thu, 19 Feb 2009 19:40:28 -0500 Received: from bsdimp.com ([199.45.160.85]:54472 helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LaJRM-0003FK-Dx for qemu-devel@nongnu.org; Thu, 19 Feb 2009 19:40:28 -0500 Date: Thu, 19 Feb 2009 17:36:55 -0700 (MST) Message-Id: <20090219.173655.107742401.imp@bsdimp.com> Subject: Re: [Qemu-devel] migration: adding migration to/from a file (v2) From: "M. Warner Losh" In-Reply-To: <499DF276.4080305@codemonkey.ws> References: <20090219202849.GE22319@shareable.org> <20090219.163601.29203982.imp@bsdimp.com> <499DF276.4080305@codemonkey.ws> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, anthony@codemonkey.ws Cc: uril@redhat.com In message: <499DF276.4080305@codemonkey.ws> Anthony Liguori writes: : M. Warner Losh wrote: : > In message: <20090219202849.GE22319@shareable.org> : > Jamie Lokier writes: : > : 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?". : > : > "Would a read or write operation block?" is a better way to look at : > the interface that select() or poll() provides. For a regular file, : > the answer is "no" since the writes are so fast and often : > asynchronous... : > : : Except when they aren't.. Right. That bit was added later, I think... My note was more of an explanation of how we got here, not that it was perfect and a good thing.. : The real issue is that read/write offers streaming semantics, not random : access. You cannot guarantee that a read is going to complete unless : you do read ahead. So the semantics would be something like pread(fd, : buf, X) = EAGAIN (kernel starts the operation for X), later, pread(fd, : buf, X) = OK. Sort of a weird interface. : : For write, it's even more bizarre because you can't "write-ahead". If : you're dealing with O_SYNC or O_DIRECT, there's simply no semantic that : makes sense. : : So fundamentally, read/write is a bad interface for random IO. Also agreed. : Regards, : : Anthony Liguori : : > Warner : > : > : > : : : :