* [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list
@ 2017-10-23 19:27 zhiyong.wu
2017-10-23 11:25 ` Darren Kenny
0 siblings, 1 reply; 5+ messages in thread
From: zhiyong.wu @ 2017-10-23 19:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Zhi Yong Wu
From: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
When hash table is created with g_hash_table_new_full(),
the free function has been registered. So it isn't necessary
since g_hash_table_remove_all() will call connection_destroy()
for each connection struct automatically.
Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
---
net/colo.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/colo.c b/net/colo.c
index 28ce7c8..668abb7 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -197,12 +197,6 @@ Connection *connection_get(GHashTable *connection_track_table,
trace_colo_proxy_main("colo proxy connection hashtable full,"
" clear it");
connection_hashtable_reset(connection_track_table);
- /*
- * clear the conn_list
- */
- while (!g_queue_is_empty(conn_list)) {
- connection_destroy(g_queue_pop_head(conn_list));
- }
}
g_hash_table_insert(connection_track_table, new_key, conn);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list
2017-10-23 19:27 [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list zhiyong.wu
@ 2017-10-23 11:25 ` Darren Kenny
0 siblings, 0 replies; 5+ messages in thread
From: Darren Kenny @ 2017-10-23 11:25 UTC (permalink / raw)
To: zhiyong.wu; +Cc: qemu-devel
That's consistent with the documented behaviour of
g_hash_table_remove_all().
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Thanks,
Darren.
On Tue, Oct 24, 2017 at 03:27:59AM +0800, zhiyong.wu@ucloud.cn wrote:
>From: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
>
>When hash table is created with g_hash_table_new_full(),
>the free function has been registered. So it isn't necessary
>since g_hash_table_remove_all() will call connection_destroy()
>for each connection struct automatically.
>
>Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
>---
> net/colo.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)
>
>diff --git a/net/colo.c b/net/colo.c
>index 28ce7c8..668abb7 100644
>--- a/net/colo.c
>+++ b/net/colo.c
>@@ -197,12 +197,6 @@ Connection *connection_get(GHashTable *connection_track_table,
> trace_colo_proxy_main("colo proxy connection hashtable full,"
> " clear it");
> connection_hashtable_reset(connection_track_table);
>- /*
>- * clear the conn_list
>- */
>- while (!g_queue_is_empty(conn_list)) {
>- connection_destroy(g_queue_pop_head(conn_list));
>- }
> }
>
> g_hash_table_insert(connection_track_table, new_key, conn);
>--
>1.7.1
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list
@ 2017-10-23 19:29 Zhi Yong Wu
0 siblings, 0 replies; 5+ messages in thread
From: Zhi Yong Wu @ 2017-10-23 19:29 UTC (permalink / raw)
To: qemu-devel; +Cc: zhiyong.wu
When hash table is created with g_hash_table_new_full(),
the free function has been registered. So it isn't necessary
since g_hash_table_remove_all() will call connection_destroy()
for each connection struct automatically.
Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
---
net/colo.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/colo.c b/net/colo.c
index 28ce7c8..668abb7 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -197,12 +197,6 @@ Connection *connection_get(GHashTable *connection_track_table,
trace_colo_proxy_main("colo proxy connection hashtable full,"
" clear it");
connection_hashtable_reset(connection_track_table);
- /*
- * clear the conn_list
- */
- while (!g_queue_is_empty(conn_list)) {
- connection_destroy(g_queue_pop_head(conn_list));
- }
}
g_hash_table_insert(connection_track_table, new_key, conn);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list
@ 2017-10-23 19:26 zhiyong.wu
0 siblings, 0 replies; 5+ messages in thread
From: zhiyong.wu @ 2017-10-23 19:26 UTC (permalink / raw)
To: qemu-devel; +Cc: Zhi Yong Wu
From: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
When hash table is created with g_hash_table_new_full(),
the free function has been registered. So it isn't necessary
since g_hash_table_remove_all() will call connection_destroy()
for each connection struct automatically.
Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
---
net/colo.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/colo.c b/net/colo.c
index 28ce7c8..668abb7 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -197,12 +197,6 @@ Connection *connection_get(GHashTable *connection_track_table,
trace_colo_proxy_main("colo proxy connection hashtable full,"
" clear it");
connection_hashtable_reset(connection_track_table);
- /*
- * clear the conn_list
- */
- while (!g_queue_is_empty(conn_list)) {
- connection_destroy(g_queue_pop_head(conn_list));
- }
}
g_hash_table_insert(connection_track_table, new_key, conn);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list
@ 2017-10-23 10:40 Zhi Yong Wu
0 siblings, 0 replies; 5+ messages in thread
From: Zhi Yong Wu @ 2017-10-23 10:40 UTC (permalink / raw)
To: qemu-devel; +Cc: wuzhiyong
From 4439e5853f98fb4b32f346245a46414d3c7e2221 Mon Sep 17 00:00:00 2001
From: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
Date: Tue, 24 Oct 2017 03:19:00 +0800
Subject: [PATCH] COLO: remove the operation to clear connection list
When hash table is created with g_hash_table_new_full(),
the free function has been registered. So it isn't necessary
since g_hash_table_remove_all() will call connection_destroy()
for each connection struct automatically.
Signed-off-by: Zhi Yong Wu <zhiyong.wu@ucloud.cn>
---
net/colo.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/net/colo.c b/net/colo.c
index 28ce7c8..668abb7 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -197,12 +197,6 @@ Connection *connection_get(GHashTable *connection_track_table,
trace_colo_proxy_main("colo proxy connection hashtable full,"
" clear it");
connection_hashtable_reset(connection_track_table);
- /*
- * clear the conn_list
- */
- while (!g_queue_is_empty(conn_list)) {
- connection_destroy(g_queue_pop_head(conn_list));
- }
}
g_hash_table_insert(connection_track_table, new_key, conn);
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-23 11:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 19:27 [Qemu-devel] [PATCH] COLO: remove the operation to clear connection list zhiyong.wu
2017-10-23 11:25 ` Darren Kenny
-- strict thread matches above, loose matches on Subject: below --
2017-10-23 19:29 Zhi Yong Wu
2017-10-23 19:26 zhiyong.wu
2017-10-23 10:40 Zhi Yong Wu
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).