mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
b3c3f123f7
commit
6d74ca5aa8
4 changed files with 37 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue