As Avi pointed out, as we continue to massage the virtio PCI ABI, we can make
things a little more friendly to users by utilizing the PCI revision field to
indicate which version of the ABI we're using.  This is a hard ABI version
and incrementing it will cause the guest driver to break.

This is the QEMU portion.

Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]>

diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
index 1e8fb44..78d679f 100644
--- a/qemu/hw/virtio.c
+++ b/qemu/hw/virtio.c
@@ -47,6 +47,9 @@
 
 #define VIRTIO_PCI_CONFIG              20
 
+/* Virtio ABI version, if we increment this, we break the guest driver. */
+#define VIRTIO_PCI_ABI_VERSION         0
+
 /* QEMU doesn't strictly need write barriers since everything runs in
  * lock-step.  We'll leave the calls to wmb() in though to make it obvious for
  * KVM or if kqemu gets SMP support.
@@ -434,6 +437,8 @@ VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name,
     config[0x02] = device & 0xFF;
     config[0x03] = (device >> 8) & 0xFF;
 
+    config[0x08] = VIRTIO_PCI_ABI_VERSION;
+
     config[0x09] = pif;
     config[0x0a] = subclass_code;
     config[0x0b] = class_code;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to