mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
net/colo-compare.c: Fix deadlock in compare_chr_send
The chr_out chardev is connected to a filter-redirector running in the main loop. qemu_chr_fe_write_all might block here in compare_chr_send if the (socket-)buffer is full. If another filter-redirector in the main loop want's to send data to chr_pri_in it might also block if the buffer is full. This leads to a deadlock because both event loops get blocked. Fix this by converting compare_chr_send to a coroutine and putting the packets in a send queue. Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Tested-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
2158fa1be7
commit
9c55fe9408
3 changed files with 162 additions and 51 deletions
|
@ -185,6 +185,13 @@ void packet_destroy(void *opaque, void *user_data)
|
|||
g_slice_free(Packet, pkt);
|
||||
}
|
||||
|
||||
void packet_destroy_partial(void *opaque, void *user_data)
|
||||
{
|
||||
Packet *pkt = opaque;
|
||||
|
||||
g_slice_free(Packet, pkt);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear hashtable, stop this hash growing really huge
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue