[haiku-bugs] [Haiku] #16512: virtio_block device ordering reversed

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sat, 05 Sep 2020 15:12:10 -0000

#16512: virtio_block device ordering reversed
---------------------------------+--------------------------
 Reporter:  kallisti5            |       Owner:  nobody
     Type:  bug                  |      Status:  new
 Priority:  normal               |   Milestone:  Unscheduled
Component:  Drivers/Disk/Virtio  |     Version:  R1/beta2
 Keywords:                       |  Blocked By:
 Blocking:                       |    Platform:  All
---------------------------------+--------------------------
 Just noticed this in qemu...

 {{{
 qemu-system-x86_64 -machine pc -chardev
 socket,id=console,path=/var/tmp/qemu-1354524-console.sock,server,nowait
 -serial chardev:console -nodefaults -m 4G -cpu max -netdev
 user,id=vnet,hostfwd=:127.0.0.1:0-:22 -device virtio-net-pci,netdev=vnet
 -smp 8 -enable-kvm -drive
 file=/tmp/haiku.img,if=none,id=drive0,cache=writeback -device virtio-
 blk,drive=drive0,bootindex=0 -drive file=/tmp/vm-test-i3tff3zn.tmp/data-
 fa2df.tar,if=none,id=data-fa2df,cache=writeback,format=raw -device virtio-
 blk,drive=data-fa2df,serial=data-fa2df,bootindex=1 -device VGA}}}

 In the example above:
 * -drive file=/tmp/haiku.img,if=none,id=drive0,cache=writeback
   * -device virtio-blk,drive=drive0,bootindex=0
 * -drive file=/tmp/vm-test-i3tff3zn.tmp/data-fa2df.tar,if=none,id=data-
 fa2df,cache=writeback,format=raw
   * -device virtio-blk,drive=data-fa2df,serial=data-fa2df,bootindex=1

 These are positioned as:
 * drive0 = haiku.img
 * drive1 = data-fa2df.tar

 However, after booting into qemu:
 * Haiku is /dev/disk/virtual/virtio_block/1/raw
 * tar is /dev/disk/virtual/virtio_block/0/raw

 The attachment ordering is reversed (or random? Though the reverse seems
 consistent)
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16512>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: