qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/2] 2021-03-18 COLO proxy patches
@ 2021-03-18  4:11 Zhang Chen
  2021-03-18  4:11 ` [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet Zhang Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhang Chen @ 2021-03-18  4:11 UTC (permalink / raw)
  To: Jason Wang, qemu-dev; +Cc: Zhang Chen, Lukas Straub, Zhang Chen

Hi Jason, please merge this series to net queue.

Lukas Straub (2):
  net/colo-compare.c: Fix memory leak for non-tcp packet
  net/colo-compare.c: Optimize removal of secondary packet

 net/colo-compare.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.25.1



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

* [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet
  2021-03-18  4:11 [PULL 0/2] 2021-03-18 COLO proxy patches Zhang Chen
@ 2021-03-18  4:11 ` Zhang Chen
  2021-03-18  4:11 ` [PULL 2/2] net/colo-compare.c: Optimize removal of secondary packet Zhang Chen
  2021-03-19  7:00 ` [PULL 0/2] 2021-03-18 COLO proxy patches Jason Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Chen @ 2021-03-18  4:11 UTC (permalink / raw)
  To: Jason Wang, qemu-dev; +Cc: Zhang Chen, Lukas Straub, Zhang Chen

From: Lukas Straub <lukasstraub2@web.de>

Additional to removing the packet from the secondary queue,
we also need to free it.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
---
 net/colo-compare.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 84db4978ac..2e819ffedb 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -690,6 +690,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,
 
         if (result) {
             colo_release_primary_pkt(s, pkt);
+            packet_destroy(result->data, NULL);
             g_queue_remove(&conn->secondary_list, result->data);
         } else {
             /*
-- 
2.25.1



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

* [PULL 2/2] net/colo-compare.c: Optimize removal of secondary packet
  2021-03-18  4:11 [PULL 0/2] 2021-03-18 COLO proxy patches Zhang Chen
  2021-03-18  4:11 ` [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet Zhang Chen
@ 2021-03-18  4:11 ` Zhang Chen
  2021-03-19  7:00 ` [PULL 0/2] 2021-03-18 COLO proxy patches Jason Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Chen @ 2021-03-18  4:11 UTC (permalink / raw)
  To: Jason Wang, qemu-dev; +Cc: Zhang Chen, Lukas Straub, Zhang Chen

From: Lukas Straub <lukasstraub2@web.de>

g_queue_remove needs to look up the list entry first, but we
already have it as result and can remove it directly with
g_queue_delete_link.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
---
 net/colo-compare.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 2e819ffedb..9d1ad99941 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -691,7 +691,7 @@ static void colo_compare_packet(CompareState *s, Connection *conn,
         if (result) {
             colo_release_primary_pkt(s, pkt);
             packet_destroy(result->data, NULL);
-            g_queue_remove(&conn->secondary_list, result->data);
+            g_queue_delete_link(&conn->secondary_list, result);
         } else {
             /*
              * If one packet arrive late, the secondary_list or
-- 
2.25.1



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

* Re: [PULL 0/2] 2021-03-18 COLO proxy patches
  2021-03-18  4:11 [PULL 0/2] 2021-03-18 COLO proxy patches Zhang Chen
  2021-03-18  4:11 ` [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet Zhang Chen
  2021-03-18  4:11 ` [PULL 2/2] net/colo-compare.c: Optimize removal of secondary packet Zhang Chen
@ 2021-03-19  7:00 ` Jason Wang
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2021-03-19  7:00 UTC (permalink / raw)
  To: qemu-devel


在 2021/3/18 下午12:11, Zhang Chen 写道:
> Hi Jason, please merge this series to net queue.
>
> Lukas Straub (2):
>    net/colo-compare.c: Fix memory leak for non-tcp packet
>    net/colo-compare.c: Optimize removal of secondary packet
>
>   net/colo-compare.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)


Applied.

Thanks


>



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

end of thread, other threads:[~2021-03-19  7:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18  4:11 [PULL 0/2] 2021-03-18 COLO proxy patches Zhang Chen
2021-03-18  4:11 ` [PULL 1/2] net/colo-compare.c: Fix memory leak for non-tcp packet Zhang Chen
2021-03-18  4:11 ` [PULL 2/2] net/colo-compare.c: Optimize removal of secondary packet Zhang Chen
2021-03-19  7:00 ` [PULL 0/2] 2021-03-18 COLO proxy patches Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).