Re: Using signals to communicate two Qemu processes

2008-12-23 Thread Avi Kivity

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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Using signals to communicate two Qemu processes

2008-12-13 Thread Anthony Liguori

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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Using signals to communicate two Qemu processes

2008-12-13 Thread Dor Laor

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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Using signals to communicate two Qemu processes

2008-12-12 Thread Passera, Pablo R
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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html