Skip to content

Commit b92dea6

Browse files
markmctorvalds
authored andcommitted
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: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0269c5c commit b92dea6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/virtio/virtio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ static int virtio_dev_probe(struct device *_d)
124124
if (err)
125125
add_status(dev, VIRTIO_CONFIG_S_FAILED);
126126
else {
127-
add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
128127
/* They should never have set feature bits beyond 32 */
129128
dev->config->set_features(dev, dev->features[0]);
129+
add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
130130
}
131131
return err;
132132
}

0 commit comments

Comments
 (0)