[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/6] tests/device-introspection: Check that the
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 2/6] tests/device-introspection: Check that the qom-tree and qtree do not change |
Date: |
Wed, 15 Aug 2018 08:24:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Thomas Huth <address@hidden> writes:
> On 08/14/2018 07:53 PM, Markus Armbruster wrote:
>> Thomas Huth <address@hidden> writes:
> [...]
>>> @@ -115,10 +122,18 @@ static void test_one_device(const char *type)
>>>
>>> /*
>>> * Some devices leave dangling pointers in QOM behind.
>>> - * "info qom-tree" has a good chance at crashing then
>>> + * "info qom-tree" or "info qtree" have a good chance at crashing then.
>>> + * Also make sure that the tree did not change.
>>> */
>>> - qom_tree = hmp("info qom-tree");
>>> - g_free(qom_tree);
>>> + qom_tree_end = hmp("info qom-tree");
>>> + g_assert_cmpstr(qom_tree_start, ==, qom_tree_end);
>>> + g_free(qom_tree_start);
>>> + g_free(qom_tree_end);
>>> +
>>> + qtree_end = hmp("info qtree");
>>> + g_assert_cmpstr(qtree_start, ==, qtree_end);
>>> + g_free(qtree_start);
>>> + g_free(qtree_end);
>>> }
>>>
>>> static void test_device_intro_list(void)
>>
>> Output of "info qom-tree" depends on hash table iteration order, but
>> that could almost be considered a feature here.
>
> Currently, it seems to work fine. If we hit a false positive with
> ordering later, we still can add some code for sorting the output, I guess?
I'm fine with comparing output of info qom-tree and info qtree.
I figure the most likely cause for a change of order would be a series
of QOM tree modifications that cancels out. There should be *no* QOM
tree modifications. Thus, "almost a feature".
[Qemu-devel] [PATCH 3/6] hw/timer/mc146818rtc: White space clean-up, Thomas Huth, 2018/08/14
[Qemu-devel] [PATCH 4/6] hw/timer/mc146818rtc: Fix introspection problem, Thomas Huth, 2018/08/14
[Qemu-devel] [PATCH 5/6] net: Silence 'has no peer' messages in testing mode, Thomas Huth, 2018/08/14