This allows load_config to load also configs from LXC container
which arent't located on the same node.

This is needed to fix the bug that doesn't let view the noVNC
console from an CT located on another node, whereas viewing it on
the same node as the container is located works fine.

Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 src/PVE/API2/LXC.pm | 2 +-
 src/PVE/LXC.pm      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 8431125..e9bd5a7 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -593,7 +593,7 @@ __PACKAGE__->register_method ({
        my $remcmd = $remip ?
            ['/usr/bin/ssh', '-t', $remip] : [];
 
-       my $conf = PVE::LXC::load_config($vmid);
+       my $conf = PVE::LXC::load_config($vmid, $node);
        my $concmd = PVE::LXC::get_console_command($vmid, $conf);
 
        my $shcmd = [ '/usr/bin/dtach', '-A',
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 5e21df6..abd6ff0 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -439,9 +439,10 @@ sub config_file {
 }
 
 sub load_config {
-    my ($vmid) = @_;
+    my ($vmid, $node) = @_;
 
-    my $cfspath = cfs_config_path($vmid);
+    $node = $nodename if !$node;
+    my $cfspath = cfs_config_path($vmid, $node);
 
     my $conf = PVE::Cluster::cfs_read_file($cfspath);
     die "container $vmid does not exists\n" if !defined($conf);
-- 
2.1.4

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to