]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: avoid 32-bit compiler warning
authorEric Blake <eblake@redhat.com>
Thu, 3 May 2012 23:04:34 +0000 (17:04 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 3 May 2012 23:04:34 +0000 (17:04 -0600)
On 32-bit platforms, gcc warns that the comparison between a long
and (ULLONG_MAX/1024/1024) is always false; throwing in a type
conversion shuts up the warning.

* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Shut gcc up.

src/qemu/qemu_monitor.c

index ca1c7aa9103de674557337ac7882da25ed3353af..0d4319da86304f51411be6f2f3a32fffe2c172ed 100644 (file)
@@ -2785,7 +2785,7 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
               modern);
 
     /* Convert bandwidth MiB to bytes */
-    if (bandwidth > ULLONG_MAX / 1024 / 1024) {
+    if (bandwidth * 1ULL > ULLONG_MAX / 1024 / 1024) {
         qemuReportError(VIR_ERR_OVERFLOW,
                         _("bandwidth must be less than %llu"),
                         ULLONG_MAX / 1024 / 1024);