Re: [PATCH 08/10] MCE: Relay UCR MCE to guest

Paolo Bonzini
2010-10-21T07:41:38Z

On 10/21/2010 12:03 AM, Anthony Liguori wrote:
>>
>> The timeout of qemu_kvm_eat_signal is always zero.
>
> So then qemu_kvm_eat_signal purely polls and it will happily keep
> polling as long as there is a signal pending.
>
> So what's the point of doing a sigtimedwait() and dropping qemu_mutex?

I agree that keeping the qemu_mutex makes sense if you remove the
timeout argument (which I even have a patch for, as part of my Win32
iothread series). Until there is the theoretical possibility of
suspending the process, qemu_kvm_eat_signal should drop the mutex.

> Why not just check sigpending in a loop?

Because sigtimedwait eats the signal, unlike sigpending (and sigsuspend).