]> git.proxmox.com Git - qemu-server.git/commitdiff
pci related code cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 11 Oct 2021 06:39:28 +0000 (08:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 11 Oct 2021 06:39:28 +0000 (08:39 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm
PVE/QemuServer/PCI.pm

index f78b2cc3497a9b4ff078a01a360ac6ac4cd4bf95..eb29fc2e6646556a81f35dc5d08901ffb0faf22e 100644 (file)
@@ -5385,11 +5385,8 @@ sub vm_start_nolock {
     for (my $i = 0; $i < $PVE::QemuServer::PCI::MAX_HOSTPCI_DEVICES; $i++)  {
       my $d = parse_hostpci($conf->{"hostpci$i"});
       next if !$d;
-      my $pcidevices = $d->{pciid};
-      foreach my $pcidevice (@$pcidevices) {
-           my $pciid = $pcidevice->{id};
-
-           PVE::QemuServer::PCI::prepare_pci_device($vmid, $pciid, $i, $d->{mdev});
+      for my $pcidevice ($d->{pciid}->@*) {
+       PVE::QemuServer::PCI::prepare_pci_device($vmid, $pcidevice->{id}, $i, $d->{mdev});
       }
     }
 
index 03e29a357179df6c134424731186ecfa01484ec7..863e77e1d48efbb8ddad91ed4833e71b480dee0c 100644 (file)
@@ -482,8 +482,6 @@ sub prepare_pci_device {
        die "can't reset PCI device '$pciid'\n"
            if $info->{has_fl_reset} && !PVE::SysFSTools::pci_dev_reset($info);
     }
-
-    return;
 }
 
 1;