From nobody Fri Apr 11 15:59:34 2025 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=1594821283; cv=none; d=zohomail.com; s=zohoarc; b=LU0Z+aJ86bVBQFbxFH0t5A3ifA7vLsRekzAp+qYMHCTPmvqGfOp7XhylJqIKYgLvBCVI2uZjdm0Ntue+ix7n46kDoV1UrJZxJydvEA4N81kYSEPT1+KDypjhW1xHhTqBus7e5EM3WLvR3ClcsnEfJCpZeqtuVPKAAVbZiPdy8IQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594821283; h=Content-Type: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=w85ALhbZJIWqBZs4TodH+Ktr0CFpkx0wPRvmrKgX/54=; b=TPG1l6T3Y62B/z8lL7eBpPunY2oPocRncpUebK4Y2f1JA7blN2YaNy7b+feiLa3bOUY3o2kw3mtIRAucDviZisQLX+83CYxoxQIWTapiPZR8y81/8L3gBLitDhYTEgo6ljKn2nbqSdwO6K4+GBfywuCkJQE4rfhb4fyCrPlv0Eo= 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 1594821283810881.812092057013; Wed, 15 Jul 2020 06:54:43 -0700 (PDT) Received: from localhost ([::1]:58138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvhru-0004CY-DJ for importer@patchew.org; Wed, 15 Jul 2020 09:54:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvhqr-0002nx-T1 for qemu-devel@nongnu.org; Wed, 15 Jul 2020 09:53:37 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45682 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jvhqp-0005Ju-IF for qemu-devel@nongnu.org; Wed, 15 Jul 2020 09:53:37 -0400 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-507-mN0sqVA3PWavkmrTMDebzA-1; Wed, 15 Jul 2020 09:53:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81650E91C; Wed, 15 Jul 2020 13:53:31 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-12-28.pek2.redhat.com [10.72.12.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B1FB5C57D; Wed, 15 Jul 2020 13:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594821214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=w85ALhbZJIWqBZs4TodH+Ktr0CFpkx0wPRvmrKgX/54=; b=Av7d6JyTL7B+SSBqGftDVotZ9Rs6RPzvuoPX1zio8V1LbrCG+EtvpCX/g/lMmsVE4ss8eH oQkDTVDnsK41MtZadgUxeNjie7JJ6q3pTKdAWQ8qLuZNaCQXyc0wOoDjS3hpffpN+t6Z+H dlNMJmWrW+ktundD3Ew3z6lRpr911oU= X-MC-Unique: mN0sqVA3PWavkmrTMDebzA-1 From: Jason Wang To: peter.maydell@linaro.org Subject: [PULL 1/7] virtio-net: fix removal of failover device Date: Wed, 15 Jul 2020 21:53:15 +0800 Message-Id: <1594821201-3708-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1594821201-3708-1-git-send-email-jasowang@redhat.com> References: <1594821201-3708-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.120; envelope-from=jasowang@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/15 05:07:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H2=-1, 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: Jason Wang , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Juan Quintela If you have a networking device and its virtio failover device, and you remove them in this order: - virtio device - the real device You get qemu crash. See bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=3D1820120 Bug exist on qemu 4.2 and 5.0. But in 5.0 don't shows because commit 77b06bba62034a87cc61a9c8de1309ae3e527d97 somehow papers over it. CC: Jason Wang CC: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Acked-by: Laurent Vivier Signed-off-by: Juan Quintela Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 10cc958..4895af1 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3416,6 +3416,7 @@ static void virtio_net_device_unrealize(DeviceState *= dev) g_free(n->vlans); =20 if (n->failover) { + device_listener_unregister(&n->primary_listener); g_free(n->primary_device_id); g_free(n->standby_id); qobject_unref(n->primary_device_dict); --=20 2.5.0