On 30/09/2016 12:29, Greg Kurz wrote: > On Fri, 30 Sep 2016 11:13:33 +0200 > Laurent Vivier <lviv...@redhat.com> wrote: > >> On 30/09/2016 10:33, Greg Kurz wrote: >>> On Thu, 29 Sep 2016 19:15:05 +0200 >>> Laurent Vivier <lviv...@redhat.com> 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