All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: famz@redhat.com, armbru@redhat.com, qemu-stable@nongnu.org,
	lcapitulino@redhat.com, pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH v2 0/4] qapi: fix crash in dealloc visitor for union types
Date: Wed, 17 Sep 2014 16:32:52 -0500	[thread overview]
Message-ID: <1410989576-9311-1-git-send-email-mdroth@linux.vnet.ibm.com> (raw)

This series introduces visit_start_union and visit_end_union as a way
of allowing visitors to trigger generated code to bail out on visiting
union fields if the visitor implementation deems doing so to be unsafe.

See patch 1 for the circumstances that cause the segfault in the
dealloc visitor.

This is a spin-off of a patch submitted by Fam Zheng earlier. See the
thread for additional background on why we're taking this approach:

  http://thread.gmane.org/gmane.comp.emulators.qemu/296090

v2:
  * added comments to clarify true/false visit_start_union vs. errp
    in dealloc visitor implementation (Eric)
  * fixed a line that was >80 characters (Eric)
  * fixed extra period in patch 2 commit msg (Eric)
  * added comments to note reasons why the interface is useable for
    dealloc visitor, but may require extra QAPI groundwork and
    interface parameters to be useful for other types of visitors
  * included Fam's qemu-iotest test case to exercise bug fix in a
    user-triggerable scenario.

 include/qapi/visitor-impl.h             |  2 ++
 include/qapi/visitor.h                  |  2 ++
 qapi/qapi-dealloc-visitor.c             | 26 ++++++++++++++++++++++++++
 qapi/qapi-visit-core.c                  | 15 +++++++++++++++
 scripts/qapi-visit.py                   |  6 ++++++
 tests/qapi-schema/qapi-schema-test.json | 10 ++++++++++
 tests/qapi-schema/qapi-schema-test.out  |  3 +++
 tests/qemu-iotests/087                  | 17 +++++++++++++++++
 tests/qemu-iotests/087.out              | 13 +++++++++++++
 tests/test-qmp-input-strict.c           | 17 +++++++++++++++++
 10 files changed, 111 insertions(+)

             reply	other threads:[~2014-09-17 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 21:32 Michael Roth [this message]
2014-09-17 21:32 ` [Qemu-devel] [PATCH v2 1/4] qapi: add visit_start_union and visit_end_union Michael Roth
2014-09-17 22:33   ` Eric Blake
2014-09-17 21:32 ` [Qemu-devel] [PATCH v2 2/4] qapi: dealloc visitor, implement visit_start_union Michael Roth
2014-09-17 22:27   ` Eric Blake
2014-09-17 21:32 ` [Qemu-devel] [PATCH v2 3/4] tests: add QMP input visitor test for unions with no discriminator Michael Roth
2014-09-17 22:33   ` Eric Blake
2014-09-18 20:19     ` Michael Roth
2014-09-17 21:32 ` [Qemu-devel] [PATCH v2 4/4] qemu-iotests: Test missing "driver" key for blockdev-add Michael Roth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410989576-9311-1-git-send-email-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.