From d3734b7a1d93ac7994010931b39633d7930b3bfa Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 14 Nov 2016 14:52:30 +0100 Subject: [PATCH] qemu: parse: Assign maximum cpu count from topology if not provided qemu uses this if 'maxcpus' is not present. Do the same in the parsing code. --- src/qemu/qemu_parse_command.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 7ab3dcf5ba..ed92caa328 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -1713,8 +1713,14 @@ qemuParseCommandLineSmp(virDomainDefPtr dom, goto syntax; } - if (maxcpus == 0) - maxcpus = vcpus; + if (maxcpus == 0) { + if (cores) { + if (virDomainDefGetVcpusTopology(dom, &maxcpus) < 0) + goto error; + } else { + maxcpus = vcpus; + } + } if (maxcpus == 0) goto syntax; -- GitLab