]> git.proxmox.com Git - qemu-server.git/commitdiff
ivmshmem: follouwp code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Feb 2019 07:09:43 +0000 (08:09 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Feb 2019 07:30:10 +0000 (08:30 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index dacb8d1c50983ed51e4526cfc62ab11b3eaca69b..1dc3ca7fbef0cbd276292005264da143da5b952d 100644 (file)
@@ -3933,18 +3933,17 @@ sub config_to_command {
 
     if ($conf->{ivshmem}) {
        my $ivshmem = PVE::JSONSchema::parse_property_string($ivshmem_fmt, $conf->{ivshmem});
+
        my $bus;
        if ($q35) {
            $bus = print_pcie_addr("ivshmem");
        } else {
            $bus = print_pci_addr("ivshmem", $bridges, $arch, $machine_type);
        }
-       my $path = '/dev/shm/pve-shm-';
-       if ($ivshmem->{name}) {
-           $path .= $ivshmem->{name};
-       } else {
-           $path .= $vmid;
-       }
+
+       my $ivshmem_name = $ivshmem->{name} // $vmid;
+       my $path = '/dev/shm/pve-shm-' . $ivshmem_name;
+
        push @$devices, '-device', "ivshmem-plain,memdev=ivshmem$bus,";
        push @$devices, '-object', "memory-backend-file,id=ivshmem,share=on,mem-path=$path,size=$ivshmem->{size}M";
     }