unikraft / pykraft

Python library for configuring and building unikernels
Other
177 stars 42 forks source link

9pfs mounting doesn't work with `kraft run` #71

Closed razvand closed 2 years ago

razvand commented 3 years ago

Describe the bug

A 9pfs configuration in the kraft.yaml file, similar to the one below, isn't used correctly by kraft run:

volumes:
  guest_fs:
    driver: 9pfs

The comparison on this line fails:

            if volume.driver is VolumeDriver.VOL_9PFS:

preventing the filesystem from being mounted (i.e. the runner.add_virtio_9pfs(path)) isn't called.

What worked for me was replacing the troubling line with:

            if volume.driver == VolumeDriver.VOL_9PFS.name:

Mounting is successful when manually using the qemu-guest script or the qemu-system-x86_64 command. It's the kraft run command that triggers this issue.

To Reproduce

I created a repository for the issue. See the README.md for details on configuring, building and running.

Expected behavior

The 9pfs mounting of a local directory inside the KVM virtual machine should work when using kraft run.

Desktop (please complete the following information):

razvand commented 3 years ago

A similar comparison happens in the automount() function in runner.py but this seems to be only used for a dry run. I think this should be fixed as well.