Skip to content

Commit

Permalink
virtio-fs: set the VIRTIO_F_VERSION_1 feature bit
Browse files Browse the repository at this point in the history
The virtio-fs is a modern virtio-only device in its current QEMU
implementation. Until now, we failed to set the corresponding
VIRTIO_F_VERSION_1 feauture bit in the driver, but the device did not
complain. But as of QEMU commit 2ffc54708087c6e524297957be2fc5d543abb767
this changed and virtiofsd fails if this feature bit is not offered by
the driver. This patches the driver to offer said feature bit.

Signed-off-by: Fotis Xenakis <[email protected]>
Message-Id: <AM0PR03MB6292D10F4C395A70C59C28AAA6EF0@AM0PR03MB6292.eurprd03.prod.outlook.com>
  • Loading branch information
foxeng authored and wkozaczuk committed Nov 8, 2020
1 parent 571e8f2 commit d16c789
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/virtio-fs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ fs::fs(virtio_device& virtio_dev)

// Step 8
add_dev_status(VIRTIO_CONFIG_S_DRIVER_OK);
// sleep(10);

// TODO: Don't ignore the virtio-fs tag and use that instead of _id for
// identifying the device (e.g. something like /dev/virtiofs/<tag> or at
Expand Down Expand Up @@ -207,6 +208,12 @@ int fs::make_request(fuse_request& req)
return 0;
}

u64 fs::get_driver_features()
{
auto base = virtio_driver::get_driver_features();
return base | ((u64)1 << VIRTIO_F_VERSION_1);
}

hw_driver* fs::probe(hw_device* dev)
{
return virtio::probe<fs, VIRTIO_ID_FS>(dev);
Expand Down
2 changes: 2 additions & 0 deletions drivers/virtio-fs.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public:
virtual std::string get_name() const { return _driver_name; }
void read_config();

virtual u64 get_driver_features();

int make_request(fuse_request&);
dax_window* get_dax() {
return (_dax.addr != mmio_nullptr) ? &_dax : nullptr;
Expand Down

0 comments on commit d16c789

Please sign in to comment.