[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] plat/virtio: Reset device helper



This patch adds the reset device helper function.

Signed-off-by: Roxana Nicolescu <nicolescu.roxana1996@xxxxxxxxx>
---
 plat/drivers/include/virtio/virtio_bus.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/plat/drivers/include/virtio/virtio_bus.h 
b/plat/drivers/include/virtio/virtio_bus.h
index 88d09066..72a82983 100644
--- a/plat/drivers/include/virtio/virtio_bus.h
+++ b/plat/drivers/include/virtio/virtio_bus.h
@@ -146,6 +146,28 @@ int virtio_bus_register_device(struct virtio_dev *vdev);
 void _virtio_bus_register_driver(struct virtio_driver *vdrv);
 
 /**
+ * This function resets the virtio device .
+ * @param vdev
+ *     Reference to the virtio device
+ * @return
+ *     0 on successful updating the status.
+ *     -ENOTSUP, if the operation is not supported on the virtio device.
+ */
+static inline int virtio_dev_reset(struct virtio_dev *vdev)
+{
+       int rc = -ENOTSUP;
+
+       UK_ASSERT(vdev);
+
+       if (likely(vdev->cops->device_reset)) {
+               vdev->cops->device_reset(vdev);
+               rc = 0;
+       }
+
+       return rc;
+}
+
+/**
  * The function updates the status of the virtio device
  * @param vdev
  *      Reference to the virtio device.
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.