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

Daniel P. Berrange berrange at redhat.com
Tue Sep 27 08:51:41 UTC 2016


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.

 src/qemu/qemu_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index eaea96f..7873a68 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3264,13 +3264,13 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
  *                           no there was an error, then just return RAW
  *                           indicating none.
  */
-static virQEMUSaveFormat ATTRIBUTE_NONNULL(2)
+static int ATTRIBUTE_NONNULL(2)
 qemuGetCompressionProgram(const char *imageFormat,
                           char **compresspath,
                           const char *styleFormat,
                           bool use_raw_on_fail)
 {
-    virQEMUSaveFormat ret;
+    int ret;
 
     *compresspath = NULL;
 
-- 
2.7.4




More information about the libvir-list mailing list