[pve-devel] [PATCH qemu-server 2/6] virtio-blk: add queues option

Alexandre Derumier aderumier at odiso.com
Thu Mar 9 09:52:13 CET 2023


We already added support for virtio-scsi some years ago,
but forget to add it for virtio-blk

Note that qemu attribute in "num-queues" for virtio-blk,

instaed "num_queues"  for virtio-scsi

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm       | 1 +
 PVE/QemuServer/Drive.pm | 1 +
 2 files changed, 2 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 40be44d..deb7faf 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1505,6 +1505,7 @@ sub print_drivedevice_full {
 	my $pciaddr = print_pci_addr("$drive_id", $bridges, $arch, $machine_type);
 	$device = "virtio-blk-pci,drive=drive-$drive_id,id=${drive_id}${pciaddr}";
 	$device .= ",iothread=iothread-$drive_id" if $drive->{iothread};
+	$device .= ",num-queues=$drive->{queues}" if $drive->{queues};
     } elsif ($drive->{interface} eq 'scsi') {
 
 	my ($maxdev, $controller, $controller_prefix) = scsihw_infos($conf, $drive);
diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm
index b0e0a96..cd2823a 100644
--- a/PVE/QemuServer/Drive.pm
+++ b/PVE/QemuServer/Drive.pm
@@ -304,6 +304,7 @@ PVE::JSONSchema::register_standard_option("pve-qm-sata", $satadesc);
 my $virtio_fmt = {
     %drivedesc_base,
     %iothread_fmt,
+    %queues_fmt,
     %readonly_fmt,
 };
 my $virtiodesc = {
-- 
2.30.2





More information about the pve-devel mailing list