qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [PATCH v6 12/29] libqos: Track QTestState wi


From: Eric Blake
Subject: Re: [Qemu-ppc] [Qemu-devel] [PATCH v6 12/29] libqos: Track QTestState with QPCIBus
Date: Thu, 7 Sep 2017 08:32:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 09/07/2017 12:35 AM, Thomas Huth wrote:
> On 06.09.2017 23:00, Eric Blake wrote:
>> On 09/05/2017 04:36 AM, Thomas Huth wrote:
>>> On 01.09.2017 20:03, Eric Blake wrote:
>>>> When initializing a QPCIBus, track which QTestState the bus is
>>>> associated with (so that a later patch can then explicitly use
>>>> that test state for all communication on the bus, rather than
>>>> blindly relying on global_qtest).  Update the initialization
>>>> functions to take another parameter, and update all callers to
>>>> pass in state (for now, most callers get away with passing the
>>>> current global_qtest as the current state, although this required
>>>> fixing the order of initialization to ensure qtest_start() is
>>>> called before qpci_init*() in rtl8139-test, and provided an
>>>> opportunity to pass in the allocator in e1000e-test).
>>>>

>>>
>>> Why did you remove the check for qs->alloc?
>>>
>>>> +            qs->pcibus = ops->qpci_init(qs->qts, qs->alloc);
>>
>> Because we want to ensure qpci_init() is called to set qs->qts
>> (presumably, whether or not qs->alloc is set).  Furthermore, only two
>> files declare a 'static QOSOps' structure in the first place
>> (libqos-pc.c and libqos-spapr.c); where both files set both the
>> .init_allocator and .qpci_init callbacks; a little bit of auditing shows
>> that the .init_allocator() never returns NULL (although that requires
>> browsing yet more files for malloc-{pc,spapr}.c).
> 
> OK, thanks for the explanation! ... but maybe we should
> g_assert(gs->alloc) somewhere instead? ... just an idea, I'm also fine
> if you leave it away.

Users of QOSOps always supply qs->alloc, but there are tests that
successfully use NULL for qs->alloc (because they did not go through
QOSOps).  At any rate, I can certainly update the commit message.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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