virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 1/3] virtio: add API to detect legacy devices
@ 2014-12-04 17:26 Michael S. Tsirkin
  2014-12-04 17:26 ` [PATCH RFC 2/3] virtio_ccw: legacy: don't negotiate rev 1/features Michael S. Tsirkin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michael S. Tsirkin @ 2014-12-04 17:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Hildenbrand, virtualization

transports need to be able to detect legacy-only
devices (ATM balloon only) to use legacy path
to drive them.

Add a core API to do just that.
The implementation just blacklists balloon:
not too pretty, but let's not over-engineer.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/linux/virtio.h  | 2 ++
 drivers/virtio/virtio.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 2bbf626..d666bcb 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -108,6 +108,8 @@ struct virtio_device {
 	void *priv;
 };
 
+bool virtio_device_is_legacy_only(struct virtio_device_id id);
+
 static inline struct virtio_device *dev_to_virtio(struct device *_dev)
 {
 	return container_of(_dev, struct virtio_device, dev);
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index fa6b75d..6b4c1113 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -267,6 +267,12 @@ static struct bus_type virtio_bus = {
 	.remove = virtio_dev_remove,
 };
 
+bool virtio_device_is_legacy_only(struct virtio_device_id id)
+{
+	return id.device == VIRTIO_ID_BALLOON;
+}
+EXPORT_SYMBOL_GPL(register_virtio_driver);
+
 int register_virtio_driver(struct virtio_driver *driver)
 {
 	/* Catch this early. */
-- 
MST

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-04 18:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 17:26 [PATCH RFC 1/3] virtio: add API to detect legacy devices Michael S. Tsirkin
2014-12-04 17:26 ` [PATCH RFC 2/3] virtio_ccw: legacy: don't negotiate rev 1/features Michael S. Tsirkin
2014-12-04 17:56   ` Cornelia Huck
2014-12-04 18:09     ` Michael S. Tsirkin
2014-12-04 17:26 ` [PATCH RFC 3/3] virtio_ccw: rev 1 devices set VIRTIO_F_VERSION_1 Michael S. Tsirkin
2014-12-04 17:59   ` Cornelia Huck
2014-12-04 18:09     ` Michael S. Tsirkin
2014-12-04 18:15     ` Michael S. Tsirkin
2014-12-04 17:54 ` [PATCH RFC 1/3] virtio: add API to detect legacy devices Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).