From: Eric Blake Date: Sat, 12 May 2012 13:24:08 +0000 (-0600) Subject: build: really silence the 32-bit warning X-Git-Tag: v0.9.13-rc1~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f89c86004c1c1f23b79fc2d8ee7dbc6f73f6200;p=thirdparty%2Flibvirt.git build: really silence the 32-bit warning Commit cdce2f42d tried to silence a compiler warning on 32-bit builds, but the gcc shipped with RHEL 5 is old enough that the type conversion via multiplication by 1 was insufficient for the task. * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Previous attempt didn't get past all gcc versions. --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0d4319da86..7d69c679c2 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2785,13 +2785,14 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon, modern); /* Convert bandwidth MiB to bytes */ - if (bandwidth * 1ULL > ULLONG_MAX / 1024 / 1024) { + speed = bandwidth; + if (speed > ULLONG_MAX / 1024 / 1024) { qemuReportError(VIR_ERR_OVERFLOW, _("bandwidth must be less than %llu"), ULLONG_MAX / 1024 / 1024); return -1; } - speed = bandwidth * 1024ULL * 1024ULL; + speed <<= 20; if (mon->json) ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,