aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-12-08 20:07:48 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-12 07:59:38 -0600
commit6d74ca5aa83b83fb52332f7735c61ecb7a5328c1 (patch)
tree6ea05e57ca0165275eda7e6d57cecd5fd52757b6 /hw/virtio.h
parentb3c3f123f785fb861d930080f083507b51f5ce79 (diff)
virtio: verify features on load
migrating between hosts which have different features might break silently, if the migration destination does not support some features supported by source. Prevent this from happening by comparing acked feature bits with the mask supported by the device. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r--hw/virtio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/virtio.h b/hw/virtio.h
index 15ad910768..35532a6f25 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -31,6 +31,11 @@
/* We've given up on this device. */
#define VIRTIO_CONFIG_S_FAILED 0x80
+/* Some virtio feature bits (currently bits 28 through 31) are reserved for the
+ * transport being used (eg. virtio_ring), the rest are per-device feature bits. */
+#define VIRTIO_TRANSPORT_F_START 28
+#define VIRTIO_TRANSPORT_F_END 32
+
/* We notify when the ring is completely used, even if the guest is suppressing
* callbacks */
#define VIRTIO_F_NOTIFY_ON_EMPTY 24
@@ -82,6 +87,7 @@ typedef struct {
void (*save_queue)(void * opaque, int n, QEMUFile *f);
int (*load_config)(void * opaque, QEMUFile *f);
int (*load_queue)(void * opaque, int n, QEMUFile *f);
+ unsigned (*get_features)(void * opaque);
} VirtIOBindings;
#define VIRTIO_PCI_QUEUE_MAX 16