Re: [PATCH 4/7] qemu: Add qemuProcessUpdateLiveGuestCPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 12, 2017 at 15:18:58 +0200, Pavel Hrdina wrote:
> On Wed, Jul 12, 2017 at 02:56:50PM +0200, Jiri Denemark wrote:
> > Separated from qemuProcessUpdateAndVerifyCPU to handle updating of an
> > active guest CPU definition according to live data from QEMU.
> > 
> > Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> > ---
> >  src/qemu/qemu_process.c | 70 +++++++++++++++++++++++++++++--------------------
> >  1 file changed, 42 insertions(+), 28 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> > index ebd13057b..926c64197 100644
> > --- a/src/qemu/qemu_process.c
> > +++ b/src/qemu/qemu_process.c
> > @@ -4011,17 +4011,53 @@ qemuProcessVerifyCPU(virDomainObjPtr vm,
> >  
> >  
> >  static int
> > +qemuProcessUpdateLiveGuestCPU(virDomainObjPtr vm,
> > +                              virCPUDataPtr enabled,
> > +                              virCPUDataPtr disabled)
> > +{
> > +    virDomainDefPtr def = vm->def;
> > +    qemuDomainObjPrivatePtr priv = vm->privateData;
> > +    virCPUDefPtr orig = NULL;
> > +    int rc;
> > +    int ret = -1;
> > +
> > +    if (!enabled ||
> > +        !def->cpu ||
> > +        (def->cpu->mode == VIR_CPU_MODE_CUSTOM &&
> > +         !def->cpu->model))
> 
> Now the condition is extended by another check, this makes the code
> fragile.  I would prefer separating the "!enabled".

OK

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux