From 944458b659fb348834cebbc15b9ad772be28f284 Mon Sep 17 00:00:00 2001 From: Dr. David Alan Gilbert Date: Thu, 20 Jun 2019 19:47:04 +0100 Subject: net/announce: Add optional ID Previously there was a single instance of the timer used by monitor triggered announces, that's OK, but when combined with the previous change that lets you have announces for subsets of interfaces it's a bit restrictive if you want to do different things to different interfaces. Add an 'id' field to the announce, and maintain a list of the timers based on id. This allows you to for example: a) Start an announce going on interface eth0 for a long time b) Start an announce going on interface eth1 for a long time c) Kill the announce on eth0 while leaving eth1 going. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- include/net/announce.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/net/announce.h') diff --git a/include/net/announce.h b/include/net/announce.h index 773470428b..3d90c83c23 100644 --- a/include/net/announce.h +++ b/include/net/announce.h @@ -22,8 +22,12 @@ struct AnnounceTimer { /* Returns: update the timer to the next time point */ int64_t qemu_announce_timer_step(AnnounceTimer *timer); -/* Delete the underlying timer and other data */ -void qemu_announce_timer_del(AnnounceTimer *timer); +/* + * Delete the underlying timer and other data + * If 'free_named' true and the timer is a named timer, then remove + * it from the list of named timers and free the AnnounceTimer itself. + */ +void qemu_announce_timer_del(AnnounceTimer *timer, bool free_named); /* * Under BQL/main thread -- cgit v1.2.3-55-g7522