From nobody Tue Feb 10 05:09:58 2026 Delivered-To: importer@patchew.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=1605689877; cv=none; d=zohomail.com; s=zohoarc; b=hIv89dZaLNWl2YIUiq3BGSF4xxZ9h41fEL9TX80jPuPz6PHJFmB+4rV0bprRcEeUZuaL8QbLNCC3SwNrXKNG3LwwZ/LMOmFRTjqSjo287wYn+ALGah358Y5YoG5dnaZSilkqkZeVF20ezWSpK+AXVN3AuAlfRWrmIBhbVSt0Oy8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605689877; 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; bh=ZitZm1Vwi2HnXMn3z66NARvXR7SABBnylrQjF1/e6gA=; b=JhGaDZEWWULPOsvFFxKbbF/7cc9x0z01ocn6ShIZOzUF5fq2V2N/SADX0aA6Z51gZ6ZWcM6ohKs6y+gEgv62jgr9Bxv04rF7RVQ8LbJUnNtLsUvMkIkPVLtlmnG2UzjYdxQWUNXOqvFIXAQgkBqIorBK2+Zsx7PRe4FqH9hXb3A= 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 1605689877610513.148449284168; Wed, 18 Nov 2020 00:57:57 -0800 (PST) Received: from localhost ([::1]:37814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfJHo-00048x-Gw for importer@patchew.org; Wed, 18 Nov 2020 03:57:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfIyn-0002gP-3s for qemu-devel@nongnu.org; Wed, 18 Nov 2020 03:38:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kfIyl-0005Zl-93 for qemu-devel@nongnu.org; Wed, 18 Nov 2020 03:38:16 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-517-HLgCnaWyN5KNi7lhfMCsaQ-1; Wed, 18 Nov 2020 03:38:12 -0500 Received: by mail-wr1-f71.google.com with SMTP id f4so621345wru.21 for ; Wed, 18 Nov 2020 00:38:10 -0800 (PST) Received: from localhost (trasno.trasno.org. [83.165.45.250]) by smtp.gmail.com with ESMTPSA id g20sm2430408wmh.20.2020.11.18.00.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 00:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605688694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZitZm1Vwi2HnXMn3z66NARvXR7SABBnylrQjF1/e6gA=; b=QP6tIbe81jBobUreHGDiXapKTQE830nskrYnFLUyp7FoDOh2CJvy4uowLa0wiqk8ALoaa3 IPpyhgfTIbCwn0L5rxCJbTe/yEwoWdk/CvGUfj8TtEwEh3oLRHqoXNwsncR3W5EmmKFIMj 9zPVQnu+IZLIXBO02aqcXgJMVGpx7GY= X-MC-Unique: HLgCnaWyN5KNi7lhfMCsaQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZitZm1Vwi2HnXMn3z66NARvXR7SABBnylrQjF1/e6gA=; b=axMxBhFcQP+5pWT0plg1dtn5bSUOpN6WX38px7SRU6L+I5NG64H8lIF8NCO0Gw/a97 OQMfrgtBjIRScFZ4pFBleAtsLd9CpC+JP7VkQPBDPCdydqEwLIrWVWHdxl5wa5kyufcg CnIaa+3RMWSuB2V43xn0oMu+YQQoe72QEJlcS+ss81MZWhNGLjL1T8/k4/3+n/88j4xv 6mimoyG9h0e5gjGUab+J7xT6o+AQYu811zPeKzAQ+gYgIrw215MX2TKRhSF5XAg5JcZm wzVEDJohgvTI0sxaVk8IyIOGMUI/pKHoKhDkc8tWGUcvLq4/gPjQ3DOsffjKZDy4ggcO EnkQ== X-Gm-Message-State: AOAM531N4K6aiQDjMnkFW1emZDmJZVfi88xKfcP9GqdAzHoeOV/RmHX5 +sXM6oTzZOO2U08op0fpEWkHTdUhrztrSgY/R10kv9WIPVVRftzW/3ioucDAYMqfG9Fh7Weel2S 1DaJ/1VFE/9LvKnYWcsVEOUz9Y+gkzusdEoDfJ1YlEhnUHBQccAvpLsg06vwVXpGppXM= X-Received: by 2002:a5d:438f:: with SMTP id i15mr3641768wrq.121.1605688688930; Wed, 18 Nov 2020 00:38:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQ18jcbOr6Gmtt7X4KYo6tTBzCANLH9k9sFW1+G1gKTfomoE1GlExq1RvLniJpbK7Z6tPG/Q== X-Received: by 2002:a5d:438f:: with SMTP id i15mr3641748wrq.121.1605688688746; Wed, 18 Nov 2020 00:38:08 -0800 (PST) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PATCH v2 12/27] failover: Remove primary_device_dict Date: Wed, 18 Nov 2020 09:37:33 +0100 Message-Id: <20201118083748.1328-13-quintela@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201118083748.1328-1-quintela@redhat.com> References: <20201118083748.1328-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 00:38:29 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , Jason Wang , Juan Quintela , "Dr. David Alan Gilbert" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" It was only used once. And we have there opts->id, so no need for it. Signed-off-by: Juan Quintela --- include/hw/virtio/virtio-net.h | 1 - hw/net/virtio-net.c | 17 ++++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index a055f39dd6..fe353d8299 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -202,7 +202,6 @@ struct VirtIONet { AnnounceTimer announce_timer; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; - QDict *primary_device_dict; DeviceState *primary_dev; char *primary_device_id; /* primary failover device is hidden*/ diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 953d5c2bc8..6e5a56a230 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3186,28 +3186,21 @@ static int virtio_net_primary_should_be_hidden(Devi= ceListener *listener, if (!device_opts) { return -1; } - n->primary_device_dict =3D qemu_opts_to_qdict(device_opts, - n->primary_device_dict); standby_id =3D qemu_opt_get(device_opts, "failover_pair_id"); if (g_strcmp0(standby_id, n->netclient_name) =3D=3D 0) { match_found =3D true; } else { match_found =3D false; hide =3D false; - n->primary_device_dict =3D NULL; goto out; } =20 /* failover_primary_hidden is set during feature negotiation */ hide =3D qatomic_read(&n->failover_primary_hidden); - - if (n->primary_device_dict) { - g_free(n->primary_device_id); - n->primary_device_id =3D g_strdup(qdict_get_try_str( - n->primary_device_dict, "id")); - if (!n->primary_device_id) { - warn_report("primary_device_id not set"); - } + g_free(n->primary_device_id); + n->primary_device_id =3D g_strdup(device_opts->id); + if (!n->primary_device_id) { + warn_report("primary_device_id not set"); } =20 out: @@ -3396,8 +3389,6 @@ static void virtio_net_device_unrealize(DeviceState *= dev) if (n->failover) { device_listener_unregister(&n->primary_listener); g_free(n->primary_device_id); - qobject_unref(n->primary_device_dict); - n->primary_device_dict =3D NULL; } =20 max_queues =3D n->multiqueue ? n->max_queues : 1; --=20 2.26.2