[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/12] net: Add a network device specific self-annou
From: |
Vladislav Yasevich |
Subject: |
[Qemu-devel] [PATCH 04/12] net: Add a network device specific self-announcement ability |
Date: |
Wed, 24 May 2017 14:05:20 -0400 |
Some network devices have a capability to do self annoucements
(ex: virtio-new). Add infrustrcture that would allow devices
to expose this ability.
Signed-off-by: Vladislav Yasevich <address@hidden>
---
include/net/net.h | 2 ++
migration/savevm.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/include/net/net.h b/include/net/net.h
index 99b28d5..598f523 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -64,6 +64,7 @@ typedef int (SetVnetLE)(NetClientState *, bool);
typedef int (SetVnetBE)(NetClientState *, bool);
typedef struct SocketReadState SocketReadState;
typedef void (SocketReadStateFinalize)(SocketReadState *rs);
+typedef void (NetAnnounce)(NetClientState *);
typedef struct NetClientInfo {
NetClientDriver type;
@@ -84,6 +85,7 @@ typedef struct NetClientInfo {
SetVnetHdrLen *set_vnet_hdr_len;
SetVnetLE *set_vnet_le;
SetVnetBE *set_vnet_be;
+ NetAnnounce *announce;
} NetClientInfo;
struct NetClientState {
diff --git a/migration/savevm.c b/migration/savevm.c
index 555157a..a4097c9 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -207,9 +207,15 @@ static void qemu_announce_self_iter(NICState *nic, void
*opaque)
int len;
trace_qemu_announce_self_iter(qemu_ether_ntoa(&nic->conf->macaddr));
+
len = announce_self_create(buf, nic->conf->macaddr.a);
qemu_send_packet_raw(qemu_get_queue(nic), buf, len);
+
+ /* if the NIC provides it's own announcement support, use it as well */
+ if (nic->ncs->info->announce) {
+ nic->ncs->info->announce(nic->ncs);
+ }
}
static void qemu_announce_self_once(void *opaque)
--
2.7.4
- [Qemu-devel] [PATCH 02/12] migration: Introduce announcement timer, (continued)