From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>,
Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/7] tests/qgraph: arm/raspi2 machine node
Date: Wed, 11 Jul 2018 17:30:35 +0200 [thread overview]
Message-ID: <2df3c7f1-3777-dbe9-80b9-8bf911a6eb60@redhat.com> (raw)
In-Reply-To: <20180711145946.GO31228@stefanha-x1.localdomain>
On 11/07/2018 16:59, Stefan Hajnoczi wrote:
>> + machine->obj.get_device = raspi2_get_device;
>> + machine->obj.destructor = raspi2_destroy;
>> + qos_create_sdhci_mm(&machine->sdhci, 0x3f300000, &(QSDHCIProperties) {
>> + .version = 3,
>> + .baseclock = 52,
>> + .capab.sdma = false,
>> + .capab.reg = 0x052134b4
>> + });
>> + return &machine->obj;
>> +}
>> +
>> +static void raspi2(void)
>> +{
>> + qos_node_create_machine("arm/raspi2", qos_create_machine_arm_raspi2);
>> + qos_node_contains("arm/raspi2", "generic-sdhci");
>> +}
>> +
>> +libqos_init(raspi2);
> Hmm...I didn't realize it would be necessary to manually define each
> machine type. I thought qgraph would use qemu-system-x86_64
> -machine/-device/info qtree to introspect QEMU and instantiate the
> appropriate drivers.
That doesn't provide enough information yet. However, PCI devices are
already discovered automatically and the next step (next year :)) could
be to use device tree or ACPI to discover embedded devices.
Using QOM properties instead of duplicating things like QSDHCIProperties
is a great idea. Of course the duplication was already there ("old
sdhci_t structure" in patch 7), so I don't think it should be a blocker,
but indeed there's a better way to do it.
> My concern is that this manual approach of defining machines complicates
> qtests. This file will need to be modified by multiple people - each of
> them will be interested in a specific driver and not interested in the
> driver that other people have added.
This is exactly the opposite problem that we have now: when you write a
test you are interested typically only in one machine, and the
"if(x86)elseif(arm)" gets in the way. (Also: it's also difficult to
split the ifs across files, i.e. it scales worse; and there's lots of
duplicated code across tests to do "for" loops of g_test_add, because
the ifs don't lend itself to "automatic" generation of test cases via
path walk).
The advantage is that (just like for OS vs. QEMU) the structure of this
file matches closely the board files in hw/arm/, which is something you
should already be familiar with if you're adding a new board to QEMU.
Paolo
next prev parent reply other threads:[~2018-07-11 15:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 9:11 [Qemu-devel] [PATCH 0/7] Qtest driver framework Emanuele Giuseppe Esposito
2018-07-09 9:11 ` [Qemu-devel] [PATCH 1/7] tests: qgraph API for the qtest " Emanuele Giuseppe Esposito
2018-07-11 14:28 ` Stefan Hajnoczi
2018-07-11 14:58 ` Paolo Bonzini
2018-07-18 14:23 ` Stefan Hajnoczi
2018-07-18 18:05 ` Emanuele
2018-07-18 19:28 ` Paolo Bonzini
2018-07-18 21:13 ` Emanuele
2018-07-27 12:54 ` Stefan Hajnoczi
2018-07-09 9:11 ` [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes Emanuele Giuseppe Esposito
2018-07-11 14:49 ` Stefan Hajnoczi
2018-07-11 15:18 ` Paolo Bonzini
2018-07-18 14:29 ` Stefan Hajnoczi
2018-07-18 18:29 ` Emanuele
2018-07-18 19:33 ` Paolo Bonzini
2018-07-18 20:49 ` Emanuele
2018-07-11 17:46 ` Emanuele
2018-07-18 15:02 ` Stefan Hajnoczi
2018-07-18 19:38 ` Paolo Bonzini
2018-07-11 20:05 ` Philippe Mathieu-Daudé
2018-07-09 9:11 ` [Qemu-devel] [PATCH 3/7] tests/qgraph: sdhci " Emanuele Giuseppe Esposito
2018-07-11 20:13 ` Philippe Mathieu-Daudé
2018-07-11 20:44 ` Emanuele
2018-07-09 9:11 ` [Qemu-devel] [PATCH 4/7] tests/qgraph: arm/raspi2 machine node Emanuele Giuseppe Esposito
2018-07-11 14:59 ` Stefan Hajnoczi
2018-07-11 15:30 ` Paolo Bonzini [this message]
2018-07-11 20:19 ` Philippe Mathieu-Daudé
2018-07-09 9:11 ` [Qemu-devel] [PATCH 5/7] tests/qgraph: x86_64/pc " Emanuele Giuseppe Esposito
2018-07-09 9:11 ` [Qemu-devel] [PATCH 6/7] tests/qgraph: gtest integration Emanuele Giuseppe Esposito
2018-07-11 15:02 ` Stefan Hajnoczi
2018-07-09 9:11 ` [Qemu-devel] [PATCH 7/7] tests/qgraph: sdhci test node Emanuele Giuseppe Esposito
2018-07-11 15:15 ` Stefan Hajnoczi
2018-07-11 17:52 ` Emanuele
2018-07-12 12:07 ` Paolo Bonzini
2018-07-11 14:00 ` [Qemu-devel] [PATCH 0/7] Qtest driver framework Stefan Hajnoczi
2018-07-11 14:17 ` Emanuele
2018-07-11 15:27 ` Stefan Hajnoczi
2018-07-18 17:14 ` Markus Armbruster
2018-07-18 19:35 ` Paolo Bonzini
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=2df3c7f1-3777-dbe9-80b9-8bf911a6eb60@redhat.com \
--to=pbonzini@redhat.com \
--cc=e.emanuelegiuseppe@gmail.com \
--cc=f4bug@amsat.org \
--cc=lvivier@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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 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).