
Erkan Unal wrote:
Hi,
I am using libvirt for qemu/kvm. I have following questions in terms of save and restore (Version 0.6.2):
1) As I checked the libvirt code, restore command is asynchronous. There is a macro called VIR_EXEC_NONBLOCK but there is no macro called VIR_EXEC_BLOCK. Is it possible to execute the restore in blocking mode so that I can measure the whole restore time?
Hm, the entire thing is *meant* to be synchronous. That being said, I'm not exactly sure how we are achieving that (and maybe we aren't achieving it at all). It used to be the case that the monitor wouldn't return until the migration was finished, but that was changed long ago. I'd have to look into it again; if it is indeed the case that it is not synchronous, then we'll probably have to change it to loop on "info migrate" and wait for the migration to complete in order to make it synchronous. That may also explain your errors below.
2) I tried to measure the time spent to save the VM. I am executing save command and getting a timing. However when I execute the following operations in order I got an error right after script issues the restore operation (No delay between them):
"save->restore->save"
... the error is:
20:19:02.478: error : internal error Unable to open monitor path /dev/pts/3 libvir: QEMU error : internal error Unable to open monitor path /dev/pts/3 20:19:02.478: error : internal error unable to start guest: char device redirected to /dev/pts/3 inet_listen: bind(ipv4,127.0.0.1,5912): Address already in use inet_listen: FAILED
libvir: QEMU error : internal error unable to start guest: char device redirected to /dev/pts/3 inet_listen: bind(ipv4,127.0.0.1,5912): Address already in use inet_listen: FAILED 20:19:02.482: error : operation failed: failed to start VM libvir: QEMU error : operation failed: failed to start VM error: Failed to restore domain from /path/to/the/save/file error: operation failed: failed to start VM
(You can find the detailed error report in the attachement when LIBVIRT_DEBUG flag is 1)
I think that some of the cleanup is non-blocking which are cleanup of pty device and vncserver. However, I am not sure if destroying the qemu process is asynchronous??
Destroying the qemu process is definitely synchronous. -- Chris Lalancette