Skip to content

Use both the -drive and -device options to set rootfs image #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ikitayama
Copy link
Collaborator

In an upcoming CXL related changes to the aarch64 target QEMU, the legacy -drive
option only does not work to set rootfs image; see below Jonathan's suggestions:

This is a challenge to fix at qemu side because it is relying on a bunch of old behavior.  For a while now legacy -drive parameters have been split into parts that go in -drive and a separate -device entry that covers the hardware - even with that though we'd need to specify a bus as on arm64 the default for -drive is virtio-blk which ends up I connected on the pcie bus.

Note this is just as broken if you use any pxb-pcie instances as those have similar fixed assumption that you can only hang root ports off them.

I think best solution is probably to stop use the old style

-drive file=root.img,format=raw,media=disk

and switch to fully expanded virtio solution along the lines of

-drive if=none,file=root.img,format=raw,media=disk,id=hd \ -device virtio-blk,bus=pcie.0,drive=hd

which should be fine on x86 and arm64 + any other architectures we support in the future and will always bring the disk up as an RCiEP on the main pcie root complex.

Jonathan

…gacy -drive

option only does not work to set rootfs image; see below Jonathan's suggestions:

This is a challenge to fix at qemu side because it is relying
on a bunch of old behavior.  For a while now legacy -drive parameters have been
split into parts that go in -drive and a separate -device entry
that covers the hardware - even with that though we'd need
to specify a bus as on arm64 the default for -drive is virtio-blk
which ends up I connected on the pcie bus.

Note this is just as broken if you use any pxb-pcie instances as
those have similar fixed assumption that you can only hang root ports
off them.

I think best solution is probably to stop use the old style

-drive file=root.img,format=raw,media=disk

and switch to fully expanded virtio solution along the lines of

-drive if=none,file=root.img,format=raw,media=disk,id=hd \
-device virtio-blk,bus=pcie.0,drive=hd

which should be fine on x86 and arm64 + any other architectures we
support in the future and will always bring the disk up as an RCiEP
on the main pcie root complex.

Jonathan
@ikitayama ikitayama requested a review from stellarhopper as a code owner May 20, 2025 23:05
Copy link
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

I'm guessing this is superseding this older PR?

Please always share a link to context (when there is context) in the discussion.

 
Code change looks good to me and it seems to be compatible even with the old QEMU 6.2.0 found on the old Ubuntu 22.04, Yay! So, no compatibility concern.

However:

  • please provide a properly formatted commit message. It's OK to quote John at the end (even better: with an URL?) but the quote should not be the entire commit message.

  • I would like some Intel QEMU expert to review this too. @stellarhopper anyone? You?

@ikitayama ikitayama closed this May 21, 2025
@ikitayama ikitayama deleted the qcmd-update branch May 21, 2025 04:43
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