qapi: dealloc visitor, implement visit_start_union
commit146db9f91979db89a123ea10d2b825d3670d2b36
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 18 Sep 2014 20:36:41 +0000 (18 15:36 -0500)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 26 Sep 2014 17:14:10 +0000 (26 13:14 -0400)
treea6b1d5ce3e635e4db14b9308f9bc7c7794e97635
parentcee2dedb85b97e4976c83bea84064c3921b8b7ac
qapi: dealloc visitor, implement visit_start_union

If the .data field of a QAPI Union is NULL, we don't need to free
any of the union fields.

Make use of the new visit_start_union interface to access this
information and instruct the generated code to not visit these
fields when this occurs.

Cc: qemu-stable@nongnu.org
Reported-by: Fam Zheng <famz@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi/qapi-dealloc-visitor.c