qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] tests: use qtest_pc_boot()/qtest_pc_shutdow


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH 1/3] tests: use qtest_pc_boot()/qtest_pc_shutdown() in virtio tests
Date: Fri, 30 Sep 2016 12:33:46 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


On 30/09/2016 12:29, Greg Kurz wrote:
> On Fri, 30 Sep 2016 11:13:33 +0200
> Laurent Vivier <address@hidden> wrote:
> 
>> On 30/09/2016 10:33, Greg Kurz wrote:
>>> On Thu, 29 Sep 2016 19:15:05 +0200
>>> Laurent Vivier <address@hidden> wrote:
>>>   
>>>> [...]
>>>>  static void pci_nop(void)
>>>>  {
>>>> -    qvirtio_9p_start();
>>>> -    qvirtio_9p_stop();
>>>> +    QOSState *qs;
>>>> +
>>>> +    qs = qvirtio_9p_start();
>>>> +    g_assert(qs);  
>>>
>>> The appropriate macro to use here is: g_assert_nonnull().  
>>
>> OK
>>
>>>
>>> BTW, how can qs be NULL ?  
>>
>> we should not know what happens in  qtest_pc_boot() (or
>> qtest_spapr_boot(), or qtest_XXX_boot())
>>
> 
> What is the point in letting qtest_XXX_boot() return NULL then if
> it is always followed by g_assert() in the test program code ?
> 
> I'd rather move the assertion there and document that it cannot
> return NULL, since it is always unrecoverable in the test code.

You're right it looks better as you say. I'm going to change that.

Thanks,
Laurent



reply via email to

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