qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/12] net: Add a network device specific self-a


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH 04/12] net: Add a network device specific self-announcement ability
Date: Fri, 26 May 2017 12:17:46 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 2017年05月25日 02:05, Vladislav Yasevich wrote:
Some network devices have a capability to do self annoucements
(ex: virtio-new).

I thought you mean "virtio-net" here.

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)

Reviewed-by: Jason Wang <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]