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

Re: [libvirt] [PATCH v2 25/33] qemu: Make virQEMUCapsInitCPUModel testable



On Tue, Feb 21, 2017 at 23:16:46 -0500, John Ferlan wrote:
> 
> 
> On 02/15/2017 11:44 AM, Jiri Denemark wrote:
> > Signed-off-by: Jiri Denemark <jdenemar redhat com>
> > ---
> > 
> > Notes:
> >     Version 2:
> >     - no change
> > 
> >  src/qemu/qemu_capabilities.c | 19 ++++++++++++++-----
> >  src/qemu/qemu_capspriv.h     | 10 ++++++++++
> >  2 files changed, 24 insertions(+), 5 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> > index a77e300b7..3163bba8a 100644
> > --- a/src/qemu/qemu_capabilities.c
> > +++ b/src/qemu/qemu_capabilities.c
> > @@ -3204,7 +3204,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
> >   *          1 when the caller should fall back to using virCapsPtr->host.cpu,
> >   *         -1 on error.
> >   */
> > -static int
> > +int
> >  virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps,
> >                          virDomainVirtType type,
> >                          virCPUDefPtr cpu)
> > @@ -3268,6 +3268,18 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
> >  }
> >  
> >  
> > +void
> > +virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps,
> > +                           virDomainVirtType type,
> > +                           qemuMonitorCPUModelInfoPtr modelInfo)
> > +{
> > +    if (type == VIR_DOMAIN_VIRT_KVM)
> > +        qemuCaps->kvmCPUModelInfo = modelInfo;
> > +    else
> > +        qemuCaps->tcgCPUModelInfo = modelInfo;
> > +}
> > +
> > +
> >  static int
> >  virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCaps,
> >                                  xmlXPathContextPtr ctxt,
> > @@ -3354,10 +3366,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCaps,
> >          }
> >      }
> >  
> > -    if (type == VIR_DOMAIN_VIRT_KVM)
> > -        qemuCaps->kvmCPUModelInfo = hostCPU;
> > -    else
> > -        qemuCaps->tcgCPUModelInfo = hostCPU;
> > +    virQEMUCapsSetCPUModelInfo(qemuCaps, type, hostCPU);
> 
> I think this needs more consistency throughout this code.  That is all
> places that are setting should be changed I think there's a couple
> places that aren't (virQEMUCapsInitHostCPUModel and
> virQEMUCapsLoadCPUModels)

Nope. All places are already converted. Don't confuse
{kvm,tcg}CPUModelInfo with {kvm,tcg}CPUModel.

Jirka


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