From patchwork Wed Mar 30 15:14:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 8698331 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4A35C0553 for ; Wed, 30 Mar 2016 15:15:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CEEB20389 for ; Wed, 30 Mar 2016 15:15:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6DFB20383 for ; Wed, 30 Mar 2016 15:15:07 +0000 (UTC) Received: from localhost ([::1]:54768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alHpq-0007Oo-Uq for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Mar 2016 11:15:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alHpY-0007G7-4W for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:14:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alHpS-0001jd-Ak for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:14:48 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:60792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alHpS-0001jZ-5l for qemu-devel@nongnu.org; Wed, 30 Mar 2016 11:14:42 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O4U007H2YCHK440@mailout4.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 30 Mar 2016 16:14:41 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-91-56fbed61a03c Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id D5.F0.05254.16DEBF65; Wed, 30 Mar 2016 16:14:41 +0100 (BST) Received: from imaximets.rnd.samsung.ru ([106.109.129.180]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O4U00ACPYBSOO90@eusync1.samsung.com>; Wed, 30 Mar 2016 16:14:41 +0100 (BST) From: Ilya Maximets To: qemu-devel@nongnu.org, "Michael S. Tsirkin" Date: Wed, 30 Mar 2016 18:14:09 +0300 Message-id: <1459350849-31989-5-git-send-email-i.maximets@samsung.com> X-Mailer: git-send-email 2.5.0 In-reply-to: <1459350849-31989-1-git-send-email-i.maximets@samsung.com> References: <1459350849-31989-1-git-send-email-i.maximets@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7qJb3+HGTx4yGFxpf0nu8WyS5+Z LP7/esVqcbx3B4vF5NlSDqweT65tZvJ4v+8qm0ffllWMAcxRXDYpqTmZZalF+nYJXBn9T2aw Fkxkq/i16BdrA+NSli5GDg4JAROJTS1CXYycQKaYxIV769m6GLk4hASWMko8/vmZCcJpZZK4 vHsVM0gVm4COxKnVRxhBbBEBB4kvTT+YQGxmgRKJQ79OsoPYwgJuEsvO/wCzWQRUJR79ngxW wwsU37L0IyPEYjmJBRfSQcKcAu4Syzf+ZwGxhYBKdv2YwjyBkXcBI8MqRtHU0uSC4qT0XEO9 4sTc4tK8dL3k/NxNjJBQ+bKDcfExq0OMAhyMSjy8G6R/hwmxJpYVV+YeYpTgYFYS4V35EijE m5JYWZValB9fVJqTWnyIUZqDRUmcd+6u9yFCAumJJanZqakFqUUwWSYOTqkGRudDH3U4pBTK Oll1P8Q3ddW9U+6/8+pqvJtWLd8p6fr+eSaWk6wWbBAqesKz9lHRMo6dqo+/yH67KLzHnIlv Hc9swVhGf1G9qjXVb3Mf87/sr771kHHKYzXtu3sFLv58EB0fbf/w38KnN+7cn29euUE6fIHL W5sj8x6u6W7NcNY/0vc43pvvlRJLcUaioRZzUXEiADguOzQRAgAA X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.14 Cc: Ilya Maximets , Jason Wang , Dyasly Sergey Subject: [Qemu-devel] [PATCH 4/4] net: notify about link status only if it changed. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No need to notify nc->peer if nothing changed. Signed-off-by: Ilya Maximets --- net/net.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/net.c b/net/net.c index 3b5a142..6f6a8ce 100644 --- a/net/net.c +++ b/net/net.c @@ -1385,9 +1385,10 @@ void qmp_set_link(const char *name, bool up, Error **errp) for (i = 0; i < queues; i++) { ncs[i]->peer->link_down = !up; } - } - if (nc->peer->info->link_status_changed) { - nc->peer->info->link_status_changed(nc->peer); + + if (nc->peer->info->link_status_changed) { + nc->peer->info->link_status_changed(nc->peer); + } } } }