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

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

 



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@xxxxxxxxxx>
> > ---
> > 
> > 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

--
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