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

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



Hello Roxana,

Thank you. The patch seems fine. I will upstream later today.

Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>

Thanks & Regards
Sharan Santhanam


On 6/3/19 10:43 AM, Roxana Nicolescu wrote:
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.


_______________________________________________
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®.