qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion
@ 2012-02-19 23:49 Andreas Färber
  2012-02-20  9:11 ` Paolo Bonzini
  2012-02-22 18:53 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Färber @ 2012-02-19 23:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, pbonzini, Andreas Färber

Assert the object is at least sizeof(Object), not sizeof(ObjectClass).

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index b1ead15..dbfd6a4 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
     Object *obj = data;
 
     g_assert(type != NULL);
-    g_assert(type->instance_size >= sizeof(ObjectClass));
+    g_assert(type->instance_size >= sizeof(Object));
 
     type_class_init(type);
     g_assert(type->abstract == false);
-- 
1.7.7

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

* Re: [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion
  2012-02-19 23:49 [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion Andreas Färber
@ 2012-02-20  9:11 ` Paolo Bonzini
  2012-02-22 18:53 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2012-02-20  9:11 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-trivial, qemu-devel

On 02/20/2012 12:49 AM, Andreas Färber wrote:
> Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  qom/object.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/qom/object.c b/qom/object.c
> index b1ead15..dbfd6a4 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
>      Object *obj = data;
>  
>      g_assert(type != NULL);
> -    g_assert(type->instance_size >= sizeof(ObjectClass));
> +    g_assert(type->instance_size >= sizeof(Object));
>  
>      type_class_init(type);
>      g_assert(type->abstract == false);

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

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

* Re: [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion
  2012-02-19 23:49 [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion Andreas Färber
  2012-02-20  9:11 ` Paolo Bonzini
@ 2012-02-22 18:53 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2012-02-22 18:53 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-trivial, pbonzini, qemu-devel

On 02/19/2012 05:49 PM, Andreas Färber wrote:
> Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
>
> Signed-off-by: Andreas Färber<afaerber@suse.de>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   qom/object.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/qom/object.c b/qom/object.c
> index b1ead15..dbfd6a4 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)
>       Object *obj = data;
>
>       g_assert(type != NULL);
> -    g_assert(type->instance_size>= sizeof(ObjectClass));
> +    g_assert(type->instance_size>= sizeof(Object));
>
>       type_class_init(type);
>       g_assert(type->abstract == false);

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

end of thread, other threads:[~2012-02-22 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 23:49 [Qemu-devel] [PATCH] qom: Fix object_initialize_with_type() assertion Andreas Färber
2012-02-20  9:11 ` Paolo Bonzini
2012-02-22 18:53 ` Anthony Liguori

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).