die "found un-written value in config - implement this!";
}
- print $raw;
-
return $raw;
}
return "nodes/$node/lxc/$vmid/config";
}
+sub config_file {
+ my ($vmid, $node) = @_;
+
+ my $cfspath = cfs_config_path($vmid, $node);
+ return "/etc/pve/$cfspath";
+}
+
sub load_config {
my ($vmid) = @_;
PVE::Cluster::cfs_write_file($cfspath, $conf);
}
+my $tempcounter = 0;
+sub write_temp_config {
+ my ($vmid, $conf) = @_;
+
+ $tempcounter++;
+ my $filename = "/tmp/temp-lxc-conf-$vmid-$$-$tempcounter.conf";
+
+ my $raw = write_lxc_config($filename, $conf);
+
+ PVE::Tools::file_set_contents($filename, $raw);
+
+ return $filename;
+}
+
sub lock_container {
my ($vmid, $timeout, $code, @param) = @_;