Skip to content

Conversation

ChinYikMing
Copy link
Collaborator

@ChinYikMing ChinYikMing commented Oct 19, 2025

This commit allows the virtio block device to resolve disk image paths starting with ~ to the user's home directory, making it more convenient. Additionally, it adds error handling for cases where the -x vblk: option is used without specifying a path.

Testing

$ build/rv32emu -k build/linux-image/Image -i build/linux-image/rootfs.cpio -x vblk:~/disk_test.img

Expectation

GuestOS is bootable and ~/disk_test.img is accessible via /dev/vda.


Summary by cubic

Enable ~ expansion in virtio-blk disk paths and add clear errors for invalid input. Users can now pass ~/disk.img; we resolve it to HOME and fail fast on empty paths or missing HOME.

  • New Features

    • Expand ~ to $HOME in -x vblk: disk image paths.
  • Bug Fixes

    • Reject empty vblk path with a clear error.
    • Error if HOME is unset when using ~.

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Benchmark suite Current: 457f621 Previous: ddde83c Ratio
Dhrystone 1340 Average DMIPS over 10 runs 1286 Average DMIPS over 10 runs 0.96
Coremark 935.86 Average iterations/sec over 10 runs 951.961 Average iterations/sec over 10 runs 1.02

This comment was automatically generated by workflow using github-action-benchmark.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="src/riscv.c">

<violation number="1" location="src/riscv.c:705">
Guard against vblk_opts[0] being NULL before checking for &#39;~&#39; so delimiter-only inputs don&#39;t crash.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

This commit allows the virtio block device to resolve disk image paths
starting with ~ to the user's home directory, making it more
convenient. Additionally, it adds error handling for cases where the
-x vblk: option is used without specifying a path.
@ChinYikMing ChinYikMing force-pushed the support-home-dir-vblk branch from ddde83c to 457f621 Compare October 19, 2025 07:00
@jserv jserv merged commit 43b390e into sysprog21:master Oct 19, 2025
8 of 10 checks passed
@jserv
Copy link
Contributor

jserv commented Oct 19, 2025

Thank @ChinYikMing for contributing!

@jserv jserv added this to the release-2025.2 milestone Oct 19, 2025
@ChinYikMing ChinYikMing deleted the support-home-dir-vblk branch October 19, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants