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

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

 



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@xxxxxxxxxx>
---

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

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]