qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1.3] virtio-rng: do not use g_assert_cmpint
@ 2012-11-27  8:16 Paolo Bonzini
  2012-11-29 14:13 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2012-11-27  8:16 UTC (permalink / raw)
  To: qemu-devel

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>
---
 hw/virtio-rng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c
index f4ed9cf..df329f2 100644
--- a/hw/virtio-rng.c
+++ b/hw/virtio-rng.c
@@ -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);
 
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH 1.3] virtio-rng: do not use g_assert_cmpint
  2012-11-27  8:16 [Qemu-devel] [PATCH 1.3] virtio-rng: do not use g_assert_cmpint Paolo Bonzini
@ 2012-11-29 14:13 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2012-11-29 14:13 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On Tue, Nov 27, 2012 at 09:16:24AM +0100, Paolo Bonzini wrote:
> 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>
> ---
>  hw/virtio-rng.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-29 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27  8:16 [Qemu-devel] [PATCH 1.3] virtio-rng: do not use g_assert_cmpint Paolo Bonzini
2012-11-29 14:13 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).