diff options
| author | Michael S. Tsirkin <mst@redhat.com> | 2014-10-13 20:10:35 -0400 |
|---|---|---|
| committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-10-14 19:54:55 -0400 |
| commit | c6716bae52f97347e25166c6270aa98693d9212c (patch) | |
| tree | 0a8cf01f68e1eb0c0e403c24e9fbf1d76ccb3568 /include/linux | |
| parent | 016c98c6fe0c914d12e2e242b2bccde6d6dea54b (diff) | |
virtio-pci: move freeze/restore to virtio core
This is in preparation to extending config changed event handling
in core.
Wrapping these in an API also seems to make for a cleaner code.
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/virtio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 3c19bd3189cb..8df7ba81e5c7 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -78,6 +78,7 @@ bool virtqueue_is_broken(struct virtqueue *vq); | |||
| 78 | /** | 78 | /** |
| 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 | * @dev: underlying device. | 82 | * @dev: underlying device. |
| 82 | * @id: the device type identification (used to match it with a driver). | 83 | * @id: the device type identification (used to match it with a driver). |
| 83 | * @config: the configuration ops for this device. | 84 | * @config: the configuration ops for this device. |
| @@ -88,6 +89,7 @@ bool virtqueue_is_broken(struct virtqueue *vq); | |||
| 88 | */ | 89 | */ |
| 89 | struct virtio_device { | 90 | struct virtio_device { |
| 90 | int index; | 91 | int index; |
| 92 | bool failed; | ||
| 91 | struct device dev; | 93 | struct device dev; |
| 92 | struct virtio_device_id id; | 94 | struct virtio_device_id id; |
| 93 | const struct virtio_config_ops *config; | 95 | const struct virtio_config_ops *config; |
| @@ -109,6 +111,10 @@ void unregister_virtio_device(struct virtio_device *dev); | |||
| 109 | void virtio_break_device(struct virtio_device *dev); | 111 | void virtio_break_device(struct virtio_device *dev); |
| 110 | 112 | ||
| 111 | void virtio_config_changed(struct virtio_device *dev); | 113 | void virtio_config_changed(struct virtio_device *dev); |
| 114 | #ifdef CONFIG_PM_SLEEP | ||
| 115 | int virtio_device_freeze(struct virtio_device *dev); | ||
| 116 | int virtio_device_restore(struct virtio_device *dev); | ||
| 117 | #endif | ||
| 112 | 118 | ||
| 113 | /** | 119 | /** |
| 114 | * virtio_driver - operations for a virtio I/O driver | 120 | * virtio_driver - operations for a virtio I/O driver |
