[libvirt] [PATCH] qemu: make qemuGetCompressionProgram return int not an enum

Martin Kletzander mkletzan at redhat.com
Tue Sep 27 09:51:51 UTC 2016


On Tue, Sep 27, 2016 at 09:51:41AM +0100, Daniel P. Berrange wrote:
>enum types are unsigned and the qemuGetCompressionProgram
>function can return -1 on error. It is therefore inappropriate
>to return an enum type. This fixes a build error where the
>internal 'ret' variable was used in a comparison with -1
>
>../../src/qemu/qemu_driver.c: In function 'qemuGetCompressionProgram':
>../../src/qemu/qemu_driver.c:3280:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
>../../src/qemu/qemu_driver.c:3289:5: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
>cc1: all warnings being treated as errors
>
>Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
>---
>
>Pushed as a CI broken build fix.
>

I wanted to push this with one slight modification, basically mentioning
in the comment above the function that it can also return -1.  But
that's fine.

Ideally, I felt like doCoreDump() shouldn't call this function because
just for this one caller it adds unnecessary error handling which no
other caller uses, but since that was the reason for the broken commits,
I didn't want a long debate on that just prolonging the fix.  And the
long rant mail about that series is safely stored in drafts while my
rage is cooling down slowly.

Have a nice day,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160927/491fde45/attachment-0001.sig>


More information about the libvir-list mailing list