Add new entry surprize_removal to struct virtio_device. When a virtio transport driver is notified about a lost device it should set surprize_removal to true. A backend driver can test this flag in order to perform specific actions that might be appropriate wrt the device loss. Signed-off-by: Heinz Graalfs <graalfs@xxxxxxxxxxxxxxxxxx> --- drivers/virtio/virtio.c | 1 + include/linux/virtio.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index ee59b74..290d1e2 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -115,6 +115,7 @@ static int virtio_dev_probe(struct device *_d) /* We have a driver! */ add_status(dev, VIRTIO_CONFIG_S_DRIVER); + dev->surprize_removal = false; /* Figure out what features the device supports. */ device_features = dev->config->get_features(dev); diff --git a/include/linux/virtio.h b/include/linux/virtio.h index f15f6e7..131404a 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -98,6 +98,7 @@ struct virtio_device { struct list_head vqs; /* Note that this is a Linux set_bit-style bitmap. */ unsigned long features[1]; + bool surprize_removal; void *priv; }; -- 1.8.3.1 _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization