]> git.proxmox.com Git - qemu-server.git/commitdiff
Add node parameter to config_file()
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Sep 2011 07:47:54 +0000 (09:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 9 Sep 2011 07:47:54 +0000 (09:47 +0200)
That way we can get the filename for VMs on remove nodes.

PVE/QemuServer.pm

index 98444ec0667b50641149803e87e180f79659eb26..1151f060a6eb098ec3193703312b2141f1b71da3 100644 (file)
@@ -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;