From patchwork Wed May 24 18:05:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlad Yasevich X-Patchwork-Id: 766598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wY0hW5Gbwz9sPD for ; Thu, 25 May 2017 04:06:35 +1000 (AEST) Received: from localhost ([::1]:56191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDag5-0003qO-83 for incoming@patchwork.ozlabs.org; Wed, 24 May 2017 14:06:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDafQ-0003og-Tb for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDafP-0001Ki-SD for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35006) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dDafP-0001KR-Mn for qemu-devel@nongnu.org; Wed, 24 May 2017 14:05:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B905F448D83 for ; Wed, 24 May 2017 18:05:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B905F448D83 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vyasevic@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B905F448D83 Received: from flash.redhat.com (ovpn-116-215.phx2.redhat.com [10.3.116.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D84078C00; Wed, 24 May 2017 18:05:48 +0000 (UTC) From: Vladislav Yasevich To: qemu-devel@nongnu.org, dgilbert@redhat.com, quintela@redhat.com Date: Wed, 24 May 2017 14:05:20 -0400 Message-Id: <1495649128-10529-5-git-send-email-vyasevic@redhat.com> In-Reply-To: <1495649128-10529-1-git-send-email-vyasevic@redhat.com> References: <1495649128-10529-1-git-send-email-vyasevic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 24 May 2017 18:05:50 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 04/12] net: Add a network device specific self-announcement ability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: germano@redhat.com, lvivier@redhat.com, mst@redhat.com, jasowang@redhat.com, Vladislav Yasevich , armbru@redhat.com, kashyap@redhat.com, jdenemar@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Jason Wang --- 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)