qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 0/9] qtest fixes and alternative IRQ intercept p


From: Paolo Bonzini
Subject: [Qemu-devel] [RFC PATCH 0/9] qtest fixes and alternative IRQ intercept proposal
Date: Wed, 18 Jan 2012 11:33:05 +0100

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]