5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2024-12-27 03:21:43 +03:00

Add node parameter to config_file()

That way we can get the filename for VMs on remove nodes.
This commit is contained in:
Dietmar Maurer 2011-09-09 09:47:54 +02:00
parent 0ea9541da0
commit a78ccf26fc

View File

@ -1199,15 +1199,16 @@ sub lock_config {
} }
sub cfs_config_path { sub cfs_config_path {
my ($vmid) = @_; my ($vmid, $node) = @_;
return "nodes/$nodename/qemu-server/$vmid.conf"; $node = $nodename if !$node;
return "nodes/$node/qemu-server/$vmid.conf";
} }
sub config_file { sub config_file {
my ($vmid) = @_; my ($vmid, $node) = @_;
my $cfspath = cfs_config_path($vmid); my $cfspath = cfs_config_path($vmid, $node);
return "/etc/pve/$cfspath"; return "/etc/pve/$cfspath";
} }
@ -1605,7 +1606,6 @@ sub config_list {
return $res if !$vmlist || !$vmlist->{ids}; return $res if !$vmlist || !$vmlist->{ids};
my $ids = $vmlist->{ids}; my $ids = $vmlist->{ids};
my $nodename = PVE::INotify::nodename();
foreach my $vmid (keys %$ids) { foreach my $vmid (keys %$ids) {
my $d = $ids->{$vmid}; my $d = $ids->{$vmid};
next if !$d->{node} || $d->{node} ne $nodename; next if !$d->{node} || $d->{node} ne $nodename;