[pve-devel] [PATCH 3/6] add vm_deviceadd sub

Dietmar Maurer dietmar at proxmox.com
Tue Oct 11 13:40:19 CEST 2011


> +sub vm_deviceadd {
> +    my ($storecfg,$vmid, $deviceid,$device) = @_;
> +
> +    my $cfspath = cfs_config_path($vmid);
> +    my $conf = PVE::Cluster::cfs_read_file($cfspath) || {};


Please can we avoid that ::cfs_read_file() - we can simply pass the conf to the function:

sub vm_deviceadd {
    my ($conf, $storecfg, $vmid, $deviceid, $device) = @_;
..

sub vm_devicedel {
    my ($conf, $vmid, $deviceid) = @_;
...






More information about the pve-devel mailing list