aboutsummaryrefslogtreecommitdiff
path: root/net/colo.h
diff options
context:
space:
mode:
authorLukas Straub <lukasstraub2@web.de>2020-05-22 15:53:53 +0800
committerJason Wang <jasowang@redhat.com>2020-06-18 21:05:52 +0800
commit9c55fe94081dd15148428d32e60fd75ec2eb37ec (patch)
treef2ba3917f28c48f65334fa1957a38fd051b1ba7b /net/colo.h
parent2158fa1be7c1e76e2c25c32d75bb38e90cce0267 (diff)
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>
Diffstat (limited to 'net/colo.h')
-rw-r--r--net/colo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/colo.h b/net/colo.h
index 679314b1ca..573ab91785 100644
--- a/net/colo.h
+++ b/net/colo.h
@@ -102,5 +102,6 @@ bool connection_has_tracked(GHashTable *connection_track_table,
void connection_hashtable_reset(GHashTable *connection_track_table);
Packet *packet_new(const void *data, int size, int vnet_hdr_len);
void packet_destroy(void *opaque, void *user_data);
+void packet_destroy_partial(void *opaque, void *user_data);
#endif /* NET_COLO_H */