All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC v2 6/6] Add C version of rtc-test
Date: Fri, 2 Dec 2011 16:20:29 -0200	[thread overview]
Message-ID: <20111202162029.700f8687@doriath> (raw)
In-Reply-To: <4ED90EB7.1080300@redhat.com>

On Fri, 02 Dec 2011 18:45:27 +0100
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 02.12.2011 18:26, schrieb Anthony Liguori:
> > On 12/02/2011 11:25 AM, Kevin Wolf wrote:
> >> Am 01.12.2011 19:43, schrieb Anthony Liguori:
> >>> ---
> >>>   Makefile   |    4 +
> >>>   rtc-test.c |  201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >>>   2 files changed, 205 insertions(+), 0 deletions(-)
> >>>   create mode 100644 rtc-test.c
> >>>
> >>> diff --git a/Makefile b/Makefile
> >>> index 301c75e..838cb01 100644
> >>> --- a/Makefile
> >>> +++ b/Makefile
> >>> @@ -215,6 +215,10 @@ $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
> >>>
> >>>   qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
> >>>
> >>> +libqtest.o: libqtest.c
> >>
> >> Did you forget to commit libqtest.c?
> > 
> > Probably, sorry about that.
> > 
> >> I think your series is a good start, but the examples only use port I/O.
> >> Most other tests would probably need to access RAM (not sure if it's
> >> convenient to do explicit read/write commands for that), interrupts and
> >> some even QMP.
> > 
> > libqtest.h has:
> > 
> > bool qtest_get_irq(QTestState *s, int num);
> > 
> > void qtest_outb(QTestState *s, uint16_t addr, uint8_t value);
> > 
> > void qtest_outw(QTestState *s, uint16_t addr, uint16_t value);
> > 
> > void qtest_outl(QTestState *s, uint16_t addr, uint32_t value);
> > 
> > uint8_t qtest_inb(QTestState *s, uint16_t addr);
> > 
> > uint16_t qtest_inw(QTestState *s, uint16_t addr);
> > 
> > uint32_t qtest_inl(QTestState *s, uint16_t addr);
> > 
> > void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size);
> > 
> > void qtest_memwrite(QTestState *s, uint64_t addr, const void *data, size_t size);
> > 
> > So that's how you read/write memory.  Likewise, for IRQs, you can poll the 
> > status of a given IRQ.  I thought about doing some sort of signal magic around 
> > but when writing tests, polling the IRQ seems easier to deal with.
> 
> Okay, polling interrupts should be good enough for tests.
> 
> I guess the test still needs to do everything that a guest OS would have
> to do, for example send an EOI to the PIC? We'll probably want to have a
> library for such things then, but we can add it with the first test that
> uses interrupts.
> 
> >> Should the framework and the tests live in the tests/ directory?
> > 
> > Probably, except that tests/ has it's own Makefile which is sort of awkward. 
> > Any objections to moving tests/* to tests/tcg-test and then moving all of the 
> > various gtest/check tests to tests/ along with qtest?
> 
> No objection, I think this is exactly what we should do.

I fully agree.

  reply	other threads:[~2011-12-02 18:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 18:43 [Qemu-devel] [RFC v2 0/6] qtest unit test framework Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 1/6] qtest: add " Anthony Liguori
2011-12-05 14:27   ` Luiz Capitulino
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 2/6] qtest: add support for target-i386 -M pc Anthony Liguori
2011-12-02  7:52   ` Paolo Bonzini
2011-12-29 17:40   ` Peter Maydell
2011-12-29 18:47     ` Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 3/6] Add core python test framework Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 4/6] Add uart test case Anthony Liguori
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 5/6] Add RTC " Anthony Liguori
2011-12-05 14:32   ` Luiz Capitulino
2011-12-01 18:43 ` [Qemu-devel] [RFC v2 6/6] Add C version of rtc-test Anthony Liguori
2011-12-02 17:25   ` Kevin Wolf
2011-12-02 17:26     ` Anthony Liguori
2011-12-02 17:45       ` Kevin Wolf
2011-12-02 18:20         ` Luiz Capitulino [this message]
2011-12-02 18:43         ` Anthony Liguori
2011-12-05  8:51           ` Kevin Wolf
2011-12-04 10:03 ` [Qemu-devel] [RFC v2 0/6] qtest unit test framework Dor Laor
2011-12-05 15:29   ` Anthony Liguori

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=20111202162029.700f8687@doriath \
    --to=lcapitulino@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@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.