5 Commits

Author SHA1 Message Date
Simon Glass
878f27e552 fs: Use an empty string for the root directory
It is easier to use an empty string when the root directory is intended.
Adjust the code to drop use of "/" and NULL and just use and empty
string.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 14:29:06 +02:00
Simon Glass
1560075474 virtio: Correct dir creation to use existing stream
Rather than creating a new stream, which gets lost, virtio_fs_dir_open()
should use the existing one. Fix it, so that the fh member is preserved
for future use.

This fixes a problem where the fh value is not preserved, thus causing
a subsequent 'ls' on the same directory to fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: #15
2025-07-12 14:29:06 +02:00
Simon Glass
753438e516 virtio: Add a little more debugging
Add some debugging to virtiofs in the directory-handling area.

Drop a stray, blank line while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-07-12 14:29:06 +02:00
Simon Glass
ce5ca9b204 virtio: Add support for files
Add an implementation of virtio-fs files, including looking them up and
reading them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 08:35:18 -06:00
Simon Glass
310b668cd7 virtio: Add support for directories
Add an implementation of virtio-fs directories, including looking them
up and reading them.

This requires some information in struct fs_dir_stream to maintain the
state of the directory read.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 08:35:18 -06:00