mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
virtio: move ioeventfd_started flag to VirtioBusState
This simplifies the code and removes the ioeventfd_started and ioeventfd_set_started callback. The only difference is in how virtio-ccw handles an error---it doesn't disable ioeventfd forever anymore. It was the only backend to do so, and if desired this behavior should be implemented in virtio-bus.c. Instead of ioeventfd_started, the ioeventfd_assign callback now determines whether the virtio bus supports host notifiers. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
4ddcc2d5cb
commit
b13d396227
10 changed files with 16 additions and 79 deletions
|
@ -89,25 +89,9 @@ typedef struct {
|
|||
uint32_t guest_page_shift;
|
||||
/* virtio-bus */
|
||||
VirtioBusState bus;
|
||||
bool ioeventfd_started;
|
||||
bool format_transport_address;
|
||||
} VirtIOMMIOProxy;
|
||||
|
||||
static bool virtio_mmio_ioeventfd_started(DeviceState *d)
|
||||
{
|
||||
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
|
||||
|
||||
return proxy->ioeventfd_started;
|
||||
}
|
||||
|
||||
static void virtio_mmio_ioeventfd_set_started(DeviceState *d, bool started,
|
||||
bool err)
|
||||
{
|
||||
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
|
||||
|
||||
proxy->ioeventfd_started = started;
|
||||
}
|
||||
|
||||
static bool virtio_mmio_ioeventfd_disabled(DeviceState *d)
|
||||
{
|
||||
return !kvm_eventfds_enabled();
|
||||
|
@ -547,8 +531,6 @@ static void virtio_mmio_bus_class_init(ObjectClass *klass, void *data)
|
|||
k->save_config = virtio_mmio_save_config;
|
||||
k->load_config = virtio_mmio_load_config;
|
||||
k->set_guest_notifiers = virtio_mmio_set_guest_notifiers;
|
||||
k->ioeventfd_started = virtio_mmio_ioeventfd_started;
|
||||
k->ioeventfd_set_started = virtio_mmio_ioeventfd_set_started;
|
||||
k->ioeventfd_disabled = virtio_mmio_ioeventfd_disabled;
|
||||
k->ioeventfd_assign = virtio_mmio_ioeventfd_assign;
|
||||
k->has_variable_vring_alignment = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue