|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH] add file: migration support |
Date: | Wed, 12 Nov 2008 21:06:32 -0600 |
User-agent: | Thunderbird 2.0.0.17 (X11/20080925) |
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 <address@hidden> 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
[Prev in Thread] | Current Thread | [Next in Thread] |