qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] virtio-pci: Improve device plugging whith legacy backends
@ 2016-09-09 13:10 Maxime Coquelin
  2016-09-09 13:10 ` [Qemu-devel] [PATCH v2 1/2] virtio: Add function to check whether backend supports VIRTIO_1 Maxime Coquelin
  2016-09-09 13:10 ` [Qemu-devel] [PATCH v2 2/2] virtio-pci: Disable modern interface if backend without VIRTIO_F_VERSION_1 Maxime Coquelin
  0 siblings, 2 replies; 13+ messages in thread
From: Maxime Coquelin @ 2016-09-09 13:10 UTC (permalink / raw)
  To: mst, qemu-devel, cornelia.huck
  Cc: marcel, vkaplans, qemu-stable, Maxime Coquelin

This series makes device plugging more robust, to avoid guest to be confused
when the backend doesn't support VIRTIO_F_VERSION_1.

The problem is seen with Linux guests running mainline kernels, when backend
doesn't support the feature:
virtio_net virtio0: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1.
When it happens, the modern device probe returns -EINVAL, whereas its caller
expects -ENODEV being returned to switch to legacy device probing.

We need to make QEMU more robust to ensure the guest won't be confused,
so this series exposes modern interface only when backend support it.

It has been tested with vhost-net and vhost-user backends in client
and server modes.

Changes since v1:
-----------------
 - Make the backend feature check function specialized to only VIRTIO_1

Maxime Coquelin (2):
  virtio: Add function to check whether backend supports VIRTIO_1
  virtio-pci: Disable modern interface if backend without
    VIRTIO_F_VERSION_1

 hw/virtio/virtio-pci.c     | 15 +++++++++++++++
 hw/virtio/virtio-pci.h     |  5 +++++
 hw/virtio/virtio.c         | 13 +++++++++++++
 include/hw/virtio/virtio.h |  1 +
 4 files changed, 34 insertions(+)

-- 
2.7.4

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

end of thread, other threads:[~2016-09-12 16:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09 13:10 [Qemu-devel] [PATCH v2 0/2] virtio-pci: Improve device plugging whith legacy backends Maxime Coquelin
2016-09-09 13:10 ` [Qemu-devel] [PATCH v2 1/2] virtio: Add function to check whether backend supports VIRTIO_1 Maxime Coquelin
2016-09-09 17:00   ` Marcel Apfelbaum
2016-09-09 17:47     ` Michael S. Tsirkin
2016-09-09 17:49       ` Maxime Coquelin
2016-09-11  8:04       ` Marcel Apfelbaum
2016-09-12 12:28   ` Cornelia Huck
2016-09-12 16:42     ` Maxime Coquelin
2016-09-12 16:54       ` Michael S. Tsirkin
2016-09-09 13:10 ` [Qemu-devel] [PATCH v2 2/2] virtio-pci: Disable modern interface if backend without VIRTIO_F_VERSION_1 Maxime Coquelin
2016-09-09 17:04   ` Marcel Apfelbaum
2016-09-09 17:48   ` Michael S. Tsirkin
2016-09-09 17:56     ` Maxime Coquelin

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).