]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2131: get correct device when deleting iothreads
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 13 Mar 2019 16:28:04 +0000 (17:28 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 14 Mar 2019 07:25:48 +0000 (08:25 +0100)
we map scsiX to virtioscsiX/scsihwX when we use virtio-scsi-single to add
and iothread so we have to map it back when we delete an iothread, else the
parsing fails with

'invalid drive key: virtioscsi0'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/QemuServer.pm

index 546b22ea1c7ca857441b3366c21ed26b0b3e3217..ed950fc89308c923ad38ee977eee7705b202e1fc 100644 (file)
@@ -4278,7 +4278,11 @@ sub qemu_iothread_add {
 sub qemu_iothread_del {
     my($conf, $vmid, $deviceid) = @_;
 
-    my $device = parse_drive($deviceid, $conf->{$deviceid});
+    my $confid = $deviceid;
+    if ($deviceid =~ m/^(?:virtioscsi|scsihw)(\d+)$/) {
+       $confid = 'scsi' . $1;
+    }
+    my $device = parse_drive($confid, $conf->{$confid});
     if ($device->{iothread}) {
        my $iothreads = vm_iothreads_list($vmid);
        qemu_objectdel($vmid, "iothread-$deviceid") if $iothreads->{"iothread-$deviceid"};