mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: "Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	virtualization@lists.linux.dev
Subject: [PATCH 03/14] tools/virtio: use kernel's virtio.h
Date: Thu, 4 Dec 2025 13:46:06 -0500	[thread overview]
Message-ID: <33daf1033fc447eb8e3e54d21013ccfd99550e37.1764873799.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1764873799.git.mst@redhat.com>

Replace virtio stubs with an include of the kernel header.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tools/virtio/linux/virtio.h | 73 +------------------------------------
 1 file changed, 1 insertion(+), 72 deletions(-)

diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index 5d3440f474dd..d3029c944589 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -1,72 +1 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef LINUX_VIRTIO_H
-#define LINUX_VIRTIO_H
-#include <linux/scatterlist.h>
-#include <linux/kernel.h>
-#include <linux/spinlock.h>
-
-struct device {
-	void *parent;
-};
-
-struct virtio_device {
-	struct device dev;
-	u64 features;
-	struct list_head vqs;
-	spinlock_t vqs_list_lock;
-	const struct virtio_config_ops *config;
-};
-
-struct virtqueue {
-	struct list_head list;
-	void (*callback)(struct virtqueue *vq);
-	const char *name;
-	struct virtio_device *vdev;
-        unsigned int index;
-        unsigned int num_free;
-	unsigned int num_max;
-	void *priv;
-	bool reset;
-};
-
-/* Interfaces exported by virtio_ring. */
-int virtqueue_add_sgs(struct virtqueue *vq,
-		      struct scatterlist *sgs[],
-		      unsigned int out_sgs,
-		      unsigned int in_sgs,
-		      void *data,
-		      gfp_t gfp);
-
-int virtqueue_add_outbuf(struct virtqueue *vq,
-			 struct scatterlist sg[], unsigned int num,
-			 void *data,
-			 gfp_t gfp);
-
-int virtqueue_add_inbuf(struct virtqueue *vq,
-			struct scatterlist sg[], unsigned int num,
-			void *data,
-			gfp_t gfp);
-
-bool virtqueue_kick(struct virtqueue *vq);
-
-void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len);
-
-void virtqueue_disable_cb(struct virtqueue *vq);
-
-bool virtqueue_enable_cb(struct virtqueue *vq);
-bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
-
-void *virtqueue_detach_unused_buf(struct virtqueue *vq);
-struct virtqueue *vring_new_virtqueue(unsigned int index,
-				      unsigned int num,
-				      unsigned int vring_align,
-				      struct virtio_device *vdev,
-				      bool weak_barriers,
-				      bool ctx,
-				      void *pages,
-				      bool (*notify)(struct virtqueue *vq),
-				      void (*callback)(struct virtqueue *vq),
-				      const char *name);
-void vring_del_virtqueue(struct virtqueue *vq);
-
-#endif
+#include <../../include/linux/virtio.h>
-- 
MST


  parent reply	other threads:[~2025-12-04 18:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 18:45 [PATCH 00/14] tools/virtio: cleanups, fixes Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 01/14] tools/virtio: fix up compiler.h stub Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 02/14] virtio: make it self-contained Michael S. Tsirkin
2025-12-04 18:46 ` Michael S. Tsirkin [this message]
2025-12-04 18:46 ` [PATCH 04/14] tools/virtio: add struct module forward declaration Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 05/14] tools/virtio: stub DMA mapping functions Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 06/14] tools/virtio: add dev_WARN_ONCE and is_vmalloc_addr stubs Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 07/14] tools/virtio: add ucopysize.h stub Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 08/14] tools/virtio: pass KCFLAGS to module build Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 09/14] tools/virtio: add struct cpumask to cpumask.h Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 10/14] tools/virtio: stub might_sleep and synchronize_rcu Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 11/14] tools/virtio: switch to kernel's virtio_config.h Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 12/14] virtio_features: make it self-contained Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 13/14] tools/virtio: fix up oot build Michael S. Tsirkin
2025-12-04 18:46 ` [PATCH 14/14] tools/virtio: add device, device_driver stubs Michael S. Tsirkin
2025-12-09 13:09 ` [PATCH 00/14] tools/virtio: cleanups, fixes Michael S. Tsirkin
2025-12-10  6:24   ` Jason Wang
2025-12-10  7:01     ` Michael S. Tsirkin
2025-12-11  7:12     ` Michael S. Tsirkin
2025-12-11  7:22       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33daf1033fc447eb8e3e54d21013ccfd99550e37.1764873799.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®