From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLS-0002DE-Pt for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWMLN-0008OZ-BF for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:14 -0400 Received: from [59.151.112.132] (port=47516 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLN-00083l-0y for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:09 -0400 From: Yang Hongyang Date: Tue, 23 Sep 2014 17:23:52 +0800 Message-ID: <1411464235-5653-21-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> References: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH v2 20/23] COLO nic: implement colo nic device interface support_colo() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: GuiJianfeng@cn.fujitsu.com, yunhong.jiang@intel.com, eddie.dong@intel.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, yanghy@cn.fujitsu.com implement colo nic device interface support_colo() Signed-off-by: Yang Hongyang --- net/colo-nic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/colo-nic.c b/net/colo-nic.c index 2f7ca23..7255a48 100644 --- a/net/colo-nic.c +++ b/net/colo-nic.c @@ -21,11 +21,17 @@ typedef struct nic_device { QTAILQ_HEAD(, nic_device) nic_devices = QTAILQ_HEAD_INITIALIZER(nic_devices); +static bool nic_support_colo(NetClientState *nc) +{ + return nc && nc->colo_script[0] && nc->colo_nicname[0]; +} + void colo_add_nic_devices(NetClientState *nc) { struct nic_device *nic = g_malloc0(sizeof(*nic)); - /* TODO: init colo function pointers */ + nic->support_colo = nic_support_colo; + /* * TODO * only support "-netdev tap,colo_scripte..." options -- 1.9.1