]> git.proxmox.com Git - mirror_qemu.git/commitdiff
virtio-rng: do not use g_assert_cmpint
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Nov 2012 08:16:24 +0000 (09:16 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 27 Nov 2012 14:51:07 +0000 (08:51 -0600)
g_assert_cmpint is not available on glib 2.12, which is the minimum
version required to build QEMU (we only require 2.16 to run tests,
since that is the first version including GTester).  Do not use it
in hardware models, use a normal assertion instead.

This fixes the buildbot failure for default_x86_64_rhel5.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-rng.c

index f4ed9cf92a9dcf0f0e6ec2ca7d8c92af60ca1fdc..df329f25e1edd5237f99d9a82df84ad7af29ac12 100644 (file)
@@ -173,10 +173,9 @@ VirtIODevice *virtio_rng_init(DeviceState *dev, VirtIORNGConf *conf)
     vrng->qdev = dev;
     vrng->conf = conf;
 
+    assert(vrng->conf->max_bytes <= INT64_MAX);
     vrng->quota_remaining = vrng->conf->max_bytes;
 
-    g_assert_cmpint(vrng->conf->max_bytes, <=, INT64_MAX);
-
     vrng->rate_limit_timer = qemu_new_timer_ms(vm_clock,
                                                check_rate_limit, vrng);