aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/virtio.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-14 19:51:55 -0400
committerRusty Russell <rusty@rustcorp.com.au>2014-10-14 19:54:56 -0400
commit22b7050a024d7deb0c9ef1e14ed73e3b1e369f24 (patch)
treebe21b9a75aa1b5a95d8bb3ab7bf9470669e643bb /include/linux/virtio.h
parentc6716bae52f97347e25166c6270aa98693d9212c (diff)
virtio: defer config changed notifications
Defer config changed notifications that arrive during probe/scan/freeze/restore. This will allow drivers to set DRIVER_OK earlier, without worrying about racing with config change interrupts. This change will also benefit old hypervisors (before 2009) that send interrupts without checking DRIVER_OK: previously, the callback could race with driver-specific initialization. This will also help simplify drivers. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (cosmetic changes)
Diffstat (limited to 'include/linux/virtio.h')
-rw-r--r--include/linux/virtio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 8df7ba81e5c7..65261a7244fc 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -79,6 +79,9 @@ bool virtqueue_is_broken(struct virtqueue *vq);
79 * virtio_device - representation of a device using virtio 79 * virtio_device - representation of a device using virtio
80 * @index: unique position on the virtio bus 80 * @index: unique position on the virtio bus
81 * @failed: saved value for CONFIG_S_FAILED bit (for restore) 81 * @failed: saved value for CONFIG_S_FAILED bit (for restore)
82 * @config_enabled: configuration change reporting enabled
83 * @config_change_pending: configuration change reported while disabled
84 * @config_lock: protects configuration change reporting
82 * @dev: underlying device. 85 * @dev: underlying device.
83 * @id: the device type identification (used to match it with a driver). 86 * @id: the device type identification (used to match it with a driver).
84 * @config: the configuration ops for this device. 87 * @config: the configuration ops for this device.
@@ -90,6 +93,9 @@ bool virtqueue_is_broken(struct virtqueue *vq);
90struct virtio_device { 93struct virtio_device {
91 int index; 94 int index;
92 bool failed; 95 bool failed;
96 bool config_enabled;
97 bool config_change_pending;
98 spinlock_t config_lock;
93 struct device dev; 99 struct device dev;
94 struct virtio_device_id id; 100 struct virtio_device_id id;
95 const struct virtio_config_ops *config; 101 const struct virtio_config_ops *config;