f-36: disk: check disk with vdX is only one

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-08-10 22:13:48 +02:00
commit fbe6496e1e
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

@ -53,12 +53,17 @@ func Start(cfg Config) error {
}
hasScsi := false
virtioBlk := 0
for _, d := range cfg.Disks {
if strings.HasPrefix(d.Dev, "sd") {
hasScsi = true
break
} else {
virtioBlk++
}
}
if virtioBlk > 1 {
return fmt.Errorf("qemu: %d disques virtio-blk (vd*) déclarés, un seul est supporté — utiliser des disques sd* pour les disques additionnels", virtioBlk)
}
if hasScsi {
args = append(args, "-device", "virtio-scsi-pci,id=scsi0")
}