Skip to content

Conversation

@jandubois
Copy link
Member

@jandubois jandubois commented Nov 25, 2025

This allows QEMU to pick the specific driver itself. E.g. OpenSUSE Leap 16 for s390x does not have virtio-scsi-pci but does support virtio-scsi-ccw:

limactl start -y --vm-type qemu https://download.opensuse.org/distribution/leap/16.0/appliances/Leap-16.0-Minimal-VM.s390x-s390x-Cloud.qcow2
...limactl shell leap-16.0.s390x-s390x uname -a
Linux lima-leap-16-0-s390x-s390x 6.12.0-160000.5-default #1 SMP Wed Sep 10 15:26:25 UTC 2025 (3545bbd) s390x s390x s390x GNU/Linux

Ref: #4203 (comment)
Ref: https://bugzilla.suse.com/show_bug.cgi?id=1252096#c10

"-drive", "id=cdrom0,if=none,format=raw,readonly=on,file="+filepath.Join(cfg.InstanceDir, filenames.CIDataISO),
"-device", "virtio-scsi-pci,id=scsi0",
"-device", "virtio-scsi,id=scsi0",
"-device", "scsi-cd,bus=scsi0.0,drive=cdrom0")
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need scsi cdrom?

We can use virtio:

-drive file=cidata.iso,media=cdrom,if=virtio

Or just:

-cdrom cidata.iso

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no preferences what-so-ever. @AkihiroSuda / @afbjorklund What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

It depends on the distribution, I think. And it seems unrelated to this change, with a more portable device.

Copy link
Member

Choose a reason for hiding this comment

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

If I recall correctly, it was the matter of /dev/hda vs /dev/sda vs /dev/vda and matching kernel support

Choose a reason for hiding this comment

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

IIRC -cdrom is highly arch/machine specific, using IDE on x86(_64), virtio-blk on aarch64 and s390x, spapr-vscsi on ppc64, ...

afbjorklund
afbjorklund previously approved these changes Nov 26, 2025
Copy link
Member

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

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

You could probably do the same for others, not needed to hardcode "pci" like that.

name "virtio-9p-pci", bus PCI, alias "virtio-9p"
name "virtio-blk-pci", bus PCI, alias "virtio-blk"
name "virtio-scsi-pci", bus PCI, alias "virtio-scsi"
name "virtio-net-pci", bus PCI, alias "virtio-net"
name "virtio-input-host-pci", bus PCI, alias "virtio-input-host"
name "virtio-keyboard-pci", bus PCI, alias "virtio-keyboard"
name "virtio-mouse-pci", bus PCI, alias "virtio-mouse"
name "virtio-serial-pci", bus PCI, alias "virtio-serial"
name "virtio-tablet-pci", bus PCI, alias "virtio-tablet"
name "virtio-gpu-pci", bus PCI, alias "virtio-gpu"
name "virtio-balloon-pci", bus PCI, alias "virtio-balloon"
name "virtio-rng-pci", bus PCI, alias "virtio-rng"

@jandubois
Copy link
Member Author

You could probably do the same for others, not needed to hardcode "pci" like that.

I don't know what to do next now. Should we attempt to drop the "pci" in other places, or wait until it becomes an issue.

And should I try to use -cdrom cidata.iso as suggested by Nir, or not?

@nirs
Copy link
Member

nirs commented Nov 26, 2025

I would do a minimal fix for 2.0.3 - just change virtio-scsi-pci to virtio-scsi - it this works on x86 and s390x we are fine.

Another option, use virtio-scsi-pci in x86 and virtio-scsi-ccw on s390x.

Then open an issue to simplify qemu configuration. I think we should be able to use virtio for everything - this is the most efficient way since virtio is designed to handle virtual devices. Using SCSI or other interfaces is needed only if you have special requirement and unlikely to be need in lima use case.

We can ask about it in qemu-discuss or check with qemu folks in SUSE/Red Hat.

@afbjorklund
Copy link
Member

I also think you don't need to do anything more here, I was just making an idle comment that most have aliases.

@jandubois
Copy link
Member Author

Since all tests are passing and it enables Leap 16 on s390x, I guess I'll merge as-is. Reading the cidata is not really a performance-critical part, so if no other problems are known, maybe this is good enough.

I'm going to remove the comment about the s390x image not working from the template though.

This allows QEMU to pick the specific driver itself. E.g. OpenSUSE
Leap 16 for s390x does not have virtio-scsi-pci but does support
virtio-scsi-ccw.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
@jandubois jandubois merged commit 651e521 into lima-vm:master Nov 26, 2025
37 checks passed
@jandubois jandubois deleted the virtio-scsi branch November 26, 2025 19:24
@jandubois jandubois added this to the v2.1.0 (?) milestone Nov 26, 2025
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.

4 participants