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

2014-08-08 Thread Chun Yan Liu


 On 8/8/2014 at 12:18 AM, in message
CAAfHSJvP1P20kBFD9ZgYy=0JVvG5oiS0eVCfGZc+k39=eha...@mail.gmail.com,
Shivaprasad bhat shivaprasadb...@gmail.com wrote: 
 On Thu, Aug 7, 2014 at 11:02 AM, Chun Yan Liu cy...@suse.com wrote: 
  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? 
  
 It is because, the authentication thread is independently waiting for the 
 password on virsh. I see that the virWatchJob interferes with authentication 
 thread and the password is never taken successfully. The virWatchJob 
 probably needs to wait till the authentication thread completes taking the 
 password after which it should start watching the job.

Agree. Although in my testing password can be taken successfully, and I
don't know how to explain why pressing ENTER then poll() can get
the pipe_fd event, I do think both authentication thread and main process
uses stdin might have some bad affect.

I'd like to adjust the code a little to move the authentication before poll(). 

Thanks!
 Moreover, I see 
 that --p2p 
 migration doesnt work at all when auto login is not configured. 
  
  
  Thanks, 
  Chunyan 
  
  
  -- 
  libvir-list mailing list 
  libvir-list@redhat.com 
  https://www.redhat.com/mailman/listinfo/libvir-list 
  
 Thanks, 
 Shiva 
  
  



--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2014-08-07 Thread Shivaprasad bhat
On Thu, Aug 7, 2014 at 11:02 AM, Chun Yan Liu cy...@suse.com wrote:
 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?

It is because, the authentication thread is independently waiting for the
password on virsh. I see that the virWatchJob interferes with authentication
thread and the password is never taken successfully. The virWatchJob
probably needs to wait till the authentication thread completes taking the
password after which it should start watching the job. Moreover, I see
that --p2p
migration doesnt work at all when auto login is not configured.


 Thanks,
 Chunyan


 --
 libvir-list mailing list
 libvir-list@redhat.com
 https://www.redhat.com/mailman/listinfo/libvir-list

Thanks,
Shiva

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


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

2014-08-06 Thread Chun Yan Liu
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


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list