From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040014; cv=none; d=zoho.com; s=zohoarc; b=JUqTbcRyiQWEMLtIu2UdCCoIp6Ajb8U75BlLRn3qxIGmeSp8gmtlAgCtd9sbDGSmMyZzVsrq9IZkSve9AXwgLCn1d7oJznH6lU1gz2xtlsEEcvA1QhrG4EKUekEfXv15QQX+5Yz97pzC8D28O+tsccWtoau6jarVjclvyflsVok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040014; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=C/h1M4bKmf5qDVgJtFOZq030KZEqGdr6wMgt71LKb6g=; b=aGSXJlXSXqf/jqhwMtTTaX1geh8ZKvE0TbzZsMHD5kPUx9MCTULwXFNDbnpEBsV18HzyDZiVPbHfF3SHqDhpcHcHKJmPJ+eRCOXAJvQ+M0b40caRQt2Q5G3QFc5m1sWUQVQ3Q2X7jdWPisVWfQxoq7eS4xRnsilQWqUzObQ0JJQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156204001424946.66435932659226; Mon, 1 Jul 2019 21:00:14 -0700 (PDT) Received: from localhost ([::1]:48320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi9xd-0002PP-6B for importer@patchew.org; Tue, 02 Jul 2019 00:00:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50382) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aG-0004jL-O7 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aE-0003dA-RO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aD-0003V7-L7 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 C5A1FC05681F; Tue, 2 Jul 2019 02:31:35 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33702BA4D; Tue, 2 Jul 2019 02:31:33 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:13 +0800 Message-Id: <1562034689-6539-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.32]); Tue, 02 Jul 2019 02:31:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/17] MAINTAINERS: Add qemu-bridge-helper.c to "Network device backends" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Jason Wang --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8206fc5..c7b0c2c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1934,6 +1934,7 @@ M: Jason Wang S: Maintained F: net/ F: include/net/ +F: qemu-bridge-helper.c T: git https://github.com/jasowang/qemu.git net F: qapi/net.json =20 --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040343; cv=none; d=zoho.com; s=zohoarc; b=UJ3gyAxkAEaDwBBI8cd5pir8gv/L/a0yHvC4fpTI2vkWr8J2etAgMzwOI9HSUuUz3lPmFVc0zPc4oPPMLWqMygS8g29RsazM834CGoLayuVmVndYt6PqGEue1psJkMLpXoJkLYXsPYDQFrHB1pNw7Bgv8kA8l97MNL38PXsWm1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040343; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LcQvXnRlBRfaYnILyru9nl3NlgbU5BIQ+I+BsJ1dxCs=; b=jezF+uFlIecDJMp8EFgVIvOvAhSYMgKtzkE2OyG/xdUYlodBrRck0eGshvJ4GR7KN9b9RFSek+Swad0xkgaZpAqc1lAnDGomzcLVvrQkIHVu+80HWVk4tlxDsp0ugX8F7z/CuH3ltOmqn9zTMvDh2o/E/UO2XNiPQ4ChXvtAoUk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040343267790.7332958723999; Mon, 1 Jul 2019 21:05:43 -0700 (PDT) Received: from localhost ([::1]:48426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA2r-0006XP-ME for importer@patchew.org; Tue, 02 Jul 2019 00:05:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50431) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aH-0004mB-U4 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aG-0003eE-LO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aE-0003Vt-Qy for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 06D2D30860A3; Tue, 2 Jul 2019 02:31:38 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65D97BA53; Tue, 2 Jul 2019 02:31:36 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:14 +0800 Message-Id: <1562034689-6539-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.44]); Tue, 02 Jul 2019 02:31:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/17] qemu-bridge-helper: Document known shortcomings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Jason Wang --- qemu-bridge-helper.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c index f9940de..95624bc 100644 --- a/qemu-bridge-helper.c +++ b/qemu-bridge-helper.c @@ -10,7 +10,17 @@ * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. - * + */ + +/* + * Known shortcomings: + * - There is no manual page + * - The syntax of the ACL file is not documented anywhere + * - parse_acl_file() doesn't report fopen() failure properly, fails + * to check ferror() after fgets() failure, arbitrarily truncates + * long lines, handles whitespace inconsistently, error messages + * don't point to the offending file and line, errors in included + * files are reported, but otherwise ignored, ... */ =20 #include "qemu/osdep.h" --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040602; cv=none; d=zoho.com; s=zohoarc; b=Biqk5YO5ZLvugA/o/ntOPZniv3iRNdEgvSRczQFQUlm27S6X52WsN2HqTs3DmlQBK4pTYU4eKjpI555Nmh0uZtMLDdyDLUnyq4ysXITNK7Igkw2C8kYrlaMHeN+v7tuwALjxT8WmEGryLUqMapAErhHSbzFMDXZNOZUUkQqEgc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nUtbBdmEy4ztdGF6u/lN8qL76xCwOYyAXQsd4qGqqSw=; b=Q+xOdJIFOEJhF2Zu855INts3UZRh6Cxhw3nMUOplW5ZKEKKt2rDmBkUYeusw/mJWPAGKQOMuykW5At2OBPXg7eSuArfr2l0zNon8BWoT2sfnN/qAOGnXgeGxApzvpp4hztuZA9ChcPOryZ4wPihcF6OkejOUTH3mKH/qGJ3eS+8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040602188331.8066200570918; Mon, 1 Jul 2019 21:10:02 -0700 (PDT) Received: from localhost ([::1]:48476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA7C-0003ER-Fs for importer@patchew.org; Tue, 02 Jul 2019 00:09:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50374) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aG-0004jE-Mt for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aE-0003cv-Rl for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52574) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aD-0003YI-6o for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 59DC130860B7; Tue, 2 Jul 2019 02:31:40 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BA34BA4D; Tue, 2 Jul 2019 02:31:38 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:15 +0800 Message-Id: <1562034689-6539-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 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.44]); Tue, 02 Jul 2019 02:31:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/17] ftgmac100: do not link to netdev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater qdev_set_nic_properties() is already used in the Aspeed SoC level to bind the ftgmac100 device to the netdev. This is fixing support for multiple net devices. Signed-off-by: C=C3=A9dric Le Goater Signed-off-by: Jason Wang --- hw/net/ftgmac100.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index eb76047..d2cded5 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -1017,8 +1017,6 @@ static void ftgmac100_realize(DeviceState *dev, Error= **errp) sysbus_init_irq(sbd, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); =20 - s->conf.peers.ncs[0] =3D nd_table[0].netdev; - s->nic =3D qemu_new_nic(&net_ftgmac100_info, &s->conf, object_get_typename(OBJECT(dev)), DEVICE(dev)->i= d, s); --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562039831; cv=none; d=zoho.com; s=zohoarc; b=W/dfUMkxSel01sUjeV++CP3ymx2ss/ELUh3UG7p9Z31LDl9sqU34eVAyfkSxisVEJ7YJ8zDUN9fdZDN+L2Pkp05jSn39WVG41xjf5waL5je9sdR0MhSyPme7qzXsHilFd+qxn7cRyNpEeLf2CSVJi430J1t1d3Bu6Layk81wpHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562039831; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nXTpXfwv+wKzovsejH+t9GpgQCu4LjJqofJzo6FL8NE=; b=j7OTgN06M7geUrlfmAqJGY2QYLTAQWujIrOvP7jdKiJ/lYo9Fl3r9vZFWIEZGBZW0LAkZY/Socosi6F043kZrdf8qfBBMIzW5P9kf+BCTTH4uuq821W/yL3YceGii59Y19Bwxw3DTSN5DdVpOx/yq7xNtWZWg9YmajMbYoq5TQY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562039831663290.0598879422149; Mon, 1 Jul 2019 20:57:11 -0700 (PDT) Received: from localhost ([::1]:48296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi9ul-0007VJ-Ie for importer@patchew.org; Mon, 01 Jul 2019 23:57:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50372) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aG-0004jA-MO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aF-0003dM-0t for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45334) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aE-0003af-QU for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 9693430872EA; Tue, 2 Jul 2019 02:31:42 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA25260C43; Tue, 2 Jul 2019 02:31:40 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:16 +0800 Message-Id: <1562034689-6539-5-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.47]); Tue, 02 Jul 2019 02:31:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/17] net: fix assertion failure when ipv6-prefixlen is not a number X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella If 'ipv6-prefixlen' is not a number, the current behaviour produces an assertion failure: $ qemu-system-x86_64 -net user,ipv6-net=3Dfeca::0/a qemu-system-x86_64: qemu/util/qemu-option.c:1175: qemu_opts_foreach: Assertion `!errp || !*errp' failed. Aborted (core dumped) This patch fixes it, jumping to the end of the function when 'ipv6-prefixlen' is not a number, and printing the more friendly message: $ qemu-system-x86_64 -net user,ipv6-net=3Dfeca::0/a qemu-system-x86_64: Parameter 'ipv6-prefixlen' expects a number Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- net/net.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/net.c b/net/net.c index 3e65c93..d21c2c7 100644 --- a/net/net.c +++ b/net/net.c @@ -1136,11 +1136,11 @@ static int net_client_init(QemuOpts *opts, bool is_= netdev, Error **errp) =20 if (err) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "ipv6-prefix", "a number"); - } else { - qemu_opt_set_number(opts, "ipv6-prefixlen", len, - &error_abort); + "ipv6-prefixlen", "a number"); + goto out; } + + qemu_opt_set_number(opts, "ipv6-prefixlen", len, &error_ab= ort); } qemu_opt_unset(opts, "ipv6-net"); } @@ -1162,6 +1162,7 @@ static int net_client_init(QemuOpts *opts, bool is_ne= tdev, Error **errp) qapi_free_NetLegacy(object); } =20 +out: error_propagate(errp, err); visit_free(v); return ret; --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040493; cv=none; d=zoho.com; s=zohoarc; b=IcYJIdXni14rB5F+EiGiDDDckxHyqdcLwVIYHfpB9dKmpXd+KsXqLRxFMRCaiZlybDve56+W9TK3kMrqlXP8bZpC9NpqHJrKZr8SKhCOiLy091WuM4bvGgqeINJkW9x6Qk1eD/7LtvId7sFEssi5uT65wchwIAitly4w/gCAcBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040493; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=st8i3Bs7dDUZ5EO0oq3xmIbK4QV3UY2KOu+YZrF4TDo=; b=NwUrhYk0OaRuK79UFlkGWrc4LcWDm+jOwj9WJv/m8rtITx5Xy1x8oHZb9xW33CU7BvrCTYmuXp/LVZHNdECIhNcaEFM1aEjYyDS1m/8lalSuUw+cn9Hnmi+ZDSNFL6uAOKBTJxL4kuRt7jW6Oj3Rkg+BL+bk002JX6UG8VQytbg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040493930105.26403476343467; Mon, 1 Jul 2019 21:08:13 -0700 (PDT) Received: from localhost ([::1]:48460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA5R-0001Vi-Pm for importer@patchew.org; Tue, 02 Jul 2019 00:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50432) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aH-0004mF-Ua for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aG-0003e7-MM for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45792) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aE-0003az-Pf for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31: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 AA1B1C0495A1; Tue, 2 Jul 2019 02:31:44 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 170E560C43; Tue, 2 Jul 2019 02:31:42 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:17 +0800 Message-Id: <1562034689-6539-6-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.31]); Tue, 02 Jul 2019 02:31:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/17] net: avoid using variable length array in net_client_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella net_client_init() uses a variable length array to store the prefix of 'ipv6-net' parameter (e.g. if ipv6-net=3Dfec0::0/64, the prefix is 'fec0::0'). This patch introduces g_strsplit() to split the 'ipv6-net' parameter, so we can remove the variable length array. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- net/net.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/net/net.c b/net/net.c index d21c2c7..76ba0b7 100644 --- a/net/net.c +++ b/net/net.c @@ -1105,6 +1105,7 @@ static void show_netdevs(void) =20 static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp) { + gchar **substrings =3D NULL; void *object =3D NULL; Error *err =3D NULL; int ret =3D -1; @@ -1120,28 +1121,33 @@ static int net_client_init(QemuOpts *opts, bool is_= netdev, Error **errp) const char *ip6_net =3D qemu_opt_get(opts, "ipv6-net"); =20 if (ip6_net) { - char buf[strlen(ip6_net) + 1]; + char *prefix_addr; + unsigned long prefix_len =3D 64; /* Default 64bit prefix lengt= h. */ + + substrings =3D g_strsplit(ip6_net, "/", 2); + if (!substrings || !substrings[0]) { + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "ipv6-net", + "a valid IPv6 prefix"); + goto out; + } =20 - if (get_str_sep(buf, sizeof(buf), &ip6_net, '/') < 0) { - /* Default 64bit prefix length. */ - qemu_opt_set(opts, "ipv6-prefix", ip6_net, &error_abort); - qemu_opt_set_number(opts, "ipv6-prefixlen", 64, &error_abo= rt); - } else { + prefix_addr =3D substrings[0]; + + if (substrings[1]) { /* User-specified prefix length. */ - unsigned long len; int err; =20 - qemu_opt_set(opts, "ipv6-prefix", buf, &error_abort); - err =3D qemu_strtoul(ip6_net, NULL, 10, &len); - + err =3D qemu_strtoul(substrings[1], NULL, 10, &prefix_len); if (err) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "ipv6-prefixlen", "a number"); goto out; } - - qemu_opt_set_number(opts, "ipv6-prefixlen", len, &error_ab= ort); } + + qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort); + qemu_opt_set_number(opts, "ipv6-prefixlen", prefix_len, + &error_abort); qemu_opt_unset(opts, "ipv6-net"); } } @@ -1164,6 +1170,7 @@ static int net_client_init(QemuOpts *opts, bool is_ne= tdev, Error **errp) =20 out: error_propagate(errp, err); + g_strfreev(substrings); visit_free(v); return ret; } --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562038788; cv=none; d=zoho.com; s=zohoarc; b=VdHd9VYB1iLJlBsMAJVExgKMI6ed5x2Un5GKuoQOZ3tGt0sqzJSQnxBrPOmwfHPpD2ABr5R0leWv1ArvGpvBuY1xSty437741CGBlL9z/utVktPDJzXn99N2FnV03i/aKup9QhOQcmOy2y1J74d+QbLpHq+yyHs1pSfZEMEYN3Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562038788; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cpzfmInMpUECOnuFr8NNwDC8hu/4n0cMpWPmMiHgZzk=; b=OIX5w92jYsVFJQasnPjRgvLXmvo/fbW3xkpsF8PiALjWly3SiWAoArL+a3n/2RAwtvirZxqL9P6hntvoRUMutYk69ha8YhPb1CgWm9aar1TyIh1KYeDLVscgAbocdI5sfE16i0OLNI8cq7qcRa19Gcyg/BNLdE0bF3/KluKAJw8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562038788820696.2422761022701; Mon, 1 Jul 2019 20:39:48 -0700 (PDT) Received: from localhost ([::1]:48167 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi9dz-0003fP-L8 for importer@patchew.org; Mon, 01 Jul 2019 23:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50378) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aG-0004jI-Nh for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aE-0003d3-Re for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37924) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aD-0003by-5C for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 C42CF7E428; Tue, 2 Jul 2019 02:31:46 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 323DC60C43; Tue, 2 Jul 2019 02:31:44 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:18 +0800 Message-Id: <1562034689-6539-7-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.27]); Tue, 02 Jul 2019 02:31:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/17] net: use g_strsplit() for parsing host address and port X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella Use the glib function to split host address and port in the parse_host_port() function. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- net/net.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/net/net.c b/net/net.c index 76ba0b7..5ce3996 100644 --- a/net/net.c +++ b/net/net.c @@ -87,32 +87,39 @@ static int get_str_sep(char *buf, int buf_size, const c= har **pp, int sep) int parse_host_port(struct sockaddr_in *saddr, const char *str, Error **errp) { - char buf[512]; + gchar **substrings; struct hostent *he; - const char *p, *r; - int port; + const char *addr, *p, *r; + int port, ret =3D 0; =20 - p =3D str; - if (get_str_sep(buf, sizeof(buf), &p, ':') < 0) { + substrings =3D g_strsplit(str, ":", 2); + if (!substrings || !substrings[0] || !substrings[1]) { error_setg(errp, "host address '%s' doesn't contain ':' " "separating host from port", str); - return -1; + ret =3D -1; + goto out; } + + addr =3D substrings[0]; + p =3D substrings[1]; + saddr->sin_family =3D AF_INET; - if (buf[0] =3D=3D '\0') { + if (addr[0] =3D=3D '\0') { saddr->sin_addr.s_addr =3D 0; } else { - if (qemu_isdigit(buf[0])) { - if (!inet_aton(buf, &saddr->sin_addr)) { + if (qemu_isdigit(addr[0])) { + if (!inet_aton(addr, &saddr->sin_addr)) { error_setg(errp, "host address '%s' is not a valid " - "IPv4 address", buf); - return -1; + "IPv4 address", addr); + ret =3D -1; + goto out; } } else { - he =3D gethostbyname(buf); + he =3D gethostbyname(addr); if (he =3D=3D NULL) { - error_setg(errp, "can't resolve host address '%s'", buf); - return - 1; + error_setg(errp, "can't resolve host address '%s'", addr); + ret =3D -1; + goto out; } saddr->sin_addr =3D *(struct in_addr *)he->h_addr; } @@ -120,10 +127,14 @@ int parse_host_port(struct sockaddr_in *saddr, const = char *str, port =3D strtol(p, (char **)&r, 0); if (r =3D=3D p) { error_setg(errp, "port number '%s' is invalid", p); - return -1; + ret =3D -1; + goto out; } saddr->sin_port =3D htons(port); - return 0; + +out: + g_strfreev(substrings); + return ret; } =20 char *qemu_mac_strdup_printf(const uint8_t *macaddr) --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040743; cv=none; d=zoho.com; s=zohoarc; b=j2OoOG7Ry1cQJlaIpPP1qybErPqxYRVKRTjvN+Dks2q4+Zv0baMVQmUq1DrHVXEc/Fs0MIKjpgchqHIXxjBR+COkI6yTE9EpQ7d9VCLzC2O05C03GYVNZoyULD7spOXayt+myuvUff3lwwHlYH0dtaaTHeGGacTzvckEobh6o2E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040743; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=vwMHo3Bc9r85jhaBkM167k3Ku/mPeYElzHZUHlvuK8E=; b=eS6rrdaoZkV7COu1U6tM7mRstlXgQiAoSsURYnw22Jvizm9LS9bEMmAbZaS5UI95Cf8u2DuXfMuSCmst0jdgpiJ6udP9AB/AulW/36uMkCc9AzuBUbshtiGMvdw3R8/dJhOdUpOkxyX2GtixI9QUDyysJm5E/qbCjrVznM1VcWI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040743335626.0120607833054; Mon, 1 Jul 2019 21:12:23 -0700 (PDT) Received: from localhost ([::1]:48500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA9W-0006sf-6E for importer@patchew.org; Tue, 02 Jul 2019 00:12:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50426) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aH-0004lP-Ki for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aG-0003dy-KM for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45816) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aE-0003cK-Qo for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:50 -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 DF239C18B2D7; Tue, 2 Jul 2019 02:31:48 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C193BA4D; Tue, 2 Jul 2019 02:31:47 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:19 +0800 Message-Id: <1562034689-6539-8-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.31]); Tue, 02 Jul 2019 02:31:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/17] net: remove unused get_str_sep() function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella Since the get_str_sep() function is no longer used in net/net.c, we can remove it. Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- net/net.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/net/net.c b/net/net.c index 5ce3996..7d40982 100644 --- a/net/net.c +++ b/net/net.c @@ -64,26 +64,6 @@ static QTAILQ_HEAD(, NetClientState) net_clients; /***********************************************************/ /* network device redirectors */ =20 -static int get_str_sep(char *buf, int buf_size, const char **pp, int sep) -{ - const char *p, *p1; - int len; - p =3D *pp; - p1 =3D strchr(p, sep); - if (!p1) - return -1; - len =3D p1 - p; - p1++; - if (buf_size > 0) { - if (len > buf_size - 1) - len =3D buf_size - 1; - memcpy(buf, p, len); - buf[len] =3D '\0'; - } - *pp =3D p1; - return 0; -} - int parse_host_port(struct sockaddr_in *saddr, const char *str, Error **errp) { --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562039308; cv=none; d=zoho.com; s=zohoarc; b=NsUcypEl4BPX7Eg4JtkK1MEl8BPFAZfHp6QegA8Q7Z6qlqU3nAtvSwHMEcR7iPz7i1BWYSDn2pPVgHfCYp8wl4BBJwQAhSP/m3Fr1CR8Qc6bduhVLQNrWZ+888DCqRjOnJR7irK1A/sh/8XhG/JGs+8aGW64QUndfGmmv1sJTHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562039308; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JCQcEBhAwNEuV3Qrg8qLjDYyWiFKpHS3QiBPsVgQjzo=; b=DjPjehnJLQkBFU5BEJoWlX+MlFmvkk9TOQOFnHEmj6YchkAqnZ7BWnt1JsnltoT6qegsYdA3xEqECrOjVXuc7R7JfsD6nlvC3VrybXoE+fgYl6I9ly302mnKUIeZyxBam1PbCcTpmOtUCRZlMMw6drUbObMmPLoFUdINDYvx2To= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562039308765613.2025078165092; Mon, 1 Jul 2019 20:48:28 -0700 (PDT) Received: from localhost ([::1]:48204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi9m6-0007iJ-Az for importer@patchew.org; Mon, 01 Jul 2019 23:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50457) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aI-0004o9-N8 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aG-0003f2-Sg for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37940) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aG-0003dQ-Iw for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:52 -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 037157FDCD; Tue, 2 Jul 2019 02:31:51 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66862BA4D; Tue, 2 Jul 2019 02:31:49 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:20 +0800 Message-Id: <1562034689-6539-9-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.27]); Tue, 02 Jul 2019 02:31:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/17] net/announce: Allow optional list of interfaces X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Allow the caller to restrict the set of interfaces that announces are sent on. The default is still to send on all interfaces. e.g. { "execute": "announce-self", "arguments": { "initial": 50, "max": 550, "= rounds": 5, "step": 50, "interfaces": ["vn2", "vn1"] } } This doesn't affect the behaviour of migraiton announcments. Note: There's still only one timer for the qmp command, so that performing an 'announce-self' on one list of interfaces followed by another 'announce-self' on another list will stop the announces on the existing set. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- include/net/announce.h | 2 +- net/announce.c | 39 ++++++++++++++++++++++++++++++++------- net/trace-events | 2 +- qapi/net.json | 11 ++++++++--- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/include/net/announce.h b/include/net/announce.h index 04a035f..7734704 100644 --- a/include/net/announce.h +++ b/include/net/announce.h @@ -22,7 +22,7 @@ struct AnnounceTimer { /* Returns: update the timer to the next time point */ int64_t qemu_announce_timer_step(AnnounceTimer *timer); =20 -/* Delete the underlying timer */ +/* Delete the underlying timer and other data */ void qemu_announce_timer_del(AnnounceTimer *timer); =20 /* diff --git a/net/announce.c b/net/announce.c index 91e9a6e..1ce42b5 100644 --- a/net/announce.c +++ b/net/announce.c @@ -38,6 +38,8 @@ void qemu_announce_timer_del(AnnounceTimer *timer) timer_free(timer->tm); timer->tm =3D NULL; } + qapi_free_strList(timer->params.interfaces); + timer->params.interfaces =3D NULL; } =20 /* @@ -96,24 +98,47 @@ static int announce_self_create(uint8_t *buf, =20 static void qemu_announce_self_iter(NICState *nic, void *opaque) { + AnnounceTimer *timer =3D opaque; uint8_t buf[60]; int len; + bool skip; + + if (timer->params.has_interfaces) { + strList *entry =3D timer->params.interfaces; + /* Skip unless we find our name in the requested list */ + skip =3D true; + + while (entry) { + if (!strcmp(entry->value, nic->ncs->name)) { + /* Found us */ + skip =3D false; + break; + } + entry =3D entry->next; + } + } else { + skip =3D false; + } + + trace_qemu_announce_self_iter(nic->ncs->name, + qemu_ether_ntoa(&nic->conf->macaddr), sk= ip); =20 - trace_qemu_announce_self_iter(qemu_ether_ntoa(&nic->conf->macaddr)); - len =3D announce_self_create(buf, nic->conf->macaddr.a); + if (!skip) { + len =3D announce_self_create(buf, nic->conf->macaddr.a); =20 - qemu_send_packet_raw(qemu_get_queue(nic), buf, len); + qemu_send_packet_raw(qemu_get_queue(nic), buf, len); =20 - /* if the NIC provides it's own announcement support, use it as well */ - if (nic->ncs->info->announce) { - nic->ncs->info->announce(nic->ncs); + /* if the NIC provides it's own announcement support, use it as we= ll */ + if (nic->ncs->info->announce) { + nic->ncs->info->announce(nic->ncs); + } } } static void qemu_announce_self_once(void *opaque) { AnnounceTimer *timer =3D (AnnounceTimer *)opaque; =20 - qemu_foreach_nic(qemu_announce_self_iter, NULL); + qemu_foreach_nic(qemu_announce_self_iter, timer); =20 if (--timer->round) { qemu_announce_timer_step(timer); diff --git a/net/trace-events b/net/trace-events index a7937f3..875ef2a 100644 --- a/net/trace-events +++ b/net/trace-events @@ -1,7 +1,7 @@ # See docs/devel/tracing.txt for syntax documentation. =20 # announce.c -qemu_announce_self_iter(const char *mac) "%s" +qemu_announce_self_iter(const char *name, const char *mac, int skip) "%s:%= s skip: %d" =20 # vhost-user.c vhost_user_event(const char *chr, int event) "chr: %s got event: %d" diff --git a/qapi/net.json b/qapi/net.json index 5f7bff1..6f2cd4f 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -699,6 +699,9 @@ # # @step: Delay increase (in ms) after each self-announcement attempt # +# @interfaces: An optional list of interface names, which restricts the +# announcement to the listed interfaces. (Since 4.1) +# # Since: 4.0 ## =20 @@ -706,7 +709,8 @@ 'data': { 'initial': 'int', 'max': 'int', 'rounds': 'int', - 'step': 'int' } } + 'step': 'int', + '*interfaces': ['str'] } } =20 ## # @announce-self: @@ -718,9 +722,10 @@ # # Example: # -# -> { "execute": "announce-self" +# -> { "execute": "announce-self", # "arguments": { -# "initial": 50, "max": 550, "rounds": 10, "step": 50 } } +# "initial": 50, "max": 550, "rounds": 10, "step": 50, +# "interfaces": ["vn2", "vn3"] } } # <- { "return": {} } # # Since: 4.0 --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562041014; cv=none; d=zoho.com; s=zohoarc; b=fpcYwTLraAeFKbuqmQRCiwF5JqOSFcJGAcZCnAFAhef41h0uhPAsX9RJKf/d0k1TQr1WFAVvvs/sTOmUCGdYIxAB+1BY1klQawsboJl39k8Br1EvxANAg5arajjJZ9xNx3q1lHb1ZjoqmL1yzqM/U8gGdeuLcRWYJKy1uWkvn7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562041014; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=nniuwUBgNq2bpKDqwJ7kBSlyEL4Le6h8Iew1+8tIwzE=; b=PfGQ+dVXcRAVBQWTZfhI4hcn9estbjzC+WIAKInPuRmW2nDZfV6Vjr7Rh0H2GFXnKzN+K1HN0Ntn1+LL8IR127mqw2f1eIxCGH+x8oqXFoCt2HOyjQqRWU6lmGW1Shpp3OhEIu4KakIa1ra98zBdoHPi42Djkyc0SoW7+Bv5UiM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 156204101430365.88082830551275; Mon, 1 Jul 2019 21:16:54 -0700 (PDT) Received: from localhost ([::1]:48582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiADn-0002VV-Lz for importer@patchew.org; Tue, 02 Jul 2019 00:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50463) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aJ-0004pZ-8k for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aI-0003g7-3i for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45828) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aH-0003fB-RL for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:54 -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 21DC6C0586D8; Tue, 2 Jul 2019 02:31:53 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 802C260C43; Tue, 2 Jul 2019 02:31:51 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:21 +0800 Message-Id: <1562034689-6539-10-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.31]); Tue, 02 Jul 2019 02:31:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/17] net/announce: Add HMP optional interface list X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add the optional interface list to the HMP command. i.e. All interfaces announce_self Just the named interfaces: announce_self vn1,vn2 Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- hmp-commands.hx | 6 ++++-- monitor/hmp-cmds.c | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8b7aec3..d42c09f 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -955,8 +955,8 @@ ETEXI =20 { .name =3D "announce_self", - .args_type =3D "", - .params =3D "", + .args_type =3D "interfaces:s?", + .params =3D "[interfaces]", .help =3D "Trigger GARP/RARP announcements", .cmd =3D hmp_announce_self, }, @@ -967,6 +967,8 @@ STEXI Trigger a round of GARP/RARP broadcasts; this is useful for explicitly upd= ating the network infrastructure after a reconfiguration or some forms of migration. The timings of the round are set by the migration announce parameters. +An optional comma separated @var{interfaces} list restricts the announce t= o the +named set of interfaces. ETEXI =20 { diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index c283dde..0fce179 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -27,6 +27,7 @@ #include "monitor/monitor-internal.h" #include "monitor/qdev.h" #include "qapi/error.h" +#include "qapi/clone-visitor.h" #include "qapi/opts-visitor.h" #include "qapi/qapi-builtin-visit.h" #include "qapi/qapi-commands-block.h" @@ -38,6 +39,7 @@ #include "qapi/qapi-commands-run-state.h" #include "qapi/qapi-commands-tpm.h" #include "qapi/qapi-commands-ui.h" +#include "qapi/qapi-visit-net.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qerror.h" #include "qapi/string-input-visitor.h" @@ -67,6 +69,32 @@ static void hmp_handle_error(Monitor *mon, Error **errp) } } =20 +/* + * Produce a strList from a comma separated list. + * A NULL or empty input string return NULL. + */ +static strList *strList_from_comma_list(const char *in) +{ + strList *res =3D NULL; + strList **hook =3D &res; + + while (in && in[0]) { + char *comma =3D strchr(in, ','); + *hook =3D g_new0(strList, 1); + + if (comma) { + (*hook)->value =3D g_strndup(in, comma - in); + in =3D comma + 1; /* skip the , */ + } else { + (*hook)->value =3D g_strdup(in); + in =3D NULL; + } + hook =3D &(*hook)->next; + } + + return res; +} + void hmp_info_name(Monitor *mon, const QDict *qdict) { NameInfo *info; @@ -1631,7 +1659,15 @@ void hmp_info_snapshots(Monitor *mon, const QDict *q= dict) =20 void hmp_announce_self(Monitor *mon, const QDict *qdict) { - qmp_announce_self(migrate_announce_params(), NULL); + const char *interfaces_str =3D qdict_get_try_str(qdict, "interfaces"); + AnnounceParameters *params =3D QAPI_CLONE(AnnounceParameters, + migrate_announce_params()); + + qapi_free_strList(params->interfaces); + params->interfaces =3D strList_from_comma_list(interfaces_str); + params->has_interfaces =3D params->interfaces !=3D NULL; + qmp_announce_self(params, NULL); + qapi_free_AnnounceParameters(params); } =20 void hmp_migrate_cancel(Monitor *mon, const QDict *qdict) --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040499; cv=none; d=zoho.com; s=zohoarc; b=V1/WQ2aWWqvqmyrIVrOvSPYiJS4WF/48IJLiQyC4KID1UekavT3TJNsjFhUHvibYzqwxvVA/TpgWoW40Xa0tMLgOpdPAUvHBkHCmC/QmEZsxCZgpbbKMThlN42HFlVQ/yGObm551jowT1BhsISk3vD70MSvC03gfp42FKzxxR9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040499; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BBAV4waYzSpqLd2zmKwKT4OA3PRp+wnqn4l5ZCkCyb8=; b=k2PwE4ABo/QoJENKIAFy8yLrsigF8OkRuQhtA0CSBb3nb7aJ9C3Cf6mheFNXSTrXk/YrDAIs6FgaQxkK3sTStXiGoTg02daqtk2cqODaTzNuK6pSkzgRRCxI3IMugY04yz+7p6uy3F932zWTRzdU43SR8vcdMQoUJM/l0yDwVUo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040499411555.5615191638398; Mon, 1 Jul 2019 21:08:19 -0700 (PDT) Received: from localhost ([::1]:48464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA5a-0001qg-97 for importer@patchew.org; Tue, 02 Jul 2019 00:08:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50479) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aM-0004w5-0S for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aK-0003h4-HO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36448) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aK-0003gm-8Y for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:56 -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 3DBED85363; Tue, 2 Jul 2019 02:31:55 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D3BB60C43; Tue, 2 Jul 2019 02:31:53 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:22 +0800 Message-Id: <1562034689-6539-11-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.25]); Tue, 02 Jul 2019 02:31:55 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/17] net/announce: Add optional ID X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Previously there was a single instance of the timer used by monitor triggered announces, that's OK, but when combined with the previous change that lets you have announces for subsets of interfaces it's a bit restrictive if you want to do different things to different interfaces. Add an 'id' field to the announce, and maintain a list of the timers based on id. This allows you to for example: a) Start an announce going on interface eth0 for a long time b) Start an announce going on interface eth1 for a long time c) Kill the announce on eth0 while leaving eth1 going. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 4 ++-- include/net/announce.h | 8 ++++++-- net/announce.c | 52 +++++++++++++++++++++++++++++++++++++++++++---= ---- net/trace-events | 3 ++- qapi/net.json | 9 +++++++-- 5 files changed, 62 insertions(+), 14 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index c3f5fcc..b9e1cd7 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -2360,7 +2360,7 @@ static int virtio_net_post_load_device(void *opaque, = int version_id) timer_mod(n->announce_timer.tm, qemu_clock_get_ms(n->announce_timer.type)); } else { - qemu_announce_timer_del(&n->announce_timer); + qemu_announce_timer_del(&n->announce_timer, false); } } =20 @@ -2784,7 +2784,7 @@ static void virtio_net_device_unrealize(DeviceState *= dev, Error **errp) virtio_net_del_queue(n, i); } =20 - qemu_announce_timer_del(&n->announce_timer); + qemu_announce_timer_del(&n->announce_timer, false); g_free(n->vqs); qemu_del_nic(n->nic); virtio_net_rsc_cleanup(n); diff --git a/include/net/announce.h b/include/net/announce.h index 7734704..3d90c83 100644 --- a/include/net/announce.h +++ b/include/net/announce.h @@ -22,8 +22,12 @@ struct AnnounceTimer { /* Returns: update the timer to the next time point */ int64_t qemu_announce_timer_step(AnnounceTimer *timer); =20 -/* Delete the underlying timer and other data */ -void qemu_announce_timer_del(AnnounceTimer *timer); +/* + * Delete the underlying timer and other data + * If 'free_named' true and the timer is a named timer, then remove + * it from the list of named timers and free the AnnounceTimer itself. + */ +void qemu_announce_timer_del(AnnounceTimer *timer, bool free_named); =20 /* * Under BQL/main thread diff --git a/net/announce.c b/net/announce.c index 1ce42b5..db90d3b 100644 --- a/net/announce.c +++ b/net/announce.c @@ -15,6 +15,8 @@ #include "qapi/qapi-commands-net.h" #include "trace.h" =20 +static GData *named_timers; + int64_t qemu_announce_timer_step(AnnounceTimer *timer) { int64_t step; @@ -31,8 +33,13 @@ int64_t qemu_announce_timer_step(AnnounceTimer *timer) return step; } =20 -void qemu_announce_timer_del(AnnounceTimer *timer) +/* + * If 'free_named' is true, then remove the timer from the list + * and free the timer itself. + */ +void qemu_announce_timer_del(AnnounceTimer *timer, bool free_named) { + bool free_timer =3D false; if (timer->tm) { timer_del(timer->tm); timer_free(timer->tm); @@ -40,6 +47,24 @@ void qemu_announce_timer_del(AnnounceTimer *timer) } qapi_free_strList(timer->params.interfaces); timer->params.interfaces =3D NULL; + if (free_named && timer->params.has_id) { + AnnounceTimer *list_timer; + /* + * Sanity check: There should only be one timer on the list with + * the id. + */ + list_timer =3D g_datalist_get_data(&named_timers, timer->params.id= ); + assert(timer =3D=3D list_timer); + free_timer =3D true; + g_datalist_remove_data(&named_timers, timer->params.id); + } + trace_qemu_announce_timer_del(free_named, free_timer, timer->params.id= ); + g_free(timer->params.id); + timer->params.id =3D NULL; + + if (free_timer) { + g_free(timer); + } } =20 /* @@ -56,7 +81,7 @@ void qemu_announce_timer_reset(AnnounceTimer *timer, * We're under the BQL, so the current timer can't * be firing, so we should be able to delete it. */ - qemu_announce_timer_del(timer); + qemu_announce_timer_del(timer, false); =20 QAPI_CLONE_MEMBERS(AnnounceParameters, &timer->params, params); timer->round =3D params->rounds; @@ -120,7 +145,8 @@ static void qemu_announce_self_iter(NICState *nic, void= *opaque) skip =3D false; } =20 - trace_qemu_announce_self_iter(nic->ncs->name, + trace_qemu_announce_self_iter(timer->params.has_id ? timer->params.id = : "_", + nic->ncs->name, qemu_ether_ntoa(&nic->conf->macaddr), sk= ip); =20 if (!skip) { @@ -143,7 +169,7 @@ static void qemu_announce_self_once(void *opaque) if (--timer->round) { qemu_announce_timer_step(timer); } else { - qemu_announce_timer_del(timer); + qemu_announce_timer_del(timer, true); } } =20 @@ -154,12 +180,24 @@ void qemu_announce_self(AnnounceTimer *timer, Announc= eParameters *params) if (params->rounds) { qemu_announce_self_once(timer); } else { - qemu_announce_timer_del(timer); + qemu_announce_timer_del(timer, true); } } =20 void qmp_announce_self(AnnounceParameters *params, Error **errp) { - static AnnounceTimer announce_timer; - qemu_announce_self(&announce_timer, params); + AnnounceTimer *named_timer; + if (!params->has_id) { + params->id =3D g_strdup(""); + params->has_id =3D true; + } + + named_timer =3D g_datalist_get_data(&named_timers, params->id); + + if (!named_timer) { + named_timer =3D g_new0(AnnounceTimer, 1); + g_datalist_set_data(&named_timers, params->id, named_timer); + } + + qemu_announce_self(named_timer, params); } diff --git a/net/trace-events b/net/trace-events index 875ef2a..ac57056 100644 --- a/net/trace-events +++ b/net/trace-events @@ -1,7 +1,8 @@ # See docs/devel/tracing.txt for syntax documentation. =20 # announce.c -qemu_announce_self_iter(const char *name, const char *mac, int skip) "%s:%= s skip: %d" +qemu_announce_self_iter(const char *id, const char *name, const char *mac,= int skip) "%s:%s:%s skip: %d" +qemu_announce_timer_del(bool free_named, bool free_timer, char *id) "free = named: %d free timer: %d id: %s" =20 # vhost-user.c vhost_user_event(const char *chr, int event) "chr: %s got event: %d" diff --git a/qapi/net.json b/qapi/net.json index 6f2cd4f..728990f 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -702,6 +702,10 @@ # @interfaces: An optional list of interface names, which restricts the # announcement to the listed interfaces. (Since 4.1) # +# @id: A name to be used to identify an instance of announce-timers +# and to allow it to modified later. Not for use as +# part of the migration parameters. (Since 4.1) +# # Since: 4.0 ## =20 @@ -710,7 +714,8 @@ 'max': 'int', 'rounds': 'int', 'step': 'int', - '*interfaces': ['str'] } } + '*interfaces': ['str'], + '*id' : 'str' } } =20 ## # @announce-self: @@ -725,7 +730,7 @@ # -> { "execute": "announce-self", # "arguments": { # "initial": 50, "max": 550, "rounds": 10, "step": 50, -# "interfaces": ["vn2", "vn3"] } } +# "interfaces": ["vn2", "vn3"], "id": "bob" } } # <- { "return": {} } # # Since: 4.0 --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040661; cv=none; d=zoho.com; s=zohoarc; b=aSlYaN+Ps9WKQTyZzm1giWUFMMlvvbHFks5d8dqJVPEe6ILSB+foTV2eBjavf112eVtxYEhfzmQVC8yTDGeIBHdm1Im3IVd07cTXrcYZ4ueFi1tPm+qiz1fwdMOUPsojz+2thBSv0M/9BxmM16LCzyoIDSWZ8rszsiEXGG7jEyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040661; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=zJ/7jPBok5FWImS8T9ETxWJbgu7f8tP0HK/epeVFk9M=; b=CSjkq5mXCV+tkq9tgg0LMgRZIJnjwmo5X49myAHH9BmynaIk8XSyxiWgJbSb7xQ9lXF/zyGdLoQgX+dBj4Qx9S9UKqP+UnSMYEf6+zVrgkPCXAuQNDhmjGlq0JLsczfBK07uFAxDTci5riDnfdRT0OZUjH85xVSoWK9y7855OuM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040661020561.6410690007324; Mon, 1 Jul 2019 21:11:01 -0700 (PDT) Received: from localhost ([::1]:48490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiA88-00054x-Me for importer@patchew.org; Tue, 02 Jul 2019 00:10:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50493) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aN-0004ye-7V for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aM-0003hW-93 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aM-0003hE-3L for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:31:58 -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 5EC1E356E8; Tue, 2 Jul 2019 02:31:57 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6F5418B30; Tue, 2 Jul 2019 02:31:55 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:23 +0800 Message-Id: <1562034689-6539-12-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.30]); Tue, 02 Jul 2019 02:31:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/17] net/announce: Add HMP optional ID X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add the optional ID to the HMP command. e.g. # start an announce for a long time on eth1 migrate_set_parameter announce-rounds 1000 announce_self "eth1" e1 # start an announce on eth2 announce_self "eth2" e2 # Change e1 to be announcing on eth1 and eth3 announce_self "eth1,eth3" e1 # Cancel e1 migrate_set_parameter announce-rounds 0 announce_self "" e1 Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- hmp-commands.hx | 7 ++++--- monitor/hmp-cmds.c | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index d42c09f..bfa5681 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -955,8 +955,8 @@ ETEXI =20 { .name =3D "announce_self", - .args_type =3D "interfaces:s?", - .params =3D "[interfaces]", + .args_type =3D "interfaces:s?,id:s?", + .params =3D "[interfaces] [id]", .help =3D "Trigger GARP/RARP announcements", .cmd =3D hmp_announce_self, }, @@ -968,7 +968,8 @@ Trigger a round of GARP/RARP broadcasts; this is useful= for explicitly updating network infrastructure after a reconfiguration or some forms of migration. The timings of the round are set by the migration announce parameters. An optional comma separated @var{interfaces} list restricts the announce t= o the -named set of interfaces. +named set of interfaces. An optional @var{id} can be used to start a separ= ate announce +timer and to change the parameters of it later. ETEXI =20 { diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 0fce179..9de3538 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1660,12 +1660,15 @@ void hmp_info_snapshots(Monitor *mon, const QDict *= qdict) void hmp_announce_self(Monitor *mon, const QDict *qdict) { const char *interfaces_str =3D qdict_get_try_str(qdict, "interfaces"); + const char *id =3D qdict_get_try_str(qdict, "id"); AnnounceParameters *params =3D QAPI_CLONE(AnnounceParameters, migrate_announce_params()); =20 qapi_free_strList(params->interfaces); params->interfaces =3D strList_from_comma_list(interfaces_str); params->has_interfaces =3D params->interfaces !=3D NULL; + params->id =3D g_strdup(id); + params->has_id =3D !!params->id; qmp_announce_self(params, NULL); qapi_free_AnnounceParameters(params); } --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562041280; cv=none; d=zoho.com; s=zohoarc; b=DGbv+GkaoFlQ0Y2go0n1xJi+jqkZmuFqGUVDbgAKenDjWYNyIQzfU1hPkAgxpwW7HPktgEkYCrdbs7EFD6XDn6jNsiQ22Mc/M6CLi4J/1HyO3qMWveXS1rIqfP1O4P50uy9fuTcaMxuu37nZHvgKIQ4xhVUoKrvYP10I/dQQV3A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562041280; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cZS9GVorJjkzkroXLor3DnVIkawnGhPRGCkBSl4M0y4=; b=ZwmmdEl+jX8KicpgqGu5wVWwiBMr5HkfkN6T8ylnFuVSkXPeus749066rzGDtX2Vtsqqob/mkBgm8+QqxWFPsDQHvAtFzeAnCOobqf2KM6BjZSNgtYqQSP+g/1H4RUAbi+iGOnsSwWcw8+koCETddQh1aZJiIpOAoeFRrvOi7hk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562041280664752.6426449175209; Mon, 1 Jul 2019 21:21:20 -0700 (PDT) Received: from localhost ([::1]:48620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiAIB-0006WK-GC for importer@patchew.org; Tue, 02 Jul 2019 00:21:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50515) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aP-00054S-IC for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aO-0003ir-Dt for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46567) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aO-0003iO-4Z for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:00 -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 7154E307D853; Tue, 2 Jul 2019 02:31:59 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1ECC60C43; Tue, 2 Jul 2019 02:31:57 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:24 +0800 Message-Id: <1562034689-6539-13-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.48]); Tue, 02 Jul 2019 02:31:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/17] net/announce: Expand test for stopping self announce X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Expand self-announce test to check we can stop an announce timer. We set it up to send 300 packets, but after we receive the first one we tell it to stop. We error if: a) We receive more than 30 of the packets b) We're still receiving packets after a lot longer than the 30 seconds should have arrived Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- tests/virtio-net-test.c | 57 +++++++++++++++++++++++++++++++++++++++++++++= +--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c index 663cf7e..7aa9622 100644 --- a/tests/virtio-net-test.c +++ b/tests/virtio-net-test.c @@ -184,21 +184,72 @@ static void announce_self(void *obj, void *data, QGue= stAllocator *t_alloc) QDict *rsp; int ret; uint16_t *proto =3D (uint16_t *)&buffer[12]; + size_t total_received =3D 0; + uint64_t start, now, last_rxt, deadline; =20 + /* Send a set of packets over a few second period */ rsp =3D qmp("{ 'execute' : 'announce-self', " " 'arguments': {" - " 'initial': 50, 'max': 550," - " 'rounds': 10, 'step': 50 } }"); + " 'initial': 20, 'max': 100," + " 'rounds': 300, 'step': 10, 'id': 'bob' } }"); assert(!qdict_haskey(rsp, "error")); qobject_unref(rsp); =20 - /* Catch the packet and make sure it's a RARP */ + /* Catch the first packet and make sure it's a RARP */ ret =3D qemu_recv(sv[0], &len, sizeof(len), 0); g_assert_cmpint(ret, =3D=3D, sizeof(len)); len =3D ntohl(len); =20 ret =3D qemu_recv(sv[0], buffer, len, 0); g_assert_cmpint(*proto, =3D=3D, htons(ETH_P_RARP)); + + /* + * Stop the announcment by settings rounds to 0 on the + * existing timer. + */ + rsp =3D qmp("{ 'execute' : 'announce-self', " + " 'arguments': {" + " 'initial': 20, 'max': 100," + " 'rounds': 0, 'step': 10, 'id': 'bob' } }"); + assert(!qdict_haskey(rsp, "error")); + qobject_unref(rsp); + + /* Now make sure the packets stop */ + + /* Times are in us */ + start =3D g_get_monotonic_time(); + /* 30 packets, max gap 100ms, * 4 for wiggle */ + deadline =3D start + 1000 * (100 * 30 * 4); + last_rxt =3D start; + + while (true) { + int saved_err; + ret =3D qemu_recv(sv[0], buffer, 60, MSG_DONTWAIT); + saved_err =3D errno; + now =3D g_get_monotonic_time(); + g_assert_cmpint(now, <, deadline); + + if (ret >=3D 0) { + if (ret) { + last_rxt =3D now; + } + total_received +=3D ret; + + /* Check it's not spewing loads */ + g_assert_cmpint(total_received, <, 60 * 30 * 2); + } else { + g_assert_cmpint(saved_err, =3D=3D, EAGAIN); + + /* 400ms, i.e. 4 worst case gaps */ + if ((now - last_rxt) > (1000 * 100 * 4)) { + /* Nothings arrived for a while - must have stopped */ + break; + }; + + /* 100ms */ + g_usleep(1000 * 100); + } + }; } =20 static void virtio_net_test_cleanup(void *sockets) --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562040880; cv=none; d=zoho.com; s=zohoarc; b=P13s55WzEE0OU8rR6JZXYUkzM/HBXZS//fiTk8nWQx9pnMRv1qcOEXNJIpi1WnUG7QONruzGq2be0vGKfs8Pd6pBEtTG2uLyjDcgVuW5HbjBwS0YwCV+xwc12vFcPQjGjQcXhhA8fkh3g8GZ3AbkVPiCA5qQfYyfw0ahdKgwb6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562040880; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qvNID5FnIZJz3tGij9qavm9DOn1vLn5BTgFdZp5CoVM=; b=PFmQshe6dnnx2JEQEYKWQSZWw7xka8J5BD4vaYbio9uir/O/QfP7TJeYELqHAjyNllUq/iGnr6eFfUwVDaqPSJ7nBayJEwCnNzYu5xXpBPHmjPTVMe5nfJ/W6oslsZdYE1w5MUrxg8EXtlakgLYv5FJjE4ourGdJz3vruX4m4bw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562040880458859.6264414167135; Mon, 1 Jul 2019 21:14:40 -0700 (PDT) Received: from localhost ([::1]:48544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiABg-0000Xy-Pz for importer@patchew.org; Tue, 02 Jul 2019 00:14:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50530) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aR-00058O-Rr for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aQ-0003kM-Gc for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aQ-0003jz-7q for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:02 -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 8AE7630BBE9B; Tue, 2 Jul 2019 02:32:01 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC67868405; Tue, 2 Jul 2019 02:31:59 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:25 +0800 Message-Id: <1562034689-6539-14-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.49]); Tue, 02 Jul 2019 02:32:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/17] COLO-compare: Add new parameter to communicate with remote colo-frame X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen We add the "notify_dev=3DchardevID" parameter. After that colo-compare can = connect with remote(currently just for Xen, KVM-COLO didn't need it.) colo-frame through= chardev socket, it can notify remote(Xen) colo-frame to handle checkpoint event. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/colo-compare.c | 21 +++++++++++++++++++++ qemu-options.hx | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 103297b..10fae2b 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -83,6 +83,7 @@ typedef struct CompareState { char *pri_indev; char *sec_indev; char *outdev; + char *notify_dev; CharBackend chr_pri_in; CharBackend chr_sec_in; CharBackend chr_out; @@ -897,6 +898,21 @@ static void compare_set_vnet_hdr(Object *obj, s->vnet_hdr =3D value; } =20 +static char *compare_get_notify_dev(Object *obj, Error **errp) +{ + CompareState *s =3D COLO_COMPARE(obj); + + return g_strdup(s->notify_dev); +} + +static void compare_set_notify_dev(Object *obj, const char *value, Error *= *errp) +{ + CompareState *s =3D COLO_COMPARE(obj); + + g_free(s->notify_dev); + s->notify_dev =3D g_strdup(value); +} + static void compare_pri_rs_finalize(SocketReadState *pri_rs) { CompareState *s =3D container_of(pri_rs, CompareState, pri_rs); @@ -1057,6 +1073,10 @@ static void colo_compare_init(Object *obj) (Object **)&s->iothread, object_property_allow_set_link, OBJ_PROP_LINK_STRONG, NULL); + /* This parameter just for Xen COLO */ + object_property_add_str(obj, "notify_dev", + compare_get_notify_dev, compare_set_notify_dev, + NULL); =20 s->vnet_hdr =3D false; object_property_add_bool(obj, "vnet_hdr_support", compare_get_vnet_hdr, @@ -1103,6 +1123,7 @@ static void colo_compare_finalize(Object *obj) g_free(s->pri_indev); g_free(s->sec_indev); g_free(s->outdev); + g_free(s->notify_dev); } =20 static const TypeInfo colo_compare_info =3D { diff --git a/qemu-options.hx b/qemu-options.hx index 0d8beb4..c18b790 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4477,7 +4477,7 @@ Dump the network traffic on netdev @var{dev} to the f= ile specified by The file format is libpcap, so it can be analyzed with tools such as tcpdu= mp or Wireshark. =20 -@item -object colo-compare,id=3D@var{id},primary_in=3D@var{chardevid},seco= ndary_in=3D@var{chardevid},outdev=3D@var{chardevid},iothread=3D@var{id}[,vn= et_hdr_support] +@item -object colo-compare,id=3D@var{id},primary_in=3D@var{chardevid},seco= ndary_in=3D@var{chardevid},outdev=3D@var{chardevid},iothread=3D@var{id}[,vn= et_hdr_support][,notify_dev=3D@var{id}] =20 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@v= ar{chardevid}, than compare primary packet with secondary packet. If the packets are same, we will output primary @@ -4486,11 +4486,15 @@ do checkpoint and send primary packet to outdev@var= {chardevid}. In order to improve efficiency, we need to put the task of comparison in another thread. If it has the vnet_hdr_support flag, colo compare will send/recv packet with vnet_hdr_len. +If you want to use Xen COLO, will need the notify_dev to notify Xen +colo-frame to do checkpoint. =20 we must use it with the help of filter-mirror and filter-redirector. =20 @example =20 +KVM COLO + primary: -netdev tap,id=3Dhn0,vhost=3Doff,script=3D/etc/qemu-ifup,downscript=3D/etc= /qemu-ifdown -device e1000,id=3De0,netdev=3Dhn0,mac=3D52:a4:00:12:78:66 @@ -4514,6 +4518,33 @@ secondary: -object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dred0 -object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3Dred1 =20 + +Xen COLO + +primary: +-netdev tap,id=3Dhn0,vhost=3Doff,script=3D/etc/qemu-ifup,downscript=3D/etc= /qemu-ifdown +-device e1000,id=3De0,netdev=3Dhn0,mac=3D52:a4:00:12:78:66 +-chardev socket,id=3Dmirror0,host=3D3.3.3.3,port=3D9003,server,nowait +-chardev socket,id=3Dcompare1,host=3D3.3.3.3,port=3D9004,server,nowait +-chardev socket,id=3Dcompare0,host=3D3.3.3.3,port=3D9001,server,nowait +-chardev socket,id=3Dcompare0-0,host=3D3.3.3.3,port=3D9001 +-chardev socket,id=3Dcompare_out,host=3D3.3.3.3,port=3D9005,server,nowait +-chardev socket,id=3Dcompare_out0,host=3D3.3.3.3,port=3D9005 +-chardev socket,id=3Dnotify_way,host=3D3.3.3.3,port=3D9009,server,nowait +-object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirror0 +-object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,indev=3Dcom= pare_out +-object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outdev=3Dco= mpare0 +-object iothread,id=3Diothread1 +-object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_in=3Dcom= pare1,outdev=3Dcompare_out0,notify_dev=3Dnofity_way,iothread=3Diothread1 + +secondary: +-netdev tap,id=3Dhn0,vhost=3Doff,script=3D/etc/qemu-ifup,down script=3D/et= c/qemu-ifdown +-device e1000,netdev=3Dhn0,mac=3D52:a4:00:12:78:66 +-chardev socket,id=3Dred0,host=3D3.3.3.3,port=3D9003 +-chardev socket,id=3Dred1,host=3D3.3.3.3,port=3D9004 +-object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dred0 +-object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3Dred1 + @end example =20 If you want to know the detail of above command line, you can read --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562041477; cv=none; d=zoho.com; s=zohoarc; b=jMCvwc0GiTV11PYVYqyF9q0Q9aXoLmVSxeFrV3aB5PaFyFriJm4v6t9dDtbgMMFzy9w4i6ulEv3Z5igdOO14HlGlD4RA/pAgShfIfQs9ktW3YLnUr8iWYcvQGSkg3BrCsDBUPwEkexyFAIsHLu7gJqBtHV9rIYfEkIr2aWZ1ek8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562041477; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2YQHZOkzkAYxsHGk0sS3NBEUBMrLRwlncCy0E6kxdus=; b=jklgVvRJ5zSZQz+baOcWYW4NhcOjPuiuZoj/V3/XvMvmO1GDSBW1SCWUkdTqvHLPycsI2bVF1//7GnqoAquTUzcMythmpBu5vdUkWKrf9Q6Czm6K0BEw+Vtzvn6vrfQhgaHnFvRlRwAotsoi1zcwGM0Jxh/cxt/wCVEs8ErpSko= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562041477825681.4034487123929; Mon, 1 Jul 2019 21:24:37 -0700 (PDT) Received: from localhost ([::1]:48680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiALM-0002OR-Id for importer@patchew.org; Tue, 02 Jul 2019 00:24:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50556) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aT-0005Cf-QR for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aS-0003mu-Ny for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36468) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aS-0003la-EL for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:04 -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 A9C3788E5F; Tue, 2 Jul 2019 02:32:03 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1490860C43; Tue, 2 Jul 2019 02:32:01 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:26 +0800 Message-Id: <1562034689-6539-15-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.25]); Tue, 02 Jul 2019 02:32:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/17] COLO-compare: Add remote notification chardev handler frame X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen Add chardev handler to send notification to remote(current from Xen) colo-f= rame. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/colo-compare.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/net/colo-compare.c b/net/colo-compare.c index 10fae2b..fda55d5 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -87,8 +87,10 @@ typedef struct CompareState { CharBackend chr_pri_in; CharBackend chr_sec_in; CharBackend chr_out; + CharBackend chr_notify_dev; SocketReadState pri_rs; SocketReadState sec_rs; + SocketReadState notify_rs; bool vnet_hdr; =20 /* @@ -745,6 +747,19 @@ static void compare_sec_chr_in(void *opaque, const uin= t8_t *buf, int size) } } =20 +static void compare_notify_chr(void *opaque, const uint8_t *buf, int size) +{ + CompareState *s =3D COLO_COMPARE(opaque); + int ret; + + ret =3D net_fill_rstate(&s->notify_rs, buf, size); + if (ret =3D=3D -1) { + qemu_chr_fe_set_handlers(&s->chr_notify_dev, NULL, NULL, NULL, NUL= L, + NULL, NULL, true); + error_report("colo-compare notify_dev error"); + } +} + /* * Check old packet regularly so it can watch for any packets * that the secondary hasn't produced equivalents of. @@ -832,6 +847,11 @@ static void colo_compare_iothread(CompareState *s) qemu_chr_fe_set_handlers(&s->chr_sec_in, compare_chr_can_read, compare_sec_chr_in, NULL, NULL, s, s->worker_context, true); + if (s->notify_dev) { + qemu_chr_fe_set_handlers(&s->chr_notify_dev, compare_chr_can_read, + compare_notify_chr, NULL, NULL, + s, s->worker_context, true); + } =20 colo_compare_timer_init(s); s->event_bh =3D qemu_bh_new(colo_compare_handle_event, s); @@ -943,6 +963,10 @@ static void compare_sec_rs_finalize(SocketReadState *s= ec_rs) } } =20 +static void compare_notify_rs_finalize(SocketReadState *notify_rs) +{ + /* Get Xen colo-frame's notify and handle the message */ +} =20 /* * Return 0 is success. @@ -1013,6 +1037,17 @@ static void colo_compare_complete(UserCreatable *uc,= Error **errp) net_socket_rs_init(&s->pri_rs, compare_pri_rs_finalize, s->vnet_hdr); net_socket_rs_init(&s->sec_rs, compare_sec_rs_finalize, s->vnet_hdr); =20 + /* Try to enable remote notify chardev, currently just for Xen COLO */ + if (s->notify_dev) { + if (find_and_check_chardev(&chr, s->notify_dev, errp) || + !qemu_chr_fe_init(&s->chr_notify_dev, chr, errp)) { + return; + } + + net_socket_rs_init(&s->notify_rs, compare_notify_rs_finalize, + s->vnet_hdr); + } + QTAILQ_INSERT_TAIL(&net_compares, s, next); =20 g_queue_init(&s->conn_list); @@ -1091,6 +1126,10 @@ static void colo_compare_finalize(Object *obj) qemu_chr_fe_deinit(&s->chr_pri_in, false); qemu_chr_fe_deinit(&s->chr_sec_in, false); qemu_chr_fe_deinit(&s->chr_out, false); + if (s->notify_dev) { + qemu_chr_fe_deinit(&s->chr_notify_dev, false); + } + if (s->iothread) { colo_compare_timer_del(s); } --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562039617; cv=none; d=zoho.com; s=zohoarc; b=jvHOBdTDp3sZATqJLK4czHYoVAgH6wp1aIaxunENzetxERk0uueJ+T8pjEjnAW2r+8VCuSoqAayY7j3qJwg0qup19RSqngKH9aa3OdGnd1yX5VGhywu/rpKJ0krnoaeCI+F9aEL7wBRFQJDL1rBwdO00WTJahsH1DSeSike5jJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562039617; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LifF5Ezoi2bV4TVe1+ddH8nhP9ubLsRZd/cP54M3oP0=; b=V00TrEM9SJi0AEMGPDjnIBfteE2H5UdmSuWe90zVmEK7sxzoZh5F/oD2Menz+n625CfnshaeKJwYRdA1fkIKplnpwUZFpSApDFnVmUPfrsmo/247WYmfBPjsc4hYTOkLbYhuS5/V7Y/NtWe2tpQ8hnRWospA/1ZHHIQB6GXnYmE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562039617927651.9771017625352; Mon, 1 Jul 2019 20:53:37 -0700 (PDT) Received: from localhost ([::1]:48258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi9rH-0004e7-KW for importer@patchew.org; Mon, 01 Jul 2019 23:53:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50580) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aW-0005Ja-Ta for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aV-0003p7-Pk for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45732) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aV-0003or-HO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:07 -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 D2196C00735B; Tue, 2 Jul 2019 02:32:06 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FF9160C43; Tue, 2 Jul 2019 02:32:03 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:27 +0800 Message-Id: <1562034689-6539-16-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.32]); Tue, 02 Jul 2019 02:32:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/17] COLO-compare: Make the compare_chr_send() can send notification message. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen We need use this function to send notification message for remote colo-fram= e(Xen). So we add new parameter for this job. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/colo-compare.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index fda55d5..ee03c25 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -129,7 +129,8 @@ static void colo_compare_inconsistency_notify(void) static int compare_chr_send(CompareState *s, const uint8_t *buf, uint32_t size, - uint32_t vnet_hdr_len); + uint32_t vnet_hdr_len, + bool notify_remote_frame); =20 static gint seq_sorter(Packet *a, Packet *b, gpointer data) { @@ -241,7 +242,8 @@ static void colo_release_primary_pkt(CompareState *s, P= acket *pkt) ret =3D compare_chr_send(s, pkt->data, pkt->size, - pkt->vnet_hdr_len); + pkt->vnet_hdr_len, + false); if (ret < 0) { error_report("colo send primary packet failed"); } @@ -671,7 +673,8 @@ static void colo_compare_connection(void *opaque, void = *user_data) static int compare_chr_send(CompareState *s, const uint8_t *buf, uint32_t size, - uint32_t vnet_hdr_len) + uint32_t vnet_hdr_len, + bool notify_remote_frame) { int ret =3D 0; uint32_t len =3D htonl(size); @@ -680,7 +683,14 @@ static int compare_chr_send(CompareState *s, return 0; } =20 - ret =3D qemu_chr_fe_write_all(&s->chr_out, (uint8_t *)&len, sizeof(len= )); + if (notify_remote_frame) { + ret =3D qemu_chr_fe_write_all(&s->chr_notify_dev, + (uint8_t *)&len, + sizeof(len)); + } else { + ret =3D qemu_chr_fe_write_all(&s->chr_out, (uint8_t *)&len, sizeof= (len)); + } + if (ret !=3D sizeof(len)) { goto err; } @@ -691,13 +701,26 @@ static int compare_chr_send(CompareState *s, * know how to parse net packet correctly. */ len =3D htonl(vnet_hdr_len); - ret =3D qemu_chr_fe_write_all(&s->chr_out, (uint8_t *)&len, sizeof= (len)); + + if (!notify_remote_frame) { + ret =3D qemu_chr_fe_write_all(&s->chr_out, + (uint8_t *)&len, + sizeof(len)); + } + if (ret !=3D sizeof(len)) { goto err; } } =20 - ret =3D qemu_chr_fe_write_all(&s->chr_out, (uint8_t *)buf, size); + if (notify_remote_frame) { + ret =3D qemu_chr_fe_write_all(&s->chr_notify_dev, + (uint8_t *)buf, + size); + } else { + ret =3D qemu_chr_fe_write_all(&s->chr_out, (uint8_t *)buf, size); + } + if (ret !=3D size) { goto err; } @@ -943,7 +966,8 @@ static void compare_pri_rs_finalize(SocketReadState *pr= i_rs) compare_chr_send(s, pri_rs->buf, pri_rs->packet_len, - pri_rs->vnet_hdr_len); + pri_rs->vnet_hdr_len, + false); } else { /* compare packet in the specified connection */ colo_compare_connection(conn, s); @@ -1075,7 +1099,8 @@ static void colo_flush_packets(void *opaque, void *us= er_data) compare_chr_send(s, pkt->data, pkt->size, - pkt->vnet_hdr_len); + pkt->vnet_hdr_len, + false); packet_destroy(pkt, NULL); } while (!g_queue_is_empty(&conn->secondary_list)) { --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562041120; cv=none; d=zoho.com; s=zohoarc; b=cZmd+ylzghKKBRNLkfQcUn81o2q60eooAiA8pxSm5DPfLtPJoZhJYTQnM2/TZoGyDYBFuBWpjP6asQVKVaOvZTZx1l5JdQONUoatOyj+RnGhE0M5iAPWALXJJYP/3Yn2rzBL1BP0zsFo9QL2mpPJRVr2qseeV2COBouvjTxfaBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562041120; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZT2dnpFH0Qa2X2D8z4xOAEGsdieu/o4xCXCH4rIezfo=; b=dI3FtRUbe9hHwsXk/Rc+J0DlAVWhXnvbG//q11H2XZyBL6TrOOaW+LgAYREKO0Up0aSOZ/nkqpLiQ+tWjyqce5riU068mvsFqfJIVMfmsH6mUm4E12pFsIGCl3B6AAiqN87bvoJ1A1wDptyNsF37vR7mH2enfGOfuIcvllDAlE0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562041120810130.8337420973562; Mon, 1 Jul 2019 21:18:40 -0700 (PDT) Received: from localhost ([::1]:48592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiAFZ-0004Nt-Fy for importer@patchew.org; Tue, 02 Jul 2019 00:18:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50592) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aZ-0005OH-5O for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aX-0003pa-Up for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45748) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aX-0003pQ-M0 for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:09 -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 F1467C09AD18; Tue, 2 Jul 2019 02:32:08 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59FFD18953; Tue, 2 Jul 2019 02:32:07 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:28 +0800 Message-Id: <1562034689-6539-17-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.32]); Tue, 02 Jul 2019 02:32:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 16/17] COLO-compare: Add colo-compare remote notify support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen This patch make colo-compare can send message to remote COLO frame(Xen) whe= n occur checkpoint. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- net/colo-compare.c | 54 ++++++++++++++++++++++++++++++++++++++++++++------= ---- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index ee03c25..909dd6c 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -120,11 +120,6 @@ enum { SECONDARY_IN, }; =20 -static void colo_compare_inconsistency_notify(void) -{ - notifier_list_notify(&colo_compare_notifiers, - migrate_get_current()); -} =20 static int compare_chr_send(CompareState *s, const uint8_t *buf, @@ -132,6 +127,27 @@ static int compare_chr_send(CompareState *s, uint32_t vnet_hdr_len, bool notify_remote_frame); =20 +static void notify_remote_frame(CompareState *s) +{ + char msg[] =3D "DO_CHECKPOINT"; + int ret =3D 0; + + ret =3D compare_chr_send(s, (uint8_t *)msg, strlen(msg), 0, true); + if (ret < 0) { + error_report("Notify Xen COLO-frame failed"); + } +} + +static void colo_compare_inconsistency_notify(CompareState *s) +{ + if (s->notify_dev) { + notify_remote_frame(s); + } else { + notifier_list_notify(&colo_compare_notifiers, + migrate_get_current()); + } +} + static gint seq_sorter(Packet *a, Packet *b, gpointer data) { struct tcp_hdr *atcp, *btcp; @@ -435,7 +451,7 @@ sec: qemu_hexdump((char *)spkt->data, stderr, "colo-compare spkt", spkt->size); =20 - colo_compare_inconsistency_notify(); + colo_compare_inconsistency_notify(s); } } =20 @@ -577,7 +593,7 @@ void colo_compare_unregister_notifier(Notifier *notify) } =20 static int colo_old_packet_check_one_conn(Connection *conn, - void *user_data) + CompareState *s) { GList *result =3D NULL; int64_t check_time =3D REGULAR_PACKET_CHECK_MS; @@ -588,7 +604,7 @@ static int colo_old_packet_check_one_conn(Connection *c= onn, =20 if (result) { /* Do checkpoint will flush old packet */ - colo_compare_inconsistency_notify(); + colo_compare_inconsistency_notify(s); return 0; } =20 @@ -608,7 +624,7 @@ static void colo_old_packet_check(void *opaque) * If we find one old packet, stop finding job and notify * COLO frame do checkpoint. */ - g_queue_find_custom(&s->conn_list, NULL, + g_queue_find_custom(&s->conn_list, s, (GCompareFunc)colo_old_packet_check_one_conn); } =20 @@ -637,7 +653,8 @@ static void colo_compare_packet(CompareState *s, Connec= tion *conn, */ trace_colo_compare_main("packet different"); g_queue_push_head(&conn->primary_list, pkt); - colo_compare_inconsistency_notify(); + + colo_compare_inconsistency_notify(s); break; } } @@ -989,7 +1006,24 @@ static void compare_sec_rs_finalize(SocketReadState *= sec_rs) =20 static void compare_notify_rs_finalize(SocketReadState *notify_rs) { + CompareState *s =3D container_of(notify_rs, CompareState, notify_rs); + /* Get Xen colo-frame's notify and handle the message */ + char *data =3D g_memdup(notify_rs->buf, notify_rs->packet_len); + char msg[] =3D "COLO_COMPARE_GET_XEN_INIT"; + int ret; + + if (!strcmp(data, "COLO_USERSPACE_PROXY_INIT")) { + ret =3D compare_chr_send(s, (uint8_t *)msg, strlen(msg), 0, true); + if (ret < 0) { + error_report("Notify Xen COLO-frame INIT failed"); + } + } + + if (!strcmp(data, "COLO_CHECKPOINT")) { + /* colo-compare do checkpoint, flush pri packet and remove sec pac= ket */ + g_queue_foreach(&s->conn_list, colo_flush_packets, s); + } } =20 /* --=20 2.5.0 From nobody Sun May 19 20:29:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562041404; cv=none; d=zoho.com; s=zohoarc; b=Q73NS+De92PQNc1S0MWy2sl8hQgNctdvKBLBdmYxVgzVRi5GwcibWHzQl0Z0uEeE7/jLqGxm0FUCbglNDWH9z7p695rSpObI7/kGXULXpFekh/e36Wc5VOC5Zdg4uZq8vSKUpckzQxctxdPSDhdPJYFXEBxXrVM530ZCk1Jx5s8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562041404; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=TaoMuxfQn3X1PJc++ImBfzoOixyB57AwID3FahbJeto=; b=ZTfbidkLUeThyKwZ+JCMefrnRm3mGAuA6zh24uPiteoXO2OON13qNVbS/Z9+pfEOUlFBviVcJDefMgPSatfS2qK6ET1x+z5ldaBD2mkQxCQemmF4XDIyDGKgmJm2KsAzZKGjVtxTjFXOpd/NVptTq2bHBbEQHWbJN0ALmqDZ8zM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15620414045834.372911231806938; Mon, 1 Jul 2019 21:23:24 -0700 (PDT) Received: from localhost ([::1]:48632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiAK5-0000YH-7m for importer@patchew.org; Tue, 02 Jul 2019 00:23:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50609) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hi8aa-0005RX-QC for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hi8aZ-0003qF-Uk for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hi8aZ-0003q5-OO for qemu-devel@nongnu.org; Mon, 01 Jul 2019 22:32:11 -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 15F8F821C7; Tue, 2 Jul 2019 02:32:11 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-232.pek2.redhat.com [10.72.12.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id 779B260C43; Tue, 2 Jul 2019 02:32:09 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 2 Jul 2019 10:31:29 +0800 Message-Id: <1562034689-6539-18-git-send-email-jasowang@redhat.com> In-Reply-To: <1562034689-6539-1-git-send-email-jasowang@redhat.com> References: <1562034689-6539-1-git-send-email-jasowang@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.28]); Tue, 02 Jul 2019 02:32:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 17/17] migration/colo.c: Add missed filter notify for Xen COLO. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , Jason Wang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen We need to notify net filter to do checkpoint for Xen COLO, like KVM side. Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- migration/colo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 8c16440..9f84b1f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -259,6 +259,8 @@ ReplicationStatus *qmp_query_xen_replication_status(Err= or **errp) void qmp_xen_colo_do_checkpoint(Error **errp) { replication_do_checkpoint_all(errp); + /* Notify all filters of all NIC to do checkpoint */ + colo_notify_filters_event(COLO_EVENT_CHECKPOINT, errp); } #endif =20 --=20 2.5.0