[ruby PATCH] Fix cpumap allocation for virDomainGetVcpus and use return value

Ján Tomko jtomko at redhat.com
Fri Feb 21 10:44:14 UTC 2020


On Thu, Feb 20, 2020 at 11:01:32AM +0000, Charlie Smurthwaite wrote:
>This patch fixes a bug in which only enough memory for one cpumap is 
>allocated
>for virDomainGetVcpus instead of one per virtual CPU. This Fixes an 
>overflow.
>Additionally, it uses the return value of virDomainGetVcpus to determine how
>many cpuinfo structs were actually populated rather than assuming they 
>all are.
>Finally, it uses the logical CPU number from the cpuinfo struct in the 
>retrurn
>data instead of assuming CPU numbers are sequential. This should 
>handle cases
>where arbitrary CPUs are offline.
>
>Signed-off-by: Charlie Smurthwaite <charlie at atechmedia.com>
>---
>ext/libvirt/domain.c | 7 ++++---
>1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

and pushed

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200221/27a6c1c6/attachment-0001.sig>


More information about the libvir-list mailing list