[{"id":1761939,"web_url":"http://patchwork.ozlabs.org/comment/1761939/","msgid":"<6c2e878d-fbb3-ce73-2b90-6fd1d92cfef1@amsat.org>","list_archive_url":null,"date":"2017-09-01T19:24:26","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"On 09/01/2017 03:03 PM, Eric Blake wrote:\n> Drop one more client of global_qtest by teaching all fw_cfg test\n> functionality (invoked through alloc-pc) to pass in an explicit\n> QTestState, adjusting all callers.  In particular, fw_cfg-test\n> had to reorder things to create the test state prior to creating\n> the fw_cfg.\n> \n> Signed-off-by: Eric Blake <eblake@redhat.com>\n\nReviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n\n> ---\n>   tests/libqos/fw_cfg.h       | 10 ++++++----\n>   tests/libqos/libqos.h       |  2 +-\n>   tests/libqos/malloc-pc.h    |  4 ++--\n>   tests/libqos/malloc-spapr.h |  2 +-\n>   tests/libqos/malloc.h       |  1 +\n>   tests/boot-order-test.c     |  6 +++---\n>   tests/e1000e-test.c         |  2 +-\n>   tests/fw_cfg-test.c         | 14 ++++++--------\n>   tests/ide-test.c            |  2 +-\n>   tests/libqos/fw_cfg.c       | 14 ++++++++------\n>   tests/libqos/libqos.c       |  2 +-\n>   tests/libqos/malloc-pc.c    |  8 ++++----\n>   tests/libqos/malloc-spapr.c |  4 ++--\n>   tests/vhost-user-test.c     |  2 +-\n>   14 files changed, 38 insertions(+), 35 deletions(-)\n> \n> diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h\n> index e8371b2317..396dd4ee1e 100644\n> --- a/tests/libqos/fw_cfg.h\n> +++ b/tests/libqos/fw_cfg.h\n> @@ -15,10 +15,12 @@\n> \n> \n>   typedef struct QFWCFG QFWCFG;\n> +typedef struct QTestState QTestState;\n> \n>   struct QFWCFG\n>   {\n>       uint64_t base;\n> +    QTestState *qts;\n>       void (*select)(QFWCFG *fw_cfg, uint16_t key);\n>       void (*read)(QFWCFG *fw_cfg, void *data, size_t len);\n>   };\n> @@ -30,12 +32,12 @@ uint16_t qfw_cfg_get_u16(QFWCFG *fw_cfg, uint16_t key);\n>   uint32_t qfw_cfg_get_u32(QFWCFG *fw_cfg, uint16_t key);\n>   uint64_t qfw_cfg_get_u64(QFWCFG *fw_cfg, uint16_t key);\n> \n> -QFWCFG *mm_fw_cfg_init(uint64_t base);\n> -QFWCFG *io_fw_cfg_init(uint16_t base);\n> +QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base);\n> +QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base);\n> \n> -static inline QFWCFG *pc_fw_cfg_init(void)\n> +static inline QFWCFG *pc_fw_cfg_init(QTestState *qts)\n>   {\n> -    return io_fw_cfg_init(0x510);\n> +    return io_fw_cfg_init(qts, 0x510);\n>   }\n> \n>   #endif\n> diff --git a/tests/libqos/libqos.h b/tests/libqos/libqos.h\n> index 78e5c044a0..07d4b93d1d 100644\n> --- a/tests/libqos/libqos.h\n> +++ b/tests/libqos/libqos.h\n> @@ -8,7 +8,7 @@\n>   typedef struct QOSState QOSState;\n> \n>   typedef struct QOSOps {\n> -    QGuestAllocator *(*init_allocator)(QAllocOpts);\n> +    QGuestAllocator *(*init_allocator)(QTestState *qts, QAllocOpts);\n>       void (*uninit_allocator)(QGuestAllocator *);\n>       QPCIBus *(*qpci_init)(QTestState *qts, QGuestAllocator *alloc);\n>       void (*qpci_free)(QPCIBus *bus);\n> diff --git a/tests/libqos/malloc-pc.h b/tests/libqos/malloc-pc.h\n> index 86ab9f0429..10f3da6cf2 100644\n> --- a/tests/libqos/malloc-pc.h\n> +++ b/tests/libqos/malloc-pc.h\n> @@ -15,8 +15,8 @@\n> \n>   #include \"libqos/malloc.h\"\n> \n> -QGuestAllocator *pc_alloc_init(void);\n> -QGuestAllocator *pc_alloc_init_flags(QAllocOpts flags);\n> +QGuestAllocator *pc_alloc_init(QTestState *qts);\n> +QGuestAllocator *pc_alloc_init_flags(QTestState *qts, QAllocOpts flags);\n>   void pc_alloc_uninit(QGuestAllocator *allocator);\n> \n>   #endif\n> diff --git a/tests/libqos/malloc-spapr.h b/tests/libqos/malloc-spapr.h\n> index 64d0e770d1..52a9346a26 100644\n> --- a/tests/libqos/malloc-spapr.h\n> +++ b/tests/libqos/malloc-spapr.h\n> @@ -11,7 +11,7 @@\n>   #include \"libqos/malloc.h\"\n> \n>   QGuestAllocator *spapr_alloc_init(void);\n> -QGuestAllocator *spapr_alloc_init_flags(QAllocOpts flags);\n> +QGuestAllocator *spapr_alloc_init_flags(QTestState *qts, QAllocOpts flags);\n>   void spapr_alloc_uninit(QGuestAllocator *allocator);\n> \n>   #endif\n> diff --git a/tests/libqos/malloc.h b/tests/libqos/malloc.h\n> index ae9dac8f61..828fddabdb 100644\n> --- a/tests/libqos/malloc.h\n> +++ b/tests/libqos/malloc.h\n> @@ -14,6 +14,7 @@\n>   #define LIBQOS_MALLOC_H\n> \n>   #include \"qemu/queue.h\"\n> +#include \"libqtest.h\"\n> \n>   typedef enum {\n>       ALLOC_NO_FLAGS    = 0x00,\n> diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c\n> index 9d516830dd..5fc2ca8e9e 100644\n> --- a/tests/boot-order-test.c\n> +++ b/tests/boot-order-test.c\n> @@ -135,7 +135,7 @@ static void test_prep_boot_order(void)\n> \n>   static uint64_t read_boot_order_pmac(void)\n>   {\n> -    QFWCFG *fw_cfg = mm_fw_cfg_init(0xf0000510);\n> +    QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xf0000510);\n> \n>       return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);\n>   }\n> @@ -160,7 +160,7 @@ static void test_pmac_newworld_boot_order(void)\n> \n>   static uint64_t read_boot_order_sun4m(void)\n>   {\n> -    QFWCFG *fw_cfg = mm_fw_cfg_init(0xd00000510ULL);\n> +    QFWCFG *fw_cfg = mm_fw_cfg_init(global_qtest, 0xd00000510ULL);\n> \n>       return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);\n>   }\n> @@ -172,7 +172,7 @@ static void test_sun4m_boot_order(void)\n> \n>   static uint64_t read_boot_order_sun4u(void)\n>   {\n> -    QFWCFG *fw_cfg = io_fw_cfg_init(0x510);\n> +    QFWCFG *fw_cfg = io_fw_cfg_init(global_qtest, 0x510);\n> \n>       return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE);\n>   }\n> diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c\n> index d8085d944e..32aa738b72 100644\n> --- a/tests/e1000e-test.c\n> +++ b/tests/e1000e-test.c\n> @@ -392,7 +392,7 @@ static void data_test_init(e1000e_device *d)\n>       qtest_start(cmdline);\n>       g_free(cmdline);\n> \n> -    test_alloc = pc_alloc_init();\n> +    test_alloc = pc_alloc_init(global_qtest);\n>       g_assert_nonnull(test_alloc);\n> \n>       test_bus = qpci_init_pc(global_qtest, test_alloc);\n> diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c\n> index 688342bed5..47596c57a1 100644\n> --- a/tests/fw_cfg-test.c\n> +++ b/tests/fw_cfg-test.c\n> @@ -107,7 +107,11 @@ int main(int argc, char **argv)\n> \n>       g_test_init(&argc, &argv, NULL);\n> \n> -    fw_cfg = pc_fw_cfg_init();\n> +    cmdline = g_strdup_printf(\"-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8 \");\n> +    s = qtest_start(cmdline);\n> +    g_free(cmdline);\n> +\n> +    fw_cfg = pc_fw_cfg_init(s);\n> \n>       qtest_add_func(\"fw_cfg/signature\", test_fw_cfg_signature);\n>       qtest_add_func(\"fw_cfg/id\", test_fw_cfg_id);\n> @@ -125,15 +129,9 @@ int main(int argc, char **argv)\n>       qtest_add_func(\"fw_cfg/numa\", test_fw_cfg_numa);\n>       qtest_add_func(\"fw_cfg/boot_menu\", test_fw_cfg_boot_menu);\n> \n> -    cmdline = g_strdup_printf(\"-uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8 \");\n> -    s = qtest_start(cmdline);\n> -    g_free(cmdline);\n> -\n>       ret = g_test_run();\n> \n> -    if (s) {\n> -        qtest_quit(s);\n> -    }\n> +    qtest_quit(s);\n> \n>       return ret;\n>   }\n> diff --git a/tests/ide-test.c b/tests/ide-test.c\n> index b2237b6158..084f6a5f96 100644\n> --- a/tests/ide-test.c\n> +++ b/tests/ide-test.c\n> @@ -125,7 +125,7 @@ static void ide_test_start(const char *cmdline_fmt, ...)\n>       va_end(ap);\n> \n>       qtest_start(cmdline);\n> -    guest_malloc = pc_alloc_init();\n> +    guest_malloc = pc_alloc_init(global_qtest);\n> \n>       g_free(cmdline);\n>   }\n> diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c\n> index 4d9dc3fd0b..d0889d1e22 100644\n> --- a/tests/libqos/fw_cfg.c\n> +++ b/tests/libqos/fw_cfg.c\n> @@ -56,7 +56,7 @@ uint64_t qfw_cfg_get_u64(QFWCFG *fw_cfg, uint16_t key)\n> \n>   static void mm_fw_cfg_select(QFWCFG *fw_cfg, uint16_t key)\n>   {\n> -    writew(fw_cfg->base, key);\n> +    qtest_writew(fw_cfg->qts, fw_cfg->base, key);\n>   }\n> \n>   static void mm_fw_cfg_read(QFWCFG *fw_cfg, void *data, size_t len)\n> @@ -65,15 +65,16 @@ static void mm_fw_cfg_read(QFWCFG *fw_cfg, void *data, size_t len)\n>       int i;\n> \n>       for (i = 0; i < len; i++) {\n> -        ptr[i] = readb(fw_cfg->base + 2);\n> +        ptr[i] = qtest_readb(fw_cfg->qts, fw_cfg->base + 2);\n>       }\n>   }\n> \n> -QFWCFG *mm_fw_cfg_init(uint64_t base)\n> +QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base)\n>   {\n>       QFWCFG *fw_cfg = g_malloc0(sizeof(*fw_cfg));\n> \n>       fw_cfg->base = base;\n> +    fw_cfg->qts = qts;\n>       fw_cfg->select = mm_fw_cfg_select;\n>       fw_cfg->read = mm_fw_cfg_read;\n> \n> @@ -82,7 +83,7 @@ QFWCFG *mm_fw_cfg_init(uint64_t base)\n> \n>   static void io_fw_cfg_select(QFWCFG *fw_cfg, uint16_t key)\n>   {\n> -    outw(fw_cfg->base, key);\n> +    qtest_outw(fw_cfg->qts, fw_cfg->base, key);\n>   }\n> \n>   static void io_fw_cfg_read(QFWCFG *fw_cfg, void *data, size_t len)\n> @@ -91,15 +92,16 @@ static void io_fw_cfg_read(QFWCFG *fw_cfg, void *data, size_t len)\n>       int i;\n> \n>       for (i = 0; i < len; i++) {\n> -        ptr[i] = inb(fw_cfg->base + 1);\n> +        ptr[i] = qtest_inb(fw_cfg->qts, fw_cfg->base + 1);\n>       }\n>   }\n> \n> -QFWCFG *io_fw_cfg_init(uint16_t base)\n> +QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base)\n>   {\n>       QFWCFG *fw_cfg = g_malloc0(sizeof(*fw_cfg));\n> \n>       fw_cfg->base = base;\n> +    fw_cfg->qts = qts;\n>       fw_cfg->select = io_fw_cfg_select;\n>       fw_cfg->read = io_fw_cfg_read;\n> \n> diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c\n> index c95428e1cb..62d2f39b93 100644\n> --- a/tests/libqos/libqos.c\n> +++ b/tests/libqos/libqos.c\n> @@ -24,7 +24,7 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap)\n>       qs->ops = ops;\n>       if (ops) {\n>           if (ops->init_allocator) {\n> -            qs->alloc = ops->init_allocator(ALLOC_NO_FLAGS);\n> +            qs->alloc = ops->init_allocator(qs->qts, ALLOC_NO_FLAGS);\n>           }\n>           if (ops->qpci_init) {\n>               qs->pcibus = ops->qpci_init(qs->qts, qs->alloc);\n> diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c\n> index dd2b900c5f..634b9c288a 100644\n> --- a/tests/libqos/malloc-pc.c\n> +++ b/tests/libqos/malloc-pc.c\n> @@ -29,11 +29,11 @@ void pc_alloc_uninit(QGuestAllocator *allocator)\n>       alloc_uninit(allocator);\n>   }\n> \n> -QGuestAllocator *pc_alloc_init_flags(QAllocOpts flags)\n> +QGuestAllocator *pc_alloc_init_flags(QTestState *qts, QAllocOpts flags)\n>   {\n>       QGuestAllocator *s;\n>       uint64_t ram_size;\n> -    QFWCFG *fw_cfg = pc_fw_cfg_init();\n> +    QFWCFG *fw_cfg = pc_fw_cfg_init(qts);\n> \n>       ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE);\n>       s = alloc_init_flags(flags, 1 << 20, MIN(ram_size, 0xE0000000));\n> @@ -45,7 +45,7 @@ QGuestAllocator *pc_alloc_init_flags(QAllocOpts flags)\n>       return s;\n>   }\n> \n> -inline QGuestAllocator *pc_alloc_init(void)\n> +inline QGuestAllocator *pc_alloc_init(QTestState *qts)\n>   {\n> -    return pc_alloc_init_flags(ALLOC_NO_FLAGS);\n> +    return pc_alloc_init_flags(qts, ALLOC_NO_FLAGS);\n>   }\n> diff --git a/tests/libqos/malloc-spapr.c b/tests/libqos/malloc-spapr.c\n> index 006404af33..1c359cea6c 100644\n> --- a/tests/libqos/malloc-spapr.c\n> +++ b/tests/libqos/malloc-spapr.c\n> @@ -22,7 +22,7 @@ void spapr_alloc_uninit(QGuestAllocator *allocator)\n>       alloc_uninit(allocator);\n>   }\n> \n> -QGuestAllocator *spapr_alloc_init_flags(QAllocOpts flags)\n> +QGuestAllocator *spapr_alloc_init_flags(QTestState *qts, QAllocOpts flags)\n>   {\n>       QGuestAllocator *s;\n> \n> @@ -34,5 +34,5 @@ QGuestAllocator *spapr_alloc_init_flags(QAllocOpts flags)\n> \n>   QGuestAllocator *spapr_alloc_init(void)\n>   {\n> -    return spapr_alloc_init_flags(ALLOC_NO_FLAGS);\n> +    return spapr_alloc_init_flags(NULL, ALLOC_NO_FLAGS);\n>   }\n> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c\n> index ea7d38ea44..562bfaefd2 100644\n> --- a/tests/vhost-user-test.c\n> +++ b/tests/vhost-user-test.c\n> @@ -894,7 +894,7 @@ static void test_multiqueue(void)\n>       bus = qpci_init_pc(global_qtest, NULL);\n>       dev = virtio_net_pci_init(bus, PCI_SLOT);\n> \n> -    alloc = pc_alloc_init();\n> +    alloc = pc_alloc_init(global_qtest);\n>       for (i = 0; i < queues * 2; i++) {\n>           vq[i] = (QVirtQueuePCI *)qvirtqueue_setup(&dev->vdev, alloc, i);\n>       }\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"TuaaDOJB\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkTjC5z2dz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 05:25:19 +1000 (AEST)","from localhost ([::1]:56536 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnrZ7-00064f-W5\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 15:25:18 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39115)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrYh-0005xI-8C\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 15:24:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrYb-0004zf-PG\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 15:24:51 -0400","from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:37234)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dnrYN-0004qG-FI; Fri, 01 Sep 2017 15:24:31 -0400","by mail-qt0-x244.google.com with SMTP id x29so855814qtc.4;\n\tFri, 01 Sep 2017 12:24:31 -0700 (PDT)","from [192.168.1.10] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tq14sm7858490qki.90.2017.09.01.12.24.27\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 01 Sep 2017 12:24:30 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=tgvw+0jWTuGBFDBOH10Yuuzmz9CJw/T2G8EkrrUGgzE=;\n\tb=TuaaDOJBmTWSq+dsQx0EKeD1RlcbzEH2ffrhnmSBoo6rMCXpwgEk/FuGKWNpn8Yy60\n\t0gfPVhMKVBDnM97+YEJQCUiDvTobIPbgqYJ3z9lm5dUJSAMM6g1yaYPFhqL3C1Hh+69a\n\th5kP+GBUIsiLyKW2hAyGYB8js0zcs5wQGakfSy7X2wNNVUaQ7L0yPh0a52ys1DzxLEHY\n\tFMUyOrUyjkoeRcHEXfWuIPd8z+oI6Wv8MmUFg5FvLuzBXzLO5wB7Y53GjkdHHPsUU+6E\n\tuir12Jahojwy+iVEps6eApqg00Etv1QLf5+I2yZzi6Whjw/2jNfRzuIxd4YratpbRkZQ\n\tg0lQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:subject:to:cc:references:from:message-id\n\t:date:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=tgvw+0jWTuGBFDBOH10Yuuzmz9CJw/T2G8EkrrUGgzE=;\n\tb=JORBe9gKb403AlKujgifC927H+N8IYEl7ITTYvbvHSOgS+biFhcLyZlzBKPLcZixqA\n\tUTKfPOkio+rx4PGP86yPjKpnK4Ut3T7xoCsiOz2oV/a0/XAdG+am/QWJs64Qj3I4fUDB\n\tPNhhxwxBpTkFB92ibgkhTRqttuQOt+nAi/0AkkDA5IrMMblNSIJeIefiAXJRQ3bQyy1E\n\tIFHGeopu7lKyNzZkcSS7dIDqG8XvRHl0Ksk+OjCsFFfrE3oOOjd61Wo6pzO13v+bewfU\n\tULMhRt+atmtToau6JQCcmo9h4qKpBasJwSdn2kblFaYYoTPp2tLpWCRVVlETua9jeM69\n\t7eYw==","X-Gm-Message-State":"AHPjjUjYnWxWJpRtIQs9b229cJvctVA+TEjgnYy4KKkLrFW2RxqCvu+x\n\t6dV/+EB8MMc90Q==","X-Google-Smtp-Source":"ADKCNb4BfycN8ZO6VZi091V8Sv7AUyYI9nXXGV+cyFkofeTwxjHvML1ZQVyezXJH532AGynqnVaWNg==","X-Received":"by 10.200.1.67 with SMTP id f3mr4243795qtg.4.1504293870760;\n\tFri, 01 Sep 2017 12:24:30 -0700 (PDT)","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<6c2e878d-fbb3-ce73-2b90-6fd1d92cfef1@amsat.org>","Date":"Fri, 1 Sep 2017 16:24:26 -0300","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170901180340.30009-15-eblake@redhat.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::244","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, John Snow <jsnow@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1762028,"web_url":"http://patchwork.ozlabs.org/comment/1762028/","msgid":"<6d3a0a60-ba74-9e6f-0099-a811fc4115e5@redhat.com>","list_archive_url":null,"date":"2017-09-01T23:06:40","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":64343,"url":"http://patchwork.ozlabs.org/api/people/64343/","name":"John Snow","email":"jsnow@redhat.com"},"content":"On 09/01/2017 02:03 PM, Eric Blake wrote:\n> Drop one more client of global_qtest by teaching all fw_cfg test\n> functionality (invoked through alloc-pc) to pass in an explicit\n> QTestState, adjusting all callers.  In particular, fw_cfg-test\n> had to reorder things to create the test state prior to creating\n> the fw_cfg.\n> \n> Signed-off-by: Eric Blake <eblake@redhat.com>\n\nReviewed-by: John Snow <jsnow@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jsnow@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkZdl70Lqz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 09:07:39 +1000 (AEST)","from localhost ([::1]:37649 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnv2I-0003QR-2k\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 19:07:38 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:57473)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dnv1W-0003IG-0H\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 19:06:54 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jsnow@redhat.com>) id 1dnv1V-00080B-1l\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 19:06:49 -0400","from mx1.redhat.com ([209.132.183.28]:40196)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jsnow@redhat.com>)\n\tid 1dnv1P-0007wg-9J; Fri, 01 Sep 2017 19:06:43 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 47B765F7A9;\n\tFri,  1 Sep 2017 23:06:42 +0000 (UTC)","from [10.18.17.130] (dhcp-17-130.bos.redhat.com [10.18.17.130])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 5A825783AA;\n\tFri,  1 Sep 2017 23:06:41 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 47B765F7A9","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>","From":"John Snow <jsnow@redhat.com>","Message-ID":"<6d3a0a60-ba74-9e6f-0099-a811fc4115e5@redhat.com>","Date":"Fri, 1 Sep 2017 19:06:40 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170901180340.30009-15-eblake@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tFri, 01 Sep 2017 23:06:42 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, David Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763176,"web_url":"http://patchwork.ozlabs.org/comment/1763176/","msgid":"<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>","list_archive_url":null,"date":"2017-09-05T10:12:00","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 01.09.2017 20:03, Eric Blake wrote:\n> Drop one more client of global_qtest by teaching all fw_cfg test\n> functionality (invoked through alloc-pc) to pass in an explicit\n> QTestState, adjusting all callers.  In particular, fw_cfg-test\n> had to reorder things to create the test state prior to creating\n> the fw_cfg.\n> \n> Signed-off-by: Eric Blake <eblake@redhat.com>\n> ---\n>  tests/libqos/fw_cfg.h       | 10 ++++++----\n>  tests/libqos/libqos.h       |  2 +-\n>  tests/libqos/malloc-pc.h    |  4 ++--\n>  tests/libqos/malloc-spapr.h |  2 +-\n>  tests/libqos/malloc.h       |  1 +\n>  tests/boot-order-test.c     |  6 +++---\n>  tests/e1000e-test.c         |  2 +-\n>  tests/fw_cfg-test.c         | 14 ++++++--------\n>  tests/ide-test.c            |  2 +-\n>  tests/libqos/fw_cfg.c       | 14 ++++++++------\n>  tests/libqos/libqos.c       |  2 +-\n>  tests/libqos/malloc-pc.c    |  8 ++++----\n>  tests/libqos/malloc-spapr.c |  4 ++--\n>  tests/vhost-user-test.c     |  2 +-\n>  14 files changed, 38 insertions(+), 35 deletions(-)\n> \n> diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h\n> index e8371b2317..396dd4ee1e 100644\n> --- a/tests/libqos/fw_cfg.h\n> +++ b/tests/libqos/fw_cfg.h\n> @@ -15,10 +15,12 @@\n> \n> \n>  typedef struct QFWCFG QFWCFG;\n> +typedef struct QTestState QTestState;\n\nNot sure, but I slightly remember that typedeffing a struct like this in\nmultiple places can cause compiler warnings or errors with certain\nversions of GCC or clang? So a file that includes both, fw_cfg.h and\nlibqtest.h will then fail to compile?\n\nI think it would be better to change the include order in the .c files\ninstead, so that libqtest.h is always included before fw_cfg.h.\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmjG22yCrz9sNq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 20:12:58 +1000 (AEST)","from localhost ([::1]:57913 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpAql-00068L-FA\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 06:12:55 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:43847)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dpAqN-000680-G5\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:12:36 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dpAqE-00038r-Ag\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:12:26 -0400","from mx1.redhat.com ([209.132.183.28]:32838)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1dpAq1-00030m-Br; Tue, 05 Sep 2017 06:12:09 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 68816883B1;\n\tTue,  5 Sep 2017 10:12:08 +0000 (UTC)","from [10.36.116.114] (ovpn-116-114.ams2.redhat.com [10.36.116.114])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 8738CCDBD1;\n\tTue,  5 Sep 2017 10:12:02 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 68816883B1","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>","From":"Thomas Huth <thuth@redhat.com>","Message-ID":"<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>","Date":"Tue, 5 Sep 2017 12:12:00 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170901180340.30009-15-eblake@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tTue, 05 Sep 2017 10:12:08 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, John Snow <jsnow@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763213,"web_url":"http://patchwork.ozlabs.org/comment/1763213/","msgid":"<a91fb46c-0044-3fcc-70a7-60f186a37c9f@redhat.com>","list_archive_url":null,"date":"2017-09-05T11:03:38","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":66152,"url":"http://patchwork.ozlabs.org/api/people/66152/","name":"Thomas Huth","email":"thuth@redhat.com"},"content":"On 05.09.2017 12:12, Thomas Huth wrote:\n> On 01.09.2017 20:03, Eric Blake wrote:\n>> Drop one more client of global_qtest by teaching all fw_cfg test\n>> functionality (invoked through alloc-pc) to pass in an explicit\n>> QTestState, adjusting all callers.  In particular, fw_cfg-test\n>> had to reorder things to create the test state prior to creating\n>> the fw_cfg.\n>>\n>> Signed-off-by: Eric Blake <eblake@redhat.com>\n>> ---\n>>  tests/libqos/fw_cfg.h       | 10 ++++++----\n>>  tests/libqos/libqos.h       |  2 +-\n>>  tests/libqos/malloc-pc.h    |  4 ++--\n>>  tests/libqos/malloc-spapr.h |  2 +-\n>>  tests/libqos/malloc.h       |  1 +\n>>  tests/boot-order-test.c     |  6 +++---\n>>  tests/e1000e-test.c         |  2 +-\n>>  tests/fw_cfg-test.c         | 14 ++++++--------\n>>  tests/ide-test.c            |  2 +-\n>>  tests/libqos/fw_cfg.c       | 14 ++++++++------\n>>  tests/libqos/libqos.c       |  2 +-\n>>  tests/libqos/malloc-pc.c    |  8 ++++----\n>>  tests/libqos/malloc-spapr.c |  4 ++--\n>>  tests/vhost-user-test.c     |  2 +-\n>>  14 files changed, 38 insertions(+), 35 deletions(-)\n>>\n>> diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h\n>> index e8371b2317..396dd4ee1e 100644\n>> --- a/tests/libqos/fw_cfg.h\n>> +++ b/tests/libqos/fw_cfg.h\n>> @@ -15,10 +15,12 @@\n>>\n>>\n>>  typedef struct QFWCFG QFWCFG;\n>> +typedef struct QTestState QTestState;\n> \n> Not sure, but I slightly remember that typedeffing a struct like this in\n> multiple places can cause compiler warnings or errors with certain\n> versions of GCC or clang? So a file that includes both, fw_cfg.h and\n> libqtest.h will then fail to compile?\n> \n> I think it would be better to change the include order in the .c files\n> instead, so that libqtest.h is always included before fw_cfg.h.\n\nAh, well, I just saw that you also sent a fixup patch for this. Anyway,\nI'm not a fan of including header files from other header files, so\nchanging the include order in the .c files sounds like the better\nsolution to me.\n\n Thomas","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=thuth@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmkPl2qMkz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 21:04:42 +1000 (AEST)","from localhost ([::1]:58104 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpBeq-000146-Lj\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 07:04:40 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41555)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dpBeO-00013r-7T\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 07:04:16 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <thuth@redhat.com>) id 1dpBeE-0001mY-Lv\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 07:04:12 -0400","from mx1.redhat.com ([209.132.183.28]:47250)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <thuth@redhat.com>)\n\tid 1dpBdx-0001VQ-HZ; Tue, 05 Sep 2017 07:03:45 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id F2AF86147E;\n\tTue,  5 Sep 2017 11:03:43 +0000 (UTC)","from [10.36.116.114] (ovpn-116-114.ams2.redhat.com [10.36.116.114])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id DB62A7DEF4;\n\tTue,  5 Sep 2017 11:03:39 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com F2AF86147E","From":"Thomas Huth <thuth@redhat.com>","To":"Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>\n\t<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>","Message-ID":"<a91fb46c-0044-3fcc-70a7-60f186a37c9f@redhat.com>","Date":"Tue, 5 Sep 2017 13:03:38 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tTue, 05 Sep 2017 11:03:44 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, John Snow <jsnow@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764379,"web_url":"http://patchwork.ozlabs.org/comment/1764379/","msgid":"<5b39beb0-530e-cc63-2917-cd121d515ee3@redhat.com>","list_archive_url":null,"date":"2017-09-06T21:10:39","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/05/2017 06:03 AM, Thomas Huth wrote:\n> On 05.09.2017 12:12, Thomas Huth wrote:\n>> On 01.09.2017 20:03, Eric Blake wrote:\n>>> Drop one more client of global_qtest by teaching all fw_cfg test\n>>> functionality (invoked through alloc-pc) to pass in an explicit\n>>> QTestState, adjusting all callers.  In particular, fw_cfg-test\n>>> had to reorder things to create the test state prior to creating\n>>> the fw_cfg.\n>>>\n\n>>> +++ b/tests/libqos/fw_cfg.h\n>>> @@ -15,10 +15,12 @@\n>>>\n>>>\n>>>  typedef struct QFWCFG QFWCFG;\n>>> +typedef struct QTestState QTestState;\n>>\n>> Not sure, but I slightly remember that typedeffing a struct like this in\n>> multiple places can cause compiler warnings or errors with certain\n>> versions of GCC or clang? So a file that includes both, fw_cfg.h and\n>> libqtest.h will then fail to compile?\n\nYes, older gcc fails to compile (my off-hand recollection is that it was\na bug in the older gcc, and not a standards-compliance issue to\nencounter the same typedef twice, but I could be wrong), ergo the fixup\nthat you later noticed.\n\n>>\n>> I think it would be better to change the include order in the .c files\n>> instead, so that libqtest.h is always included before fw_cfg.h.\n> \n> Ah, well, I just saw that you also sent a fixup patch for this. Anyway,\n> I'm not a fan of including header files from other header files, so\n> changing the include order in the .c files sounds like the better\n> solution to me.\n\nEww. I like headers to be self-contained.  Other than stuff we get from\nosdep.h (which we know is included by EVERY .c file), I prefer that if a\nheader uses another type, then it guarantees that an idempotent\ninclusion of a header that declares that type is also present in the\nheader file, rather than forcing .c files to know which order to include\nthings in.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnbqQ1jxRz9t2r\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 07:11:30 +1000 (AEST)","from localhost ([::1]:37784 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dphbc-0007tC-Ah\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 17:11:28 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33823)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dphb7-0007rV-Lo\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 17:10:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dphb6-0007SA-HP\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 17:10:57 -0400","from mx1.redhat.com ([209.132.183.28]:39174)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dphb1-0007P6-Nf; Wed, 06 Sep 2017 17:10:51 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9E5137EBDC;\n\tWed,  6 Sep 2017 21:10:50 +0000 (UTC)","from [10.10.120.228] (ovpn-120-228.rdu2.redhat.com [10.10.120.228])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 47E5317D93;\n\tWed,  6 Sep 2017 21:10:41 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9E5137EBDC","To":"Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>\n\t<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>\n\t<a91fb46c-0044-3fcc-70a7-60f186a37c9f@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<5b39beb0-530e-cc63-2917-cd121d515ee3@redhat.com>","Date":"Wed, 6 Sep 2017 16:10:39 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<a91fb46c-0044-3fcc-70a7-60f186a37c9f@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"lpkwGJEpmmEuJUCV76QGWV9N2oE0lq7sC\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tWed, 06 Sep 2017 21:10:50 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, John Snow <jsnow@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764391,"web_url":"http://patchwork.ozlabs.org/comment/1764391/","msgid":"<ce91b2df-8bde-e785-8f2d-1f9862bd9501@redhat.com>","list_archive_url":null,"date":"2017-09-06T21:25:20","subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/06/2017 04:10 PM, Eric Blake wrote:\n>> I'm not a fan of including header files from other header files, so\n>> changing the include order in the .c files sounds like the better\n>> solution to me.\n> \n> Eww. I like headers to be self-contained.  Other than stuff we get from\n> osdep.h (which we know is included by EVERY .c file), I prefer that if a\n> header uses another type, then it guarantees that an idempotent\n> inclusion of a header that declares that type is also present in the\n> header file, rather than forcing .c files to know which order to include\n> things in.\n\nThe qemu tree-wide policy appears to be that a header should be\nself-contained (order of inclusion in .c files shouldn't matter).  Also,\nif header A only uses 'SomeType *', it can either get the definition of\nSomeType from header B, or we can add the typedef to typedef.h at which\npoint both header A and B get the typedef from there (that is, typedef.h\nis great for breaking what would otherwise be cyclic inclusion of\nmutually-recursive types across different headers, as well as a way to\nspeed up compilation when a typedef is sufficient rather than a full\ndefinition).","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnc8J47Fwz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 07:26:08 +1000 (AEST)","from localhost ([::1]:37829 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dphpm-0005cJ-JI\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 17:26:06 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36880)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dphpF-0005b7-9m\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 17:25:34 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dphpE-00078t-EF\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 17:25:33 -0400","from mx1.redhat.com ([209.132.183.28]:41800)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dphp9-00074n-T2; Wed, 06 Sep 2017 17:25:28 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 7F0834E4CA;\n\tWed,  6 Sep 2017 21:25:25 +0000 (UTC)","from [10.10.120.228] (ovpn-120-228.rdu2.redhat.com [10.10.120.228])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 23D07179D3;\n\tWed,  6 Sep 2017 21:25:21 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 7F0834E4CA","To":"Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org","References":"<20170901180340.30009-1-eblake@redhat.com>\n\t<20170901180340.30009-15-eblake@redhat.com>\n\t<8064a471-f2ff-63e4-c90d-ebf3ca4e33cd@redhat.com>\n\t<a91fb46c-0044-3fcc-70a7-60f186a37c9f@redhat.com>\n\t<5b39beb0-530e-cc63-2917-cd121d515ee3@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<ce91b2df-8bde-e785-8f2d-1f9862bd9501@redhat.com>","Date":"Wed, 6 Sep 2017 16:25:20 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<5b39beb0-530e-cc63-2917-cd121d515ee3@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"PlrwnWGCTkpMbWE9IuBitJlwUEg542AtD\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 06 Sep 2017 21:25:26 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v6 14/29] libqos: Use explicit QTestState\n\tfor fw_cfg operations","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"\"open list:IDE\" <qemu-block@nongnu.org>, Alexander Graf <agraf@suse.de>, \n\tarmbru@redhat.com, \"open list:sPAPR\" <qemu-ppc@nongnu.org>,\n\tpbonzini@redhat.com, John Snow <jsnow@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]