[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface n
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes |
Date: |
Wed, 18 Jul 2018 21:38:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 11/07/2018 19:46, Emanuele wrote:
>>> +static void qpci(void)
>>> +{
>>> + qos_node_create_interface("pci-bus");
>>> +}
>>> +
>>> +libqos_init(qpci);
>> Why does an interface need to be created? The drivers declare which
>> interfaces they support?
>>
>> I don't think this can be used to detect typoes in the driver's
>> qos_node_produces() call since there is no explicit control over the
>> order in which libqos_init() functions are called. So the driver may
>> call qos_node_produces() before the qos_node_create_interface() is
>> called?
> The interface is what is actually given to the test, so from there it
> can test the functions and fields regardless of which driver is actually
> implementing them.
> For example, sdhci-test uses the QSDHCI functions, and depending on the
> path the generic-sdhci or sdhci-pci functions will be used.
I think Stefan is right, if you adjust qos_node_create_interface so that
it is idempotent(*), you can make it static and call it from
qos_node_produces and qos_node_consumes.
(*) that is, fail like now if the node exists and is not an interface;
but, succeed if the node exists and is an interface.
Thanks,
Paolo
Re: [Qemu-devel] [PATCH 2/7] tests/qgraph: pci-pc driver and interface nodes, Philippe Mathieu-Daudé, 2018/07/11
[Qemu-devel] [PATCH 3/7] tests/qgraph: sdhci driver and interface nodes, Emanuele Giuseppe Esposito, 2018/07/09
[Qemu-devel] [PATCH 4/7] tests/qgraph: arm/raspi2 machine node, Emanuele Giuseppe Esposito, 2018/07/09
[Qemu-devel] [PATCH 5/7] tests/qgraph: x86_64/pc machine node, Emanuele Giuseppe Esposito, 2018/07/09
[Qemu-devel] [PATCH 6/7] tests/qgraph: gtest integration, Emanuele Giuseppe Esposito, 2018/07/09