[SLOF] [PATCH v3 06/22] virtio-{blk, 9p}: enable resetting the device

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Fri Jan 22 21:54:49 AEDT 2016


With the lack of the virtio_queue_init_vq routine, driver like
virtio-blk and virtio-9p had disabled device reset in the
initialization code. This helper will fix that problem, as the
initialization can be done after the device reset.

Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth at redhat.com>
---
 lib/libvirtio/virtio-9p.c  | 6 +-----
 lib/libvirtio/virtio-blk.c | 5 +----
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/lib/libvirtio/virtio-9p.c b/lib/libvirtio/virtio-9p.c
index 719ac1a..6f0c844 100644
--- a/lib/libvirtio/virtio-9p.c
+++ b/lib/libvirtio/virtio-9p.c
@@ -175,11 +175,7 @@ int virtio_9p_init(struct virtio_device *dev, void *tx_buf, void *rx_buf,
         dprintf("%s : device at %p\n", __func__, dev->base);
         dprintf("%s : type is %04x\n", __func__, dev->type);
 
-	/* Reset device */
-	// XXX That will clear the virtq base. We need to move
-	//     initializing it to here anyway
-	//
-	//	 virtio_reset_device(dev);
+	virtio_reset_device(dev);
 
 	/* Acknowledge device. */
 	virtio_set_status(dev, VIRTIO_STAT_ACKNOWLEDGE);
diff --git a/lib/libvirtio/virtio-blk.c b/lib/libvirtio/virtio-blk.c
index fe50af8..2f2d83b 100644
--- a/lib/libvirtio/virtio-blk.c
+++ b/lib/libvirtio/virtio-blk.c
@@ -32,10 +32,7 @@ virtioblk_init(struct virtio_device *dev)
 	int features;
 
 	/* Reset device */
-	// XXX That will clear the virtq base. We need to move
-	//     initializing it to here anyway
-	//
-	//	 virtio_reset_device(dev);
+	virtio_reset_device(dev);
 
 	/* Acknowledge device. */
 	virtio_set_status(dev, VIRTIO_STAT_ACKNOWLEDGE);
-- 
2.5.0



More information about the SLOF mailing list