[libvirt] [PATCH 19/34] qemu: Split up vCPU hotplug and hotunplug

Peter Krempa pkrempa at redhat.com
Thu Nov 26 11:31:18 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151126/638d9133/attachment-0001.sig>


More information about the libvir-list mailing list