mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
net: Introduce announce timer
The 'announce timer' will be used by migration, and explicit requests for qemu to perform network announces. Based on the work by Germano Veit Michel <germano@redhat.com> and Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
4875bf1406
commit
50510ea2c2
6 changed files with 125 additions and 0 deletions
39
include/net/announce.h
Normal file
39
include/net/announce.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Self-announce facility
|
||||
* (c) 2017-2019 Red Hat, Inc.
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#ifndef QEMU_NET_ANNOUNCE_H
|
||||
#define QEMU_NET_ANNOUNCE_H
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/qapi-types-net.h"
|
||||
#include "qemu/timer.h"
|
||||
|
||||
struct AnnounceTimer {
|
||||
QEMUTimer *tm;
|
||||
AnnounceParameters params;
|
||||
QEMUClockType type;
|
||||
int round;
|
||||
};
|
||||
|
||||
/* Returns: update the timer to the next time point */
|
||||
int64_t qemu_announce_timer_step(AnnounceTimer *timer);
|
||||
|
||||
/* Delete the underlying timer */
|
||||
void qemu_announce_timer_del(AnnounceTimer *timer);
|
||||
|
||||
/*
|
||||
* Under BQL/main thread
|
||||
* Reset the timer to the given parameters/type/notifier.
|
||||
*/
|
||||
void qemu_announce_timer_reset(AnnounceTimer *timer,
|
||||
AnnounceParameters *params,
|
||||
QEMUClockType type,
|
||||
QEMUTimerCB *cb,
|
||||
void *opaque);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue