[libvirt] [PATCH] make virDomainGetMaxVcpus work on inactive domains

Eric Blake eblake at redhat.com
Mon Feb 24 17:34:05 UTC 2014


On 02/19/2014 05:03 AM, Claudio Bley wrote:
> 
> Signed-off-by: Claudio Bley <cbley at av-test.de>
> ---
> OK, how about this patch?
> 
> While at it, should I convert the VIR_DOMAIN_VCPU_* instances to
> VIR_DOMAIN_AFFECT_* instances for consistency?

Yes, making that conversion as a separate patch for consistency would be
nice.


>  {
> -    return esxDomainGetVcpusFlags(domain, (VIR_DOMAIN_AFFECT_LIVE |
> +    return esxDomainGetVcpusFlags(domain, (VIR_DOMAIN_AFFECT_CURRENT |
>                                             VIR_DOMAIN_VCPU_MAXIMUM));

VIR_DOMAIN_AFFECT_CURRENT == 0, so you could simplify this to just
passing VIR_DOMAIN_VCPU_MAXIMUM instead of a bitwise-or.  On the other
hand, making the _CURRENT explicit may be a bit more self-documenting,
so I'm not going to insist.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140224/822da1b4/attachment-0001.sig>


More information about the libvir-list mailing list