Skip to contentSkip to conversation

vagrant: allow the aio= and cache= options to be set on any drive type

PATCH In review Jeff Layton 2 participants 2 messages Aug 23, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vagrant: allow the aio= and cache= options to be set on any drive type

The aio= and cache= options to the -drive option don't have any dependency on the interface that is presented to the guest.

Rename *_VIRTIO_AIO_* to *_AIO_*, and remove the dependency on virtio in the Kconfig. Add the appropriate cache= and aio= options in the Vagrantfile template.

While we're in here, let's add support for io_uring on an experimental basis.

---
 playbooks/roles/gen_nodes/defaults/main.yml        |  4 +-
 playbooks/roles/gen_nodes/templates/Vagrantfile.j2 |  8 ++--
 scripts/gen-nodes.Makefile                         |  5 ++-
 vagrant/Kconfig                                    | 47 +++++++++++-----------
 4 files changed, 33 insertions(+), 31 deletions(-)
playbooks/roles/gen_nodes/defaults/main.yml +2 -2
index 0c5d36467038..c57effe7346f 100644
@@ -55,8 +55,8 @@ libvirt_extra_drive_id_prefix: 'drv'
 libvirt_extra_storage_drive_nvme: True
 libvirt_extra_storage_drive_virtio: False
 libvirt_extra_storage_drive_ide: False
-libvirt_extra_storage_virtio_aio_mode: "native"
-libvirt_extra_storage_virtio_aio_cache_mode: "none"
+libvirt_extra_storage_aio_mode: "native"
+libvirt_extra_storage_aio_cache_mode: "none"
 libvirt_extra_storage_nvme_logical_block_size: 512
 libvirt_extra_storage_virtio_logical_block_size: 512
 libvirt_extra_storage_virtio_physical_block_size: 512
playbooks/roles/gen_nodes/templates/Vagrantfile.j2 +4 -4
index 8210627c3717..7ed59ff744ae 100644
@@ -391,14 +391,14 @@ Vagrant.configure("2") do |config|
 {% endif %}
 {% if libvirt_extra_storage_drive_ide %}
             libvirt.qemuargs :value => "-drive"
-            libvirt.qemuargs :value => "file=#{extra_disk},if=ide,serial=#{serial_id}"
+            libvirt.qemuargs :value => "file=#{extra_disk},aio={{ libvirt_extra_storage_aio_mode }},cache={{ libvirt_extra_storage_aio_cache_mode }},if=ide,serial=#{serial_id}"
 {% elif libvirt_extra_storage_drive_virtio %}
             virtio_pbs = "{{ libvirt_extra_storage_virtio_physical_block_size }}"
             virtio_lbs = "{{ libvirt_extra_storage_virtio_logical_block_size }}"
             libvirt.qemuargs :value => "-object"
             libvirt.qemuargs :value => "iothread,id=kdevops-virtio-iothread-#{port}"
             libvirt.qemuargs :value => "-drive"
-            libvirt.qemuargs :value => "file=#{extra_disk},if=none,aio={{ libvirt_extra_storage_virtio_aio_mode }},cache={{ libvirt_extra_storage_virtio_aio_cache_mode }},id=#{disk_id}"
+            libvirt.qemuargs :value => "file=#{extra_disk},if=none,aio={{ libvirt_extra_storage_aio_mode }},cache={{ libvirt_extra_storage_aio_cache_mode }},id=#{disk_id}"
             libvirt.qemuargs :value => "-device"
             libvirt.qemuargs :value => "virtio-blk-pci,scsi=off,drive=#{disk_id},id=virtio-#{disk_id},serial=#{serial_id},bus=#{bus_for_extra_drives},addr=#{pci_function},iothread=kdevops-virtio-iothread-#{port}#{extra_drive_largio_args},logical_block_size=#{virtio_lbs},physical_block_size=#{virtio_pbs}"
 {% elif libvirt_extra_storage_drive_nvme  %}
@@ -409,14 +409,14 @@ Vagrant.configure("2") do |config|
             extra_drive_interface = "none"
             if zoned
               libvirt.qemuargs :value => "-drive"
-              libvirt.qemuargs :value => "file=#{extra_disk},if=#{extra_drive_interface},id=#{disk_id}"
+              libvirt.qemuargs :value => "file=#{extra_disk},if=#{extra_drive_interface},aio={{ libvirt_extra_storage_aio_mode }},cache={{ libvirt_extra_storage_aio_cache_mode }},id=#{disk_id}"
               libvirt.qemuargs :value => "-device"
               libvirt.qemuargs :value => "nvme,id={{ extra_disk_driver }}#{port},serial=#{serial_id},bus=#{bus_for_extra_drives},addr=#{pci_function},zoned.zasl=#{zone_zasl}"
               libvirt.qemuargs :value => "-device"
               libvirt.qemuargs :value => "nvme-ns,drive=#{disk_id},bus={{ extra_disk_driver }}#{port},nsid=1,logical_block_size=#{logical_block_size},physical_block_size=#{physical_block_size},zoned=true,zoned.zone_size=#{zone_size},zoned.zone_capacity=#{zone_capacity},zoned.max_open=#{zone_max_open},zoned.max_active=#{zone_max_active}"
             else
               libvirt.qemuargs :value => "-drive"
-              libvirt.qemuargs :value => "file=#{extra_disk},if=#{extra_drive_interface},id=#{disk_id}"
+              libvirt.qemuargs :value => "file=#{extra_disk},if=#{extra_drive_interface},aio={{ libvirt_extra_storage_aio_mode }},cache={{ libvirt_extra_storage_aio_cache_mode }},id=#{disk_id}"
               libvirt.qemuargs :value => "-device"
               libvirt.qemuargs :value => "nvme,id={{ extra_disk_driver }}#{port},serial=#{serial_id},bus=#{bus_for_extra_drives},addr=#{pci_function}"
               libvirt.qemuargs :value => "-device"
scripts/gen-nodes.Makefile +3 -2
index 579a2dfe4d54..533b19dbf771 100644
@@ -56,10 +56,11 @@ endif
 ifeq (y,$(CONFIG_LIBVIRT_EXTRA_STORAGE_DRIVE_VIRTIO))
 GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_drive_nvme='False'
 GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_drive_virtio='True'
-GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_virtio_aio_mode='$(subst ",,$(CONFIG_LIBVIRT_VIRTIO_AIO_MODE))'
-GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_virtio_aio_cache_mode='$(subst ",,$(CONFIG_LIBVIRT_VIRTIO_AIO_CACHE_MODE))'
 endif
 
+GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_MODE))'
+GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_aio_cache_mode='$(subst ",,$(CONFIG_LIBVIRT_AIO_CACHE_MODE))'
+
 ifeq (y,$(CONFIG_LIBVIRT_EXTRA_STORAGE_DRIVE_NVME))
 ifeq (y,$(CONFIG_LIBVIRT_EXTRA_STORAGE_NVME_LOGICAL_BLOCK_SIZE_512))
 GEN_NODES_EXTRA_ARGS += libvirt_extra_storage_nvme_logical_block_size='512'
vagrant/Kconfig +24 -23

105 lines not on this page · raw message

---
base-commit: ed8c04809df15cff347ec011d95a9bf5a6f34c14
change-id: 20230823-fixes-7d36e8b073b9

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jeff Layton

The aio= and cache= options to the -drive option don't have any dependency on the interface that is presented to the guest.

Rename *_VIRTIO_AIO_* to *_AIO_*, and remove the dependency on virtio in the Kconfig. Add the appropriate cache= and aio= options in the Vagrantfile template.

While we're in here, let's add support for io_uring on an experimental basis.

Luis