Re: [PATCH 13/34] conf: Move vcpu count check into helper

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

 



On Mon, Nov 23, 2015 at 10:35:34 -0500, John Ferlan wrote:
> 
> 
> On 11/20/2015 10:22 AM, Peter Krempa wrote:
> > ---
> >  src/conf/domain_conf.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index d8c1068..3062b3a 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c
> > @@ -1461,6 +1461,13 @@ int
> >  virDomainDefSetVCpus(virDomainDefPtr def,
> >                       unsigned int vcpus)
> >  {
> > +    if (vcpus > def->maxvcpus) {
> 
> Use accessor (virDomainDefGetVCpusMax)

These are actually accessors to the vcpu related values, so using it
here is rather counterproductive. As you've probably noticed later
once def->vcpus becomes an array of structs, def->maxvcpus is the count
tracking element here, so this function really is a accessor to this
whole infrastructure, so I'll not change it.

Peter

Attachment: signature.asc
Description: Digital signature

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