mirror of https://github.com/xemu-project/xemu.git
virtio: stop ioeventfd on reset
All calls to virtio_bus_reset are preceded by virtio_bus_stop_ioeventfd, move the call in virtio_bus_reset: that makes sense and clarifies that the vdc->reset function is called with ioeventfd already stopped. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a44bed2f54
commit
9e43a83041
|
@ -253,7 +253,6 @@ static void virtio_ccw_reset_virtio(VirtioCcwDevice *dev)
|
||||||
{
|
{
|
||||||
CcwDevice *ccw_dev = CCW_DEVICE(dev);
|
CcwDevice *ccw_dev = CCW_DEVICE(dev);
|
||||||
|
|
||||||
virtio_ccw_stop_ioeventfd(dev);
|
|
||||||
virtio_bus_reset(&dev->bus);
|
virtio_bus_reset(&dev->bus);
|
||||||
if (dev->indicators) {
|
if (dev->indicators) {
|
||||||
release_indicator(&dev->routes.adapter, dev->indicators);
|
release_indicator(&dev->routes.adapter, dev->indicators);
|
||||||
|
|
|
@ -104,6 +104,7 @@ void virtio_bus_reset(VirtioBusState *bus)
|
||||||
VirtIODevice *vdev = virtio_bus_get_device(bus);
|
VirtIODevice *vdev = virtio_bus_get_device(bus);
|
||||||
|
|
||||||
DPRINTF("%s: reset device.\n", BUS(bus)->name);
|
DPRINTF("%s: reset device.\n", BUS(bus)->name);
|
||||||
|
virtio_bus_stop_ioeventfd(bus);
|
||||||
if (vdev != NULL) {
|
if (vdev != NULL) {
|
||||||
virtio_reset(vdev);
|
virtio_reset(vdev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -376,8 +376,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
virtio_mmio_stop_ioeventfd(proxy);
|
virtio_bus_reset(&vdev->bus);
|
||||||
virtio_reset(vdev);
|
|
||||||
} else {
|
} else {
|
||||||
virtio_queue_set_addr(vdev, vdev->queue_sel,
|
virtio_queue_set_addr(vdev, vdev->queue_sel,
|
||||||
value << proxy->guest_page_shift);
|
value << proxy->guest_page_shift);
|
||||||
|
@ -628,7 +627,6 @@ static void virtio_mmio_reset(DeviceState *d)
|
||||||
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
|
VirtIOMMIOProxy *proxy = VIRTIO_MMIO(d);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
virtio_mmio_stop_ioeventfd(proxy);
|
|
||||||
virtio_bus_reset(&proxy->bus);
|
virtio_bus_reset(&proxy->bus);
|
||||||
proxy->host_features_sel = 0;
|
proxy->host_features_sel = 0;
|
||||||
proxy->guest_features_sel = 0;
|
proxy->guest_features_sel = 0;
|
||||||
|
|
|
@ -1945,7 +1945,6 @@ static void virtio_pci_reset(DeviceState *qdev)
|
||||||
PCIDevice *dev = PCI_DEVICE(qdev);
|
PCIDevice *dev = PCI_DEVICE(qdev);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
virtio_pci_stop_ioeventfd(proxy);
|
|
||||||
virtio_bus_reset(bus);
|
virtio_bus_reset(bus);
|
||||||
msix_unuse_all_vectors(&proxy->pci_dev);
|
msix_unuse_all_vectors(&proxy->pci_dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue