[libvirt] virsh migrate: sometimes command line cannot exit until manually press "ENTER" key

Chun Yan Liu cyliu at suse.com
Thu Aug 7 05:32:52 UTC 2014


Hi, List,

Do you meet the same problem? Host is kvm, doing: (e.g.)
#virsh migrate sles11 qemu+ssh://147.2.207.55/system --live --unsafe
password:
Sometimes, VM is already running on the target host and disappears
from source host, but the command line still hangs there, if pressing
"ENTER", it will exit.

I debugged the code, but found the result is weird. The code hangs at
tools/virsh-domain.c -> cmdMigrate ->vshWatchJob->poll():
poll() is trying to select pipe_fd, which is used to receive message from
doMigrate thread. In debugging, found that doMigrate finishes and at
the end it  does call safewrite() to write the retval ('0' or '1') to pipe_fd,
and the write is completed. But cmdMigrate poll() cannot get the event.
Then after pressing "ENTER" key, poll() can get the event and select
pipe_fd, then command line can exit.

Any ideas about the possible reason?

Thanks,
Chunyan





More information about the libvir-list mailing list