From a78ccf26fcde25da70e6a86bac670098de3f3f16 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 9 Sep 2011 09:47:54 +0200 Subject: [PATCH] Add node parameter to config_file() That way we can get the filename for VMs on remove nodes. --- PVE/QemuServer.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 98444ec0..1151f060 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1199,15 +1199,16 @@ sub lock_config { } 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 { - my ($vmid) = @_; + my ($vmid, $node) = @_; - my $cfspath = cfs_config_path($vmid); + my $cfspath = cfs_config_path($vmid, $node); return "/etc/pve/$cfspath"; } @@ -1605,7 +1606,6 @@ sub config_list { return $res if !$vmlist || !$vmlist->{ids}; my $ids = $vmlist->{ids}; - my $nodename = PVE::INotify::nodename(); foreach my $vmid (keys %$ids) { my $d = $ids->{$vmid}; next if !$d->{node} || $d->{node} ne $nodename;