Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1550452ybz; Sat, 18 Apr 2020 03:25:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLTbhi1ds7aOhaxe9f2UInUqwiphhRGzZcrnEcFNZUezvWRQ9TBJWL0fF5YUsIT/kPeiv4Y X-Received: by 2002:a17:906:ecb8:: with SMTP id qh24mr7047538ejb.299.1587205515848; Sat, 18 Apr 2020 03:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587205515; cv=none; d=google.com; s=arc-20160816; b=wFx5nHmfDJEF4Vm1ccQp9717/x1vZOrWEbzOY6ug8b7BjtM0O3oDR+qHncHN4uxS42 kugoqjwUNHNYwq9jzop+tJxRsvvxPK6etmd/CW1lOqLwupfzhpvi+W7WNPVIUcWT+6DM 3uH8P79YSNEjiRIpQGfkohUNWHem7ngoyak6S3zcorG+nhn0RS5zYeGiw1UydD8a52Rz oWoVWSQRwo8xq6IMZqvw3POJFT57fNgkZLUVYe9VVNad1L1aomCcfkl7WYek99oGMWNm l1dd3wSR1QNpvhnajU3+UZM1picqJUlGVSM2ytnec+sqKr3O2+SXuUlFFPkFdNUMr2lr 587g== 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=yMmscrcPxrNtAuLRokAXM6YRXQcJoZNIY/bvDej50a4=; b=a/+rn8W/cUupLLpReVfbCghaHKfes9cSwVrIJ8MSNbDr9dhG4WORkP58+u7ijxQ29r bBeoBQ0sOxNypDy4gZqKFy3lJo1TMkvD6V4B5/LLazhhZ3aOgE25pjjkztIw41UGRcws j5f53qBFQ8dYZJaV34ul/pycj0Ksdenfk5lpTkdpyXAEiLt5MABuq0GnDvgF5+Rfnsnv njzC5hUfo1Y2ThToYvn6vmM/Svi1NkPg72JOD9QCjo+SmYIDGMmFC8oH2t2NpqU8BEFc sQpoVSPISDnkbB188kqV0rOa7/UOoa4NQfxPgeXnauxVCmcLS0MaX0QstsdQqQVZgqCN BWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UM/64TOB"; 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 13si13138055ejz.499.2020.04.18.03.24.52; Sat, 18 Apr 2020 03:25:15 -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="UM/64TOB"; 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 S1726152AbgDRKXi (ORCPT + 99 others); Sat, 18 Apr 2020 06:23:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59168 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726069AbgDRKXB (ORCPT ); Sat, 18 Apr 2020 06:23:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587205381; 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=yMmscrcPxrNtAuLRokAXM6YRXQcJoZNIY/bvDej50a4=; b=UM/64TOBWv6n4kzr/K8GgKbLraMN0myoxwShKCZBy6v8AliA1n0NWVZfAlCtajvqBYpq6h iTBQi0fBJ/MazNMIDQQGreSh11g1rzsnJDtSk4Ibu4ahoXODInyjGY29owqhipeoZjvoEs I/YFERJvWExPPxR8s7WYddO7wKME18o= 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-152-dY7kaFdrOMSwWQ2TvupALw-1; Sat, 18 Apr 2020 06:22:56 -0400 X-MC-Unique: dY7kaFdrOMSwWQ2TvupALw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8676F1005509; Sat, 18 Apr 2020 10:22:55 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-112-94.ams2.redhat.com [10.36.112.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 320621000325; Sat, 18 Apr 2020 10:22:52 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , Halil Pasic , Cornelia Huck , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Christian Borntraeger , kvm list , Stephen Rothwell , Linux Next Mailing List Subject: [PATCH v3 8/8] tools/virtio: Use tools/include/list.h instead of stubs Date: Sat, 18 Apr 2020 12:22:17 +0200 Message-Id: <20200418102217.32327-9-eperezma@redhat.com> In-Reply-To: <20200418102217.32327-1-eperezma@redhat.com> References: <20200418102217.32327-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It should not make any significant difference but reduce stub code. Signed-off-by: Eugenio P=C3=A9rez --- tools/virtio/linux/kernel.h | 7 +------ tools/virtio/linux/virtio.h | 5 ++--- tools/virtio/virtio_test.c | 1 + tools/virtio/vringh_test.c | 2 ++ 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 6683b4a70b05..caab980211a6 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -11,6 +11,7 @@ =20 #include #include +#include #include #include #include @@ -135,10 +136,4 @@ static inline void free_page(unsigned long addr) (void) (&_min1 =3D=3D &_min2); \ _min1 < _min2 ? _min1 : _min2; }) =20 -/* TODO: empty stubs for now. Broken but enough for virtio_ring.c */ -#define list_add_tail(a, b) do {} while (0) -#define list_del(a) do {} while (0) -#define list_for_each_entry(a, b, c) while (0) -/* end of stubs */ - #endif /* KERNEL_H */ diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index b751350d4ce8..5d90254ddae4 100644 --- a/tools/virtio/linux/virtio.h +++ b/tools/virtio/linux/virtio.h @@ -11,12 +11,11 @@ struct device { struct virtio_device { struct device dev; u64 features; + struct list_head vqs; }; =20 struct virtqueue { - /* TODO: commented as list macros are empty stubs for now. - * Broken but enough for virtio_ring.c - * struct list_head list; */ + struct list_head list; void (*callback)(struct virtqueue *vq); const char *name; struct virtio_device *vdev; diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c index 82902fc3ba2a..cb3f29c09aff 100644 --- a/tools/virtio/virtio_test.c +++ b/tools/virtio/virtio_test.c @@ -129,6 +129,7 @@ static void vdev_info_init(struct vdev_info* dev, uns= igned long long features) int r; memset(dev, 0, sizeof *dev); dev->vdev.features =3D features; + INIT_LIST_HEAD(&dev->vdev.vqs); dev->buf_size =3D 1024; dev->buf =3D malloc(dev->buf_size); assert(dev->buf); diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index 293653463303..fa87b58bd5fa 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio/vringh_test.c @@ -307,6 +307,7 @@ static int parallel_test(u64 features, close(to_host[0]); =20 gvdev.vdev.features =3D features; + INIT_LIST_HEAD(&gvdev.vdev.vqs); gvdev.to_host_fd =3D to_host[1]; gvdev.notifies =3D 0; =20 @@ -453,6 +454,7 @@ int main(int argc, char *argv[]) =20 getrange =3D getrange_iov; vdev.features =3D 0; + INIT_LIST_HEAD(&vdev.vqs); =20 while (argv[1]) { if (strcmp(argv[1], "--indirect") =3D=3D 0) --=20 2.18.1