ivmshmem: follouwp code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-02-26 08:09:43 +01:00
parent 6dbcb07367
commit e3c27a6afe

View 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";
}