Skip to content

Commit

Permalink
virtio: Complete feature negotation before updating status
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
markmc authored and torvalds committed Jun 15, 2008
1 parent 0269c5c commit b92dea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,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;
}
Expand Down

0 comments on commit b92dea6

Please sign in to comment.