return 77
fi
- local qemu_opts=("-device ahci,id=ahci0")
+ local qemu_opts=("-device virtio-scsi-pci,id=scsi0")
local diskpath i
# Attach 4 SATA disks to the VM (and set their model and serial fields
diskpath="${TESTDIR:?}/lvmbasic${i}.img"
dd if=/dev/zero of="$diskpath" bs=1M count=32
qemu_opts+=(
- "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeeflvm$i"
+ "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeeflvm$i"
"-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i"
)
done
return 77
fi
- local qemu_opts=("-device ahci,id=ahci0")
+ local qemu_opts=("-device virtio-scsi-pci,id=scsi0")
local diskpath i size
for i in {0..3}; do
dd if=/dev/zero of="$diskpath" bs=1M count="$size"
qemu_opts+=(
- "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefbtrfs$i"
+ "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefbtrfs$i"
"-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i"
)
done
return 77
fi
- local qemu_opts=("-device ahci,id=ahci0")
+ local qemu_opts=("-device virtio-scsi-pci,id=scsi0")
local diskpath i size
for i in {0..3}; do
dd if=/dev/zero of="$diskpath" bs=1M count="$size"
qemu_opts+=(
- "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefiscsi$i"
+ "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefiscsi$i"
"-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i"
)
done
return 77
fi
- local qemu_opts=("-device ahci,id=ahci0")
+ local qemu_opts=("-device virtio-scsi-pci,id=scsi0")
local diskpath i size
for i in {0..4}; do
dd if=/dev/zero of="$diskpath" bs=1M count=64
qemu_opts+=(
- "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefmdadm$i"
+ "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefmdadm$i"
"-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i"
)
done
return 77
fi
- local qemu_opts=("-device ahci,id=ahci0")
+ local qemu_opts=("-device virtio-scsi-pci,id=scsi0")
local diskpath i size
for i in {0..4}; do
dd if=/dev/zero of="$diskpath" bs=1M count=64
qemu_opts+=(
- "-device ide-hd,bus=ahci0.$i,drive=drive$i,model=foobar,serial=deadbeefmdadmlvm$i"
+ "-device scsi-hd,drive=drive$i,vendor=systemd,product=foobar,serial=deadbeefmdadmlvm$i"
"-drive format=raw,cache=unsafe,file=$diskpath,if=none,id=drive$i"
)
done
local i iterations partitions part timeout
local vgroup="MyTestGroup$RANDOM"
local devices=(
- /dev/disk/by-id/ata-foobar_deadbeeflvm{0..3}
+ /dev/disk/by-id/scsi-0systemd_foobar_deadbeeflvm{0..3}
)
if [[ -v ASAN_OPTIONS || "$(systemd-detect-virt -v)" == "qemu" ]]; then
testcase_btrfs_basic() {
local dev_stub i label mpoint uuid
local devices=(
- /dev/disk/by-id/ata-foobar_deadbeefbtrfs{0..3}
+ /dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs{0..3}
)
ls -l "${devices[@]}"
uuid="deadbeef-dead-dead-beef-000000000002"
label="btrfs_mdisk"
udevadm lock \
- --device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs0 \
- --device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs1 \
- --device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs2 \
- --device=/dev/disk/by-id/ata-foobar_deadbeefbtrfs3 \
+ --device=/dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs0 \
+ --device=/dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs1 \
+ --device=/dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs2 \
+ --device=/dev/disk/by-id/scsi-0systemd_foobar_deadbeefbtrfs3 \
mkfs.btrfs -f -M -d raid10 -m raid10 -L "$label" -U "$uuid" "${devices[@]}"
udevadm wait --settle --timeout=30 "/dev/disk/by-uuid/$uuid" "/dev/disk/by-label/$label"
btrfs filesystem show
local vgroup="iscsi_lvm$RANDOM"
local expected_symlinks=()
local devices=(
- /dev/disk/by-id/ata-foobar_deadbeefiscsi{0..3}
+ /dev/disk/by-id/scsi-0systemd_foobar_deadbeefiscsi{0..3}
)
ls -l "${devices[@]}"
local i part_name raid_name raid_dev uuid
local expected_symlinks=()
local devices=(
- /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..4}
+ /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm{0..4}
)
ls -l "${devices[@]}"
"/dev/disk/by-label/$part_name" # ext4 partition
)
# Create a simple RAID 1 with an ext4 filesystem
- echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..1} -v -f --level=1 --raid-devices=2
+ echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm{0..1} -v -f --level=1 --raid-devices=2
udevadm wait --settle --timeout=30 "$raid_dev"
mkfs.ext4 -L "$part_name" "$raid_dev"
udevadm wait --settle --timeout=30 "${expected_symlinks[@]}"
"/dev/disk/by-label/$part_name" # ext4 partition
)
# Create a simple RAID 5 with an ext4 filesystem
- echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..2} -v -f --level=5 --raid-devices=3
+ echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm{0..2} -v -f --level=5 --raid-devices=3
udevadm wait --settle --timeout=30 "$raid_dev"
mkfs.ext4 -L "$part_name" "$raid_dev"
udevadm wait --settle --timeout=30 "${expected_symlinks[@]}"
"/dev/disk/by-id/md-uuid-$uuid-part3"
)
# Create a simple RAID 10 with an ext4 filesystem
- echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadm{0..3} -v -f --level=10 --raid-devices=4
+ echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm{0..3} -v -f --level=10 --raid-devices=4
udevadm wait --settle --timeout=30 "$raid_dev"
# Partition the raid device
# Here, 'udevadm lock' is meaningless, as udevd does not lock MD devices.
local part_name raid_name raid_dev uuid vgroup
local expected_symlinks=()
local devices=(
- /dev/disk/by-id/ata-foobar_deadbeefmdadmlvm{0..4}
+ /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm{0..4}
)
ls -l "${devices[@]}"
"/dev/disk/by-label/$part_name" # ext4 partition
)
# Create a RAID 10 with LVM + ext4
- echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/ata-foobar_deadbeefmdadmlvm{0..3} -v -f --level=10 --raid-devices=4
+ echo y | mdadm --create "$raid_dev" --name "$raid_name" --uuid "$uuid" /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadmlvm{0..3} -v -f --level=10 --raid-devices=4
udevadm wait --settle --timeout=30 "$raid_dev"
# Create an LVM on the MD
lvm pvcreate -y "$raid_dev"