mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
virtio: Support transports which can specify the vring alignment
Support virtio transports which can specify the vring alignment (ie where the guest communicates this to the host) by providing a new virtio_queue_set_align() function. (The default alignment remains as before.) Transports which wish to make use of this must set the has_variable_vring_alignment field in their VirtioBusClass struct to true; they can then change the alignment via virtio_queue_set_align(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1373977512-28932-5-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
e63c0ba1bc
commit
6ce69d1c77
3 changed files with 36 additions and 3 deletions
|
@ -62,6 +62,12 @@ typedef struct VirtioBusClass {
|
|||
* This is called by virtio-bus just before the device is unplugged.
|
||||
*/
|
||||
void (*device_unplug)(DeviceState *d);
|
||||
/*
|
||||
* Does the transport have variable vring alignment?
|
||||
* (ie can it ever call virtio_queue_set_align()?)
|
||||
* Note that changing this will break migration for this transport.
|
||||
*/
|
||||
bool has_variable_vring_alignment;
|
||||
} VirtioBusClass;
|
||||
|
||||
struct VirtioBusState {
|
||||
|
|
|
@ -202,6 +202,7 @@ void virtio_queue_set_addr(VirtIODevice *vdev, int n, hwaddr addr);
|
|||
hwaddr virtio_queue_get_addr(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_num(VirtIODevice *vdev, int n, int num);
|
||||
int virtio_queue_get_num(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_align(VirtIODevice *vdev, int n, int align);
|
||||
void virtio_queue_notify(VirtIODevice *vdev, int n);
|
||||
uint16_t virtio_queue_vector(VirtIODevice *vdev, int n);
|
||||
void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue