From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0SXV-0007Gp-4k for qemu-devel@nongnu.org; Wed, 12 Nov 2008 22:06:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0SXU-0007GJ-5P for qemu-devel@nongnu.org; Wed, 12 Nov 2008 22:06:36 -0500 Received: from [199.232.76.173] (port=43915 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0SXU-0007GG-2r for qemu-devel@nongnu.org; Wed, 12 Nov 2008 22:06:36 -0500 Received: from mail-gx0-f28.google.com ([209.85.217.28]:51294) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0SXU-0000jU-2O for qemu-devel@nongnu.org; Wed, 12 Nov 2008 22:06:36 -0500 Received: by gxk9 with SMTP id 9so24517gxk.10 for ; Wed, 12 Nov 2008 19:06:35 -0800 (PST) Message-ID: <491B99B8.9010504@codemonkey.ws> Date: Wed, 12 Nov 2008 21:06:32 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] add file: migration support References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 Charles Duffy wrote: > This patch adds support for migration to and from file: targets, moves > common helpers between exec: and file: use cases from migration-exec.c > to migration.c, and adds a qemu_fdopen() helper parallel to qemu_fopen(). > > Signed-off-by: Charles Duffy > diff --git a/.gitignore b/.gitignore > index e70ebab..8e28325 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -30,4 +30,4 @@ qemu-nbd.8 > *.tp > *.vr > *.d > - > +*.o > Please keep this sort of stuff separate from a general patch. > + s->fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); > + if (s->fd == -1) { > + perror("Unable to open migration target"); > + goto err_after_alloc; > + } > + > + if (fcntl(s->fd, F_SETFD, O_NONBLOCK) == -1) { > + dprintf("Unable to set nonblocking mode on file descriptor\n"); > + goto err_after_open; > + } > Did you mean F_SETFL? At any rate, this doesn't do what you think it does. O_NONBLOCK still blocks with a file. To implement a proper file: migration protocol, you have to use something like posix-aio to write to the file asychronously. You can observe the problem here by setting the migration data limit to something very, very high (like 10GB). That will cause the VM to become unresponsive until all the data is on disk which is certainly not live migration. Regards, Anthony Liguori