Skip to contentSkip to conversation

virtio: Complete feature negotation before updating status

PATCH New Rusty Russell 1 participant 1 message Jun 15, 2008 virtio core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio: Complete feature negotation before updating status

From: Mark McLoughlin <[email protected]>

lguest (in rusty's use-tun-ringfd patch) assumes that the guest has updated its feature bits before setting its status to VIRTIO_CONFIG_S_DRIVER_OK.

That's pretty reasonable, so let's make it so.

---
 drivers/virtio/virtio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virtio/virtio.c +1 -1
index ab0aca7..fc85cba 100644
@@ -117,9 +117,9 @@ static int virtio_dev_probe(struct device *_d)
 	if (err)
 		add_status(dev, VIRTIO_CONFIG_S_FAILED);
 	else {
-		add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
 		/* They should never have set feature bits beyond 32 */
 		dev->config->set_features(dev, dev->features[0]);
+		add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
 	}
 	return err;
 }