qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/9] qtest fixes and alternative IRQ intercept proposal
@ 2012-01-18 10:33 Paolo Bonzini
  2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 1/9] qtest: always send a response Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Paolo Bonzini @ 2012-01-18 10:33 UTC (permalink / raw)
  To: qemu-devel

Anthony,

here are some random qtest patches, for incorporation in your series or
just as food for thought.

Patch 1 makes the tests fail with an assertion failure if libqtest screws
up, rather than just having them sit waiting for a response that will
never come.

Patch 2 makes "-qtest stdio" a bit more useful.

Patch 3 is a fix for the Makefile, which happens when tests fail.

Patch 4 is a fix for some bogus code in the rtc test that GCC flagged.

Patch 5 actually implements the idea of not using TCG for the CPU threads.
Since this is quite easy to do I don't see why not (for example, would you
like to have qtest depend on TCG if your disable-tcg series ever lands?).

Patches 6-9 replace the qtest interrupt controller with interception
on the qtest side.  The idea is to pass a device to a qtest command.
qtest then patches the qemu_irqs for the gpio pins so that, when they
trigger, the notification is sent on the qtest chardev.  Right you can
attach only to one device, and only to either the output side or the
input side.  But even this is already enormously more flexible and IMO
cleaner than the qtest_interrupt_controller.

Attaching to the output side would usually be better for unit testing
of a single device, but not many devices on a PC register gpio pins.
Luckily, one such device is (on the input side) the ioapic, so that
irq_intercept_in("ioapic") provides the exact same behavior as the
qtest_interrupt_controller in your code.

In the future, once gpio pins are converted Pin properties, the commands
could be modified like

   irq_intercept_{in,out} QOM-PATH PROPERTY NUM

which maps the given property to a qtest interrupt number.  In the
meanwhile, the interface works nicely and provides a bit more QOM
dogfooding (as shown by the need for patch 6).

All patches except patch 6 are meant to be squashed in yours; sending
them this way is easier for review and just one "git rebase -i" apart
from the desired result.  Hence the scant commit messages. :)

Paolo Bonzini (9):
  qtest: always send a response
  qtest: enable echo
  qtest: fix Makefile
  rtc-test: fix set_alarm_time
  qtest: do not use TCG CPU threads
  pc: attach ioapic to the QOM composition tree
  qtest: IRQ interception infrastructure
  libqtest: add IRQ intercept commands
  rtc-test: add IRQ intercept

 cpu-exec.c       |    4 --
 cpus.c           |   62 ++++++++++++++++++++++++++++++++--
 hw/irq.c         |   18 ++++++++++
 hw/irq.h         |    3 ++
 hw/pc_piix.c     |    9 +++--
 qtest.c          |  100 +++++++++++++++++++++++++++++++++++++----------------
 qtest.h          |    2 -
 tests/Makefile   |    2 +-
 tests/libqtest.c |   12 ++++++
 tests/libqtest.h |    6 +++
 tests/rtc-test.c |   23 +++----------
 11 files changed, 179 insertions(+), 62 deletions(-)

-- 
1.7.7.1

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

end of thread, other threads:[~2012-01-24 15:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 10:33 [Qemu-devel] [RFC PATCH 0/9] qtest fixes and alternative IRQ intercept proposal Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 1/9] qtest: always send a response Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 2/9] qtest: enable echo Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 3/9] qtest: fix Makefile Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 4/9] rtc-test: fix set_alarm_time Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 5/9] qtest: do not use TCG CPU threads Paolo Bonzini
2012-01-18 10:53   ` Andreas Färber
2012-01-18 11:14     ` Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 6/9] pc: attach ioapic to the QOM composition tree Paolo Bonzini
2012-01-24 15:12   ` Jan Kiszka
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 7/9] qtest: IRQ interception infrastructure Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 8/9] libqtest: add IRQ intercept commands Paolo Bonzini
2012-01-18 10:33 ` [Qemu-devel] [RFC PATCH 9/9] rtc-test: add IRQ intercept Paolo Bonzini
2012-01-18 14:31 ` [Qemu-devel] [RFC PATCH 10/9] qtest: add clock management Paolo Bonzini

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