diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-03-17 13:08:05 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-04-01 13:56:43 -0500 |
commit | 3e607cb503acbd8606e5d42e6b80adcf1ccf9a92 (patch) | |
tree | d807a3e205951a642cfbc913367959ad3abdb6f8 /hw/virtio-pci.c | |
parent | 1cbdabe203164433fbbec3a1815d8be42a085c88 (diff) | |
download | qemu-3e607cb503acbd8606e5d42e6b80adcf1ccf9a92.zip qemu-3e607cb503acbd8606e5d42e6b80adcf1ccf9a92.tar.gz qemu-3e607cb503acbd8606e5d42e6b80adcf1ccf9a92.tar.bz2 |
virtio: add set_status callback
vhost net backend needs to be notified when
frontend status changes. Add a callback,
similar to set_features.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r-- | hw/virtio-pci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index e23ab91..a8b15bd 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -219,7 +219,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) virtio_queue_notify(vdev, val); break; case VIRTIO_PCI_STATUS: - vdev->status = val & 0xFF; + virtio_set_status(vdev, val & 0xFF); if (vdev->status == 0) { virtio_reset(proxy->vdev); msix_unuse_all_vectors(&proxy->pci_dev); @@ -399,7 +399,8 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, if (PCI_COMMAND == address) { if (!(val & PCI_COMMAND_MASTER)) { if (!(proxy->bugs & VIRTIO_PCI_BUG_BUS_MASTER)) { - proxy->vdev->status &= ~VIRTIO_CONFIG_S_DRIVER_OK; + virtio_set_status(proxy->vdev, + proxy->vdev->status & ~VIRTIO_CONFIG_S_DRIVER_OK); } } } |