public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Subject: [pve-devel] [PATCH qemuserver 3/3] hotplug: drive controller : use print_drivedevice_iothread && print_drivedevice_controller
Date: Fri, 27 Jun 2025 12:02:42 +0200	[thread overview]
Message-ID: <mailman.675.1751018602.395.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20250627100242.1478523-1-alexandre.derumier@groupe-cyllene.com>

[-- Attachment #1: Type: message/rfc822, Size: 5141 bytes --]

From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemuserver 3/3] hotplug: drive controller : use print_drivedevice_iothread && print_drivedevice_controller
Date: Fri, 27 Jun 2025 12:02:42 +0200
Message-ID: <20250627100242.1478523-4-alexandre.derumier@groupe-cyllene.com>

Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
---
 src/PVE/QemuServer.pm | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index dca206b4..a5b5ad33 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3748,21 +3748,11 @@ sub vm_deviceplug {
         }
     } elsif ($deviceid =~ m/^(virtioscsi|scsihw)(\d+)$/) {
         my $scsihw = defined($conf->{scsihw}) ? $conf->{scsihw} : "lsi";
-        my $pciaddr = print_pci_addr($deviceid, undef, $arch);
-        my $scsihw_type = $scsihw eq 'virtio-scsi-single' ? "virtio-scsi-pci" : $scsihw;
-
-        my $devicefull = "$scsihw_type,id=$deviceid$pciaddr";
-
-        if ($deviceid =~ m/^virtioscsi(\d+)$/ && $device->{iothread}) {
-            qemu_iothread_add($vmid, $deviceid, $device);
-            $devicefull .= ",iothread=iothread-$deviceid";
-        }
+        my $iothread = print_drivedevice_iothread($conf, $device);
+        my $controller = print_drivedevice_controller($conf, $device, $iothread, $scsihw, $arch);
 
-        if ($deviceid =~ m/^virtioscsi(\d+)$/ && $device->{queues}) {
-            $devicefull .= ",num_queues=$device->{queues}";
-        }
-
-        qemu_deviceadd($vmid, $devicefull);
+        qemu_iothread_add($vmid, $deviceid, $device) if $iothread;
+        qemu_deviceadd($vmid, $controller);
         qemu_deviceaddverify($vmid, $deviceid);
     } elsif ($deviceid =~ m/^(scsi)(\d+)$/) {
         qemu_findorcreatescsihw($storecfg, $conf, $vmid, $device, $arch, $machine_type);
-- 
2.39.5



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

      parent reply	other threads:[~2025-06-27 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250627100242.1478523-1-alexandre.derumier@groupe-cyllene.com>
2025-06-27 10:02 ` [pve-devel] [PATCH qemuserver 1/3] introduce DriveDevice module Alexandre Derumier via pve-devel
2025-06-27 10:02 ` [pve-devel] [PATCH qemuserver 2/3] add print_drivedevice_controller && print_drivedevice_iothread Alexandre Derumier via pve-devel
2025-06-27 10:02 ` Alexandre Derumier via pve-devel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.675.1751018602.395.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=alexandre.derumier@groupe-cyllene.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal