All of lore.kernel.org
 help / color / mirror / Atom feed
* Using signals to communicate two Qemu processes
@ 2008-12-12 18:23 Passera, Pablo R
  2008-12-13 22:21 ` Dor Laor
  2008-12-23 17:17 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Passera, Pablo R @ 2008-12-12 18:23 UTC (permalink / raw)
  To: kvm

Hi all,
        I am trying to communicate two VMs using a virtio driver. Once a data is moved to the driver I want to notify the other Qemu process that there is new data available in the buffer. I was thinking about using linux signals to synchronize both processes but when I register my SIGUSR1 handler in Qemu I am seeing an strange behavior. After starting the VM and Linux gets loaded, Qemu is receiving SIGUSR2 at a regular time period. Looking a little bit at the code I realize that signals are being used for other purposes in Qemu, however, SIGUSR1 is not used. Is it possible to use signals to synchronize these processes or should I think about using a different mechanism?

Thanks,

Pablo Pássera
Intel - Software Innovation Pathfinding Group
Cordoba - Argentina
Phone: +54 351 526 5611


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using signals to communicate two Qemu processes
  2008-12-12 18:23 Using signals to communicate two Qemu processes Passera, Pablo R
@ 2008-12-13 22:21 ` Dor Laor
  2008-12-13 23:43   ` Anthony Liguori
  2008-12-23 17:17 ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Dor Laor @ 2008-12-13 22:21 UTC (permalink / raw)
  To: Passera, Pablo R; +Cc: kvm

Passera, Pablo R wrote:
> Hi all,
>         I am trying to communicate two VMs using a virtio driver. Once a data is moved to the driver I want to notify the other Qemu process that there is new data available in the buffer. I was thinking about using linux signals to synchronize both processes but when I register my SIGUSR1 handler in Qemu I am seeing an strange behavior. After starting the VM and Linux gets loaded, Qemu is receiving SIGUSR2 at a regular time period. Looking a little bit at the code I realize that signals are being used for other purposes in Qemu, however, SIGUSR1 is not used. Is it possible to use signals to synchronize these processes or should I think about using a different mechanism?
>
>   
SIGUSR2 is used as aio completion signal. You can use SIGUSR1 but you 
need to know what you're doing (some threads block signals).
Better fit would be a pipe.

The vcpu
> Thanks,
>
> Pablo Pássera
> Intel - Software Innovation Pathfinding Group
> Cordoba - Argentina
> Phone: +54 351 526 5611
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using signals to communicate two Qemu processes
  2008-12-13 22:21 ` Dor Laor
@ 2008-12-13 23:43   ` Anthony Liguori
  0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-12-13 23:43 UTC (permalink / raw)
  To: dlaor; +Cc: Passera, Pablo R, kvm

Dor Laor wrote:
> Passera, Pablo R wrote:
>> Hi all,
>>         I am trying to communicate two VMs using a virtio driver. 
>> Once a data is moved to the driver I want to notify the other Qemu 
>> process that there is new data available in the buffer. I was 
>> thinking about using linux signals to synchronize both processes but 
>> when I register my SIGUSR1 handler in Qemu I am seeing an strange 
>> behavior. After starting the VM and Linux gets loaded, Qemu is 
>> receiving SIGUSR2 at a regular time period. Looking a little bit at 
>> the code I realize that signals are being used for other purposes in 
>> Qemu, however, SIGUSR1 is not used. Is it possible to use signals to 
>> synchronize these processes or should I think about using a different 
>> mechanism?
>>
>>   
> SIGUSR2 is used as aio completion signal. You can use SIGUSR1 but you 
> need to know what you're doing (some threads block signals).
> Better fit would be a pipe.

Or even a unix domain socket.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using signals to communicate two Qemu processes
  2008-12-12 18:23 Using signals to communicate two Qemu processes Passera, Pablo R
  2008-12-13 22:21 ` Dor Laor
@ 2008-12-23 17:17 ` Avi Kivity
  1 sibling, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2008-12-23 17:17 UTC (permalink / raw)
  To: Passera, Pablo R; +Cc: kvm

Passera, Pablo R wrote:
> Hi all,
>         I am trying to communicate two VMs using a virtio driver. Once a data is moved to the driver I want to notify the other Qemu process that there is new data available in the buffer. I was thinking about using linux signals to synchronize both processes but when I register my SIGUSR1 handler in Qemu I am seeing an strange behavior. After starting the VM and Linux gets loaded, Qemu is receiving SIGUSR2 at a regular time period. Looking a little bit at the code I realize that signals are being used for other purposes in Qemu, however, SIGUSR1 is not used. Is it possible to use signals to synchronize these processes or should I think about using a different mechanism?
>   

Signals are messy.  I recommend using a unix-domain socket for this.

It should be possible to use signals, however you should take care to 
mask the signal in all threads except the once you want to be the handler.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-12-23 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-12 18:23 Using signals to communicate two Qemu processes Passera, Pablo R
2008-12-13 22:21 ` Dor Laor
2008-12-13 23:43   ` Anthony Liguori
2008-12-23 17:17 ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.