From fbe6496e1e191de450747f820c355b390001c44c Mon Sep 17 00:00:00 2001 From: GnomeZworc Date: Mon, 10 Aug 2026 22:13:48 +0200 Subject: [PATCH] f-36: disk: check disk with vdX is only one Signed-off-by: GnomeZworc --- internal/qemu/start_linux.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/qemu/start_linux.go b/internal/qemu/start_linux.go index a7869a2..de5b005 100644 --- a/internal/qemu/start_linux.go +++ b/internal/qemu/start_linux.go @@ -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") }