Instead, use the new get_derived_property() method to get the same
information in a way that is robust regarding changes in the
configuration structure.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
my $conf = PVE::LXC::Config->load_config($id, $service_node);
return {
my $conf = PVE::LXC::Config->load_config($id, $service_node);
return {
- maxcpu => $conf->{cpulimit} || $conf->{cores} || 0,
- maxmem => ($conf->{memory} || 512) * 1024 * 1024,
+ maxcpu => PVE::LXC::Config->get_derived_property($conf, 'max-cpu'),
+ maxmem => PVE::LXC::Config->get_derived_property($conf, 'max-memory'),
my ($class, $haenv, $id, $service_node) = @_;
my $conf = PVE::QemuConfig->load_config($id, $service_node);
my ($class, $haenv, $id, $service_node) = @_;
my $conf = PVE::QemuConfig->load_config($id, $service_node);
- my $defaults = PVE::QemuServer::load_defaults();
-
- my $cpus = ($conf->{sockets} || $defaults->{sockets}) * ($conf->{cores} || $defaults->{cores});
- maxcpu => $conf->{vcpus} || $cpus,
- maxmem => ($conf->{memory} || $defaults->{memory}) * 1024 * 1024,
+ maxcpu => PVE::QemuConfig->get_derived_property($conf, 'max-cpu'),
+ maxmem => PVE::QemuConfig->get_derived_property($conf, 'max-memory'),