On Mon, Nov 23, 2015 at 14:19:58 -0500, John Ferlan wrote:
On 11/20/2015 10:22 AM, Peter Krempa wrote:
> There's only very little common code among the two operations. Split the
> functions so that the internals are easier to understand and refactor
> later.
> ---
> src/qemu/qemu_driver.c | 210 ++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 136 insertions(+), 74 deletions(-)
[...]
>
> if (def) {
> - if (qemuDomainHotplugVcpus(driver, vm, nvcpus) < 0)
> - goto endjob;
> + if (nvcpus > virDomainDefGetVCpus(def)) {
> + if (qemuDomainHotplugVcpus(driver, vm, nvcpus) < 0)
> + goto endjob;
> + } else {
> + if (qemuDomainHotunplugVcpus(driver, vm, nvcpus) < 0)
> + goto endjob;
> + }
Could have gone with HotplugAddVcpus and HotplugDelVcpus (similar to
IOThreads). Whether you change is up to you.
I decided to go with 'qemuDomainHotplugAddVcpu' without the plural form.
It will be misleading a bit until one of the later commits removes the
loop to the caller.
ACK -
John
Peter