Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1018425ybz; Thu, 16 Apr 2020 00:59:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJJ264pDUWTuAGhzugRDyJjossuLfVV+1IPlLOAuGIdkLFRZxcGSifhUA04wJ/DWzs0ONGt X-Received: by 2002:a05:6402:1:: with SMTP id d1mr29995358edu.282.1587023986292; Thu, 16 Apr 2020 00:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587023986; cv=none; d=google.com; s=arc-20160816; b=CuZ/N6Av/KjP83Z4h13A9+5htCe/BeJgPAEaC1Hiyc3idhPcMiPv5pmYx1DEejjPnm PfjLrAFELvBmmDdAR3Nynptk7B+8B6oJWmBatKIBWbCXcX7kr2gW37NICkhQtxbrb57U Qko+ns6kjUKFGSY6/urLGZ3T7o64pm4Oao9Mo9S5tiiOcAy7rX1liNuQORByTMHBfWa/ XiSllla/ad7PtiVoLploW9Uqy6HpexizbivZ12XUKOWYxHmk7wvbn8SxDlRvhkWo1YGk Zhm+qFIfchz1vvT9xbzgAA5wOb6EvZwyg9NlFtOx3nF4FeNQ43vaRHrtF00pdZfDL072 32vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=idl26PH4x2DDa3aO5wcLhHmY07eZSjGnVzySfXlVtnM=; b=QtLk5YhTMe+YYNZ8OouIznVak/d9hEmR1hPG7OOOXjx+xt9y2qbMmgkiPJv6uoIuY0 itjeYtUzVjZ9fyXnM9cPUgUfLaOFEEOx91hEiyC0GiyZnyh9myg3gRaOB6DptlXmyqln Wj3/CJQKlgqKSokva3v5PJTepkTj3O1IKfdYTKn/6Qb0hNH6o5qeVflDZiKZfxOkIPov SzNzuiDYfQ5hqEUWEcc0PoBq/tuD7BkAFwnDm7qBR2KFfi7nbimkPkgZboii1SRrhyMh LXdV4/harH2dMWkBjWKQVop4XgIz8g4UXWmfhaTrBoTUjhlQH+C8D7OlTtWMOXCLarrB f28g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GqTVfrN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si12010185edd.234.2020.04.16.00.59.22; Thu, 16 Apr 2020 00:59:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GqTVfrN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440958AbgDPH5q (ORCPT + 99 others); Thu, 16 Apr 2020 03:57:46 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34240 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2440092AbgDPH5N (ORCPT ); Thu, 16 Apr 2020 03:57:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587023830; 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=idl26PH4x2DDa3aO5wcLhHmY07eZSjGnVzySfXlVtnM=; b=GqTVfrN+hdyr0VjlH/+ojxFk5FMXE+UAM+s1yj0CCoUUKidPbrEnDjooKvzSw66ioxVcSg tBaRZ3mccHg7PCy93vSPrQ22mjSqWdmwqYjAt9gRpdmULOty6HsfbAGO/bBDqtfRIAIPjZ GKFP1PG4BvcwTvzgnPV1LCS4vqiLscc= 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-488-1NCnUh1hM8KXoG3rcApRbA-1; Thu, 16 Apr 2020 03:57:05 -0400 X-MC-Unique: 1NCnUh1hM8KXoG3rcApRbA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 988288024D6; Thu, 16 Apr 2020 07:57:03 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-112-194.ams2.redhat.com [10.36.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33E8B7E7C0; Thu, 16 Apr 2020 07:57:01 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: Stephen Rothwell , "virtualization@lists.linux-foundation.org" , Christian Borntraeger , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Linux Next Mailing List , kvm list , Cornelia Huck , Halil Pasic , "linux-kernel@vger.kernel.org" Subject: [PATCH v2 4/8] vhost: Fix bad order in vhost_test_set_backend at enable Date: Thu, 16 Apr 2020 09:56:39 +0200 Message-Id: <20200416075643.27330-5-eperezma@redhat.com> In-Reply-To: <20200416075643.27330-1-eperezma@redhat.com> References: <20200416075643.27330-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The reset was not done properly: A init call was given with no active backend. This solves that. Fixes: ("7c48601a3d4d tools/virtio: Add --reset=3Drandom") Signed-off-by: Eugenio P=C3=A9rez --- drivers/vhost/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 789c096e454b..6aed0cab8b17 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -293,8 +293,8 @@ static long vhost_test_set_backend(struct vhost_test = *n, unsigned index, int fd) backend =3D vhost_vq_get_backend(vq); vhost_vq_set_backend(vq, NULL); } else { - r =3D vhost_vq_init_access(vq); vhost_vq_set_backend(vq, backend); + r =3D vhost_vq_init_access(vq); if (r =3D=3D 0) r =3D vhost_poll_start(&vq->poll, vq->kick); } --=20 2.18.1