]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: bitmap: Don't alloc overly large binary bitmaps
authorPeter Krempa <pkrempa@redhat.com>
Thu, 2 Jul 2015 14:46:46 +0000 (16:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 8 Jul 2015 09:01:33 +0000 (11:01 +0200)
commite8c5f61e91025f244bb022b1774a3fc6484625f8
treeeb3e17504629ed4b442b4749fff236126acbbbb4
parent9777419c81091edb1b8a21f2cc4e538d6c84754f
util: bitmap: Don't alloc overly large binary bitmaps

Optimize the virBitmap to array-of-char bitmap conversion by skipping
trailing zero bytes.

This also fixes a regression when requesting iothread information from a
live VM since after commit 825df8c3158cfaf5f398418471f10f4ff3c3515a the
bitmap returned from virProcessGetAffinity is too big to be formatted
properly via RPC. A user would get the following error:

error: Unable to get domain IOThreads information
error: Unable to encode message payload

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238589
src/util/virbitmap.c