I am using fence-virt.
When using a serial listener, fence_virtd does not receive a request
from VM which started after fence_virtd start.
Step 1) Start fence_virtd.
# fence_virtd -d5 -F
Step 2) And then start VM.
# virsh start srv-a1
Step 3) A request sent from the VM,
# fence_virt -D/dev/ttyS1 -oXXX
but fence_virtd not receive it.
Below, x3650f is a host, srv-XX is a VM.
[root@x3650f ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 (Santiago)
[root@x3650f ~]#
[root@x3650f ~]# rpm -qa | egrep '^libvirt|^qemu' | sort
libvirt-0.8.7-18.el6.x86_64
libvirt-client-0.8.7-18.el6.x86_64
libvirt-devel-0.8.7-18.el6.x86_64
libvirt-java-0.4.7-1.el6.noarch
libvirt-java-devel-0.4.7-1.el6.noarch
libvirt-python-0.8.7-18.el6.x86_64
libvirt-qpid-0.2.22-6.el6.x86_64
qemu-img-0.12.1.2-2.160.el6.x86_64
qemu-kvm-0.12.1.2-2.160.el6.x86_64
[root@x3650f ~]#
And I used following fence-virt.
http://fence-virt.git.sourceforge.net/git/gitweb.cgi?p=fence-virt/fence-virt;a=commit;h=53a2b293d12991beb6c2927f78586257bf f5173a
* Modified to send a SIGHUP to the primary thread from the secondary
thread detects the start of the VM, and
the primary thread is modified so as to select() the requests from
the VM which started.
* Also, when four VM(s) are started simultaneously,
poll() <in event_thread() at server/virt-serial.c> could not handle
all the boot.
Therefore, I revised it to call domainStarted()/domainStopped() in
myDomainEventCallback1().
/* Add 2 callbacks to prove this works with more than just one */
- memset(&dinfo, 0, sizeof (dinfo));
- dinfo.event = VIR_DOMAIN_EVENT_UNDEFINED;
callback1ret =
virConnectDomainEventRegister(dconn, myDomainEventCallback1,
- &dinfo, NULL);
+ arg, NULL);
if ((callback1ret == 0)) {
while (run) {
@@ -469,18 +471,6 @@
t_cb(t_timeout, t_opaque);
}
(2011/10/26 8:30), Lon Hohberger wrote:
> On 09/19/2011 04:32 PM, Lon Hohberger wrote:
>> On 09/13/2011 04:44 AM, Kazunori INOUE wrote:
>>
>>> I attached the patch for this problem.
>>>
>>> * Modified to send a SIGHUP to the primary thread from the secondary
>>> thread detects the start of the VM, and
>>> the primary thread is modified so as to select() the requests from
>>> the VM which started.
>>
>> That's certainly one way of doing it. I might have used
>> 'pthread_cond_singal'.
>
> I am sorry for the delay.
>
> I have a fix based on yours that uses a pipe to wake up select() rather
> than pthread_kill; I'll attach it here. This ends up being a bit lower
> impact, as well; it doesn't require changing the main program - only the
> serial/vmchannel plugin.
>
> Apart from that, the patch here is largely the same.
>
> Let me know what you think at your convenience.
>
> -- Lon
Hi, Lon
Thank you for your reply.
I tested this patch, and confirmed that the problem was solved.
(It was good also when four VM (s) was started simultaneously.)
Many thanks!
11-22-2011, 08:31 AM
Kazunori INOUE
fix handling of VIR_DOMAIN_EVENT_STARTED
(11.10.27 16:23), Kazunori INOUE wrote:
> (2011/10/26 8:30), Lon Hohberger wrote:
>> On 09/19/2011 04:32 PM, Lon Hohberger wrote:
>>> On 09/13/2011 04:44 AM, Kazunori INOUE wrote:
>>>
>>>> I attached the patch for this problem.
>>>>
>>>> * Modified to send a SIGHUP to the primary thread from the secondary
>>>> thread detects the start of the VM, and
>>>> the primary thread is modified so as to select() the requests from
>>>> the VM which started.
>>>
>>> That's certainly one way of doing it. I might have used
>>> 'pthread_cond_singal'.
>>
>> I am sorry for the delay.
>>
>> I have a fix based on yours that uses a pipe to wake up select() rather
>> than pthread_kill; I'll attach it here. This ends up being a bit lower
>> impact, as well; it doesn't require changing the main program - only the
>> serial/vmchannel plugin.
>>
>> Apart from that, the patch here is largely the same.
>>
>> Let me know what you think at your convenience.
>>
>> -- Lon
>
> Hi, Lon
>
> Thank you for your reply.
> I tested this patch, and confirmed that the problem was solved.
> (It was good also when four VM (s) was started simultaneously.)
>
> Many thanks!