Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b92dea67 authored by Mark McLoughlin's avatar Mark McLoughlin Committed by Linus Torvalds
Browse files

virtio: Complete feature negotation before updating status



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: default avatarMark McLoughlin <markmc@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0269c5c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -124,9 +124,9 @@ static int virtio_dev_probe(struct device *_d)
	if (err)
	if (err)
		add_status(dev, VIRTIO_CONFIG_S_FAILED);
		add_status(dev, VIRTIO_CONFIG_S_FAILED);
	else {
	else {
		add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
		/* They should never have set feature bits beyond 32 */
		/* They should never have set feature bits beyond 32 */
		dev->config->set_features(dev, dev->features[0]);
		dev->config->set_features(dev, dev->features[0]);
		add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
	}
	}
	return err;
	return err;
}
}