From nobody Fri Dec 19 03:59:17 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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; dkim=fail; spf=pass (zohomail.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=1574696756; cv=none; d=zohomail.com; s=zohoarc; b=fwuD4yZUoHU9n76O6oEuOo47OUjP/i1+sJPbOHZkHiM8d0w6xj2OKji8QOI/ansZTq4RDwnnLRMBx5frRfvDkU6ReTk5dJcul3q6/Wpd/e2cAFQbPQpu+gzDp98SWaKpH+vQq7Ucnk9V7BSgsk4OrvT33CaOd2bLxk36mR4IP6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574696756; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/r48QDVkIew/2iuv/vLqFDvHS62as2rMwRzoaxrIwbM=; b=WCjxgA7qCFN1XwNcPzoASd6RX9e/9RQ6ppTObEOSpDCM2aUYzn2X9+t0112nbi9Y68BNriWm4/dbF+NZP8YoQZPBZR+AmXxF2G73objHmUQR5BGooNS91te5ZoWppdFAXk/RXHsJCN2TNerJpbIIIfUGogjqHPlHE31HRqNCP5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1574696756736799.7341927385826; Mon, 25 Nov 2019 07:45:56 -0800 (PST) Received: from localhost ([::1]:45572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZGYl-0005Fm-3d for importer@patchew.org; Mon, 25 Nov 2019 10:45:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33945) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZGTQ-0000C0-Ro for qemu-devel@nongnu.org; Mon, 25 Nov 2019 10:40:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZGTP-0002OC-Bn for qemu-devel@nongnu.org; Mon, 25 Nov 2019 10:40:24 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:27820 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZGTP-0002N2-7U for qemu-devel@nongnu.org; Mon, 25 Nov 2019 10:40:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-275-gTf_oTU9M3KT0l9EDZvcJg-1; Mon, 25 Nov 2019 10:40:18 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5633DBB0; Mon, 25 Nov 2019 15:40:17 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 054845D9CA; Mon, 25 Nov 2019 15:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574696422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/r48QDVkIew/2iuv/vLqFDvHS62as2rMwRzoaxrIwbM=; b=XgNCCi4Qsz6VFJBWPMCL3DB3UNvo7FZv452jtenotAVeJd8D22pA7gpbElunlR4Jq8I1WU 40LQOoIcasLQtJlN/Itywgy0iDAE3AFQD09VFjiZopb8+WtP4VNgzcGJccXvSz2ykXcmea Fcxu9mw/7ynkx2nSqlJKf34IOx8Q2K4= From: Jason Wang To: peter.maydell@linaro.org Subject: [PULL 2/4] net/virtio: return early when failover primary alread added Date: Mon, 25 Nov 2019 23:40:05 +0800 Message-Id: <1574696407-4188-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1574696407-4188-1-git-send-email-jasowang@redhat.com> References: <1574696407-4188-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: gTf_oTU9M3KT0l9EDZvcJg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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 , Jens Freimann , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jens Freimann Bail out when primary device was already added before. This avoids printing a wrong warning message during reboot. Fixes: 9711cd0dfc3f ("net/virtio: add failover support") Signed-off-by: Jens Freimann Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 946039c..ac4d191 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -759,6 +759,10 @@ static void failover_add_primary(VirtIONet *n, Error *= *errp) { Error *err =3D NULL; =20 + if (n->primary_dev) { + return; + } + n->primary_device_opts =3D qemu_opts_find(qemu_find_opts("device"), n->primary_device_id); if (n->primary_device_opts) { --=20 2.5.0