1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-24 09:49:49 +03:00

tests: remove cache=unsafe from TEST-64-UDEV-STORAGE

mkosi switch to the newer -blockdev qemu option in systemd/mkosi#3557 [1], but
cache=unsafe is an option only -drive supports.

Since the qemu-system_x86-64 man page [2] says this, cache.writeback=on is the
default and mkosi setting the other two options to the values corresponding to
unsafe, it should be fine to drop the cache=unsafe option.

┌─────────────┬─────────────────┬──────────────┬────────────────┐
│             │ cache.writeback │ cache.direct │ cache.no-flush │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writeback    │ on              │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│none         │ on              │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writethrough │ off             │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│directsync   │ off             │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│unsafe       │ on              │ off          │ on             │
└─────────────┴─────────────────┴──────────────┴────────────────┘

[1] https://github.com/systemd/mkosi/pull/3557
[2] https://manpages.ubuntu.com/manpages/noble/en/man1/qemu-system-x86_64.1.html

(cherry picked from commit 759fdb3a35)
This commit is contained in:
Jörg Behrmann
2025-03-02 15:52:08 +01:00
committed by Luca Boccassi
parent a2abc3b8ec
commit 9a389ae535

View File

@ -19,7 +19,7 @@ qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
foreach i : range(4) foreach i : range(4)
id = f'drivebtrfsbasic@i@' id = f'drivebtrfsbasic@i@'
size = i == 0 ? '350M' : '128M' size = i == 0 ? '350M' : '128M'
cmdline += [f'--drive=@id@:@size@::cache=unsafe'] cmdline += [f'--drive=@id@:@size@::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefbtrfs@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefbtrfs@i@']
endforeach endforeach
@ -35,7 +35,7 @@ qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
foreach i : range(4) foreach i : range(4)
id = f'driveiscsibasic@i@' id = f'driveiscsibasic@i@'
size = i == 0 ? '150M' : '70M' size = i == 0 ? '150M' : '70M'
cmdline += [f'--drive=@id@:@size@::cache=unsafe'] cmdline += [f'--drive=@id@:@size@::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefiscsi@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefiscsi@i@']
endforeach endforeach
@ -45,7 +45,7 @@ udev_storage_tests += {
'qemu-args' : qemu_args, 'qemu-args' : qemu_args,
} }
cmdline = ['--drive=drive0:64M::cache=unsafe'] cmdline = ['--drive=drive0:64M::']
qemu_args = ['-device', 'pci-bridge,id=pci_bridge0,chassis_nr=64'] qemu_args = ['-device', 'pci-bridge,id=pci_bridge0,chassis_nr=64']
# Create 25 additional PCI bridges, each one connected to the previous one # Create 25 additional PCI bridges, each one connected to the previous one
@ -71,7 +71,7 @@ qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
foreach i : range(4) foreach i : range(4)
id = f'drivelvmbasic@i@' id = f'drivelvmbasic@i@'
cmdline += [f'--drive=@id@:32M::cache=unsafe'] cmdline += [f'--drive=@id@:32M::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeeflvm@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeeflvm@i@']
endforeach endforeach
@ -86,7 +86,7 @@ qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
foreach i : range(5) foreach i : range(5)
id = f'drivemdadmbasic@i@' id = f'drivemdadmbasic@i@'
cmdline += [f'--drive=@id@:64M::cache=unsafe'] cmdline += [f'--drive=@id@:64M::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadm@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadm@i@']
endforeach endforeach
@ -101,7 +101,7 @@ qemu_args = ['-device', 'virtio-scsi-pci,id=scsi0']
foreach i : range(5) foreach i : range(5)
id = f'drivemdadmlvm@i@' id = f'drivemdadmlvm@i@'
cmdline += [f'--drive=@id@:64M::cache=unsafe'] cmdline += [f'--drive=@id@:64M::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadmlvm@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,vendor=systemd,product=foobar,serial=deadbeefmdadmlvm@i@']
endforeach endforeach
@ -122,7 +122,7 @@ foreach ndisk : range(16)
foreach nback : range(4) foreach nback : range(4)
id = f'drive@ndisk@x@nback@' id = f'drive@ndisk@x@nback@'
cmdline += [f'--drive=@id@:@size@::cache=unsafe:@ndisk@'] cmdline += [f'--drive=@id@:@size@:::@ndisk@']
qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=MPIO@ndisk@,wwn=@wwn@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=MPIO@ndisk@,wwn=@wwn@']
endforeach endforeach
endforeach endforeach
@ -138,7 +138,7 @@ qemu_args = []
foreach i : range(10) foreach i : range(10)
id = f'drivesimultaneousevents@i@' id = f'drivesimultaneousevents@i@'
cmdline += [f'--drive=@id@:128M::cache=unsafe'] cmdline += [f'--drive=@id@:128M::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=deadbeeftest@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,serial=deadbeeftest@i@']
endforeach endforeach
@ -157,7 +157,7 @@ endforeach
foreach i : range(128) foreach i : range(128)
id = f'drive@i@' id = f'drive@i@'
cmdline += [f'--drive=@id@:1M::cache=unsafe'] cmdline += [f'--drive=@id@:1M::']
div = i / 32 div = i / 32
mod = i % 32 mod = i % 32
qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi@div@.0,channel=0,scsi-id=@mod@,lun=0'] qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi@div@.0,channel=0,scsi-id=@mod@,lun=0']
@ -177,7 +177,7 @@ if qemu.found()
qemu_args = [] qemu_args = []
foreach i : range(20) foreach i : range(20)
cmdline += [f'--drive=nvme@i@:1M::cache=unsafe'] cmdline += [f'--drive=nvme@i@:1M::']
endforeach endforeach
foreach i : range(5) foreach i : range(5)
@ -205,7 +205,7 @@ if qemu.found()
cmdline = [] cmdline = []
foreach id : ['nvme0', 'nvme1'] foreach id : ['nvme0', 'nvme1']
cmdline += [f'--drive=@id@:1M::cache=unsafe'] cmdline += [f'--drive=@id@:1M::']
endforeach endforeach
qemu_args = [ qemu_args = [
@ -232,7 +232,7 @@ if qemu.found()
foreach i : range(16) foreach i : range(16)
id = f'drive@i@' id = f'drive@i@'
cmdline += [f'--drive=@id@:40M::cache=unsafe'] cmdline += [f'--drive=@id@:40M::']
qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@'] qemu_args += ['-device', f'scsi-hd,drive=@id@,bus=scsi0.0,channel=0,scsi-id=0,lun=@i@']
endforeach endforeach