Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp683011ybb; Fri, 3 Apr 2020 09:54:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIZyUallmQpbwMR97fWRwtLtcFAVxwklYUax+fEOiTteaNKRHHW4Ibyu3t9Rn97OAXAzlwC X-Received: by 2002:a54:4711:: with SMTP id k17mr3856641oik.104.1585932844090; Fri, 03 Apr 2020 09:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585932844; cv=none; d=google.com; s=arc-20160816; b=yjWMe/qKaHvvvOBxHCeR8F9a51KwdxbDWRyIOel9u5ESEJyiFOe+icfK6X6YhmBZe6 +g+mDmPyNStYv9YILduEp9Jsv41285G8cF2e/qVhsJlfDjj8Vhuwx+71r8eTiW1+HQiK ZYtOCSWAzBkvUTkzYEHu63cwfUj1zEmxoEnZBCFkzEDAjRSsX6iNFQjlZEbNX2azGW9+ WsCR+nmIadL25DNCUOaLEtanLaJxbkWMBMYj9wAdLwjdmkCpdpIp17pmB5WJth+ctcnL XjtAZd2jC/QPbeY+4SH57tdrCGMrMsL6Av6dLoYAHNQSgN+k42FWnn5iE8ljt1rDadQJ Hi3g== 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=aN2Tdmti93bJvp05aP5Wo/WChS6LzifB+hgWbinbaeh64Gey2FolDp0rMst8VCxbyc I7Dgk6oMG6LudCaOQ0c+6cEfE4L1cVflk6ck/1qWdocdJ5aPHWsLpxdMyGiUsfiNba3r jLrCL+1WS8JVnK8sxT6jY7lgsJ/EBbYeyB+bMLUKUNSSGdq7OLcTmM2cTTBemzX59VXB gUvN0sVAoL43uU/fOoJ23aKLunVoQovb+qRCJ/YfyciLVm9dDXp2v2K4IW/9LUqdbY12 ljaOqQnfzpvEjLNbqXSdUmnM3ot9vFVs5MQ6348Y0kpCTC2wvtSU4YcWx9sDAkxmdKey GpRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XkSF5u4y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f41si3944343otf.280.2020.04.03.09.53.51; Fri, 03 Apr 2020 09:54:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XkSF5u4y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2404669AbgDCQwD (ORCPT + 99 others); Fri, 3 Apr 2020 12:52:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:31729 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404655AbgDCQwB (ORCPT ); Fri, 3 Apr 2020 12:52:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585932720; 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=XkSF5u4yxEUq9IfIqHE4l0Xm0d78gZvwxFpp5IBSN8JreRnSeC+u+XUopGlp7gXlkkDH3z yi+aIsRZnJm09h34KAAD/dRrN5T0Ef6PlJ/ZlCWkUqjzm7lMg6UFAZ9ja+/uPzIgl5AbAf TpJ09imSPcVZ1KZgCqEsABYteJl54Y0= 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-93-22eF_FI-NECPEOFPgRuKEw-1; Fri, 03 Apr 2020 12:51:59 -0400 X-MC-Unique: 22eF_FI-NECPEOFPgRuKEw-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 BAABD477; Fri, 3 Apr 2020 16:51:57 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50155A0A7B; Fri, 3 Apr 2020 16:51:55 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: kvm list , "virtualization@lists.linux-foundation.org" , Linux Next Mailing List , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Stephen Rothwell , Cornelia Huck , Halil Pasic , "linux-kernel@vger.kernel.org" , Christian Borntraeger Subject: [PATCH 8/8] tools/virtio: Use tools/include/list.h instead of stubs Date: Fri, 3 Apr 2020 18:51:19 +0200 Message-Id: <20200403165119.5030-9-eperezma@redhat.com> In-Reply-To: <20200403165119.5030-1-eperezma@redhat.com> References: <20200403165119.5030-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 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