From b5e703f2a7191364c56dd0468beaeaead01ace06 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 11 Mar 2021 18:38:27 +0000 Subject: [PATCH] B #5293: Don't allow CPU hotplug and virtual topology. --- src/vm/VirtualMachineParser.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vm/VirtualMachineParser.cc b/src/vm/VirtualMachineParser.cc index 7eb90f4e71..832d760c9b 100644 --- a/src/vm/VirtualMachineParser.cc +++ b/src/vm/VirtualMachineParser.cc @@ -789,6 +789,7 @@ int VirtualMachine::parse_topology(Template * tmpl, std::string &error) /* ---------------------------------------------------------------------- */ long long memory; unsigned int vcpu = 0; + unsigned int vcpu_max = 0; if (!tmpl->get("MEMORY", memory)) { @@ -807,6 +808,12 @@ int VirtualMachine::parse_topology(Template * tmpl, std::string &error) tmpl->replace("CPU", vcpu); } + if (tmpl->get("VCPU_MAX", vcpu_max)) + { + error = "VM with TOPOLOGY does not support CPU hotplug (VCPU_MAX)"; + return -1; + } + /* ---------------------------------------------------------------------- */ /* Check topology for non pinned & pinned VMs */ /* - non-pinned VM needs to set SOCKETS, CORES and THREADS */