Counterintuitively the user would end up with a VM with maximum number
of vCPUs available.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1290324
---
src/qemu/qemu_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index be0567a..845d5e1 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3867,6 +3867,12 @@ qemuValidateCpuCount(virDomainDefPtr def,
{
unsigned int maxCpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, def->os.machine);
+ if (virDomainDefGetVcpus(def) == 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Domain requires at least 1 vCPU"));
+ return -1;
+ }
+
if (maxCpus > 0 && virDomainDefGetVcpusMax(def) > maxCpus) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Maximum CPUs greater than specified machine type
limit"));
--
2.6.2