[{"id":1773981,"web_url":"http://patchwork.ozlabs.org/comment/1773981/","msgid":"<20170923051227.GB4998@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-23T05:12:27","subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Fri, Sep 22, 2017 at 01:01:04PM -0300, Philippe Mathieu-Daudé wrote:\n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n\nppc portions\n\nAcked-by: David Gibson <david@gibson.dropbear.id.au>\n> ---\n>  hw/pci/pci_internal.h | 16 +++++++++++\n>  include/hw/net/pci.h  | 20 +++++++++++++\n>  include/hw/pci/pci.h  |  4 ---\n>  hw/arm/virt.c         |  1 +\n>  hw/mips/mips_malta.c  |  1 +\n>  hw/pci/pci.c          | 67 ++------------------------------------------\n>  hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>  hw/ppc/e500.c         |  1 +\n>  hw/ppc/spapr.c        |  1 +\n>  hw/pci/Makefile.objs  |  1 +\n>  10 files changed, 120 insertions(+), 69 deletions(-)\n>  create mode 100644 hw/pci/pci_internal.h\n>  create mode 100644 include/hw/net/pci.h\n>  create mode 100644 hw/pci/pci_nic.c\n> \n> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h\n> new file mode 100644\n> index 0000000000..d967468767\n> --- /dev/null\n> +++ b/hw/pci/pci_internal.h\n> @@ -0,0 +1,16 @@\n> +/*\n> + * QEMU PCI internal\n> + *\n> + * Copyright (c) 2005 Fabrice Bellard\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#ifndef QEMU_HW_PCI_INTERNAL_H\n> +#define QEMU_HW_PCI_INTERNAL_H\n> +\n> +#include \"hw/pci/pci_bus.h\"\n> +\n> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);\n> +\n> +#endif\n> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h\n> new file mode 100644\n> index 0000000000..529591b7f3\n> --- /dev/null\n> +++ b/include/hw/net/pci.h\n> @@ -0,0 +1,20 @@\n> +/*\n> + * QEMU network devices\n> + *\n> + * Copyright (c) 2005 Fabrice Bellard\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#ifndef QEMU_HW_NET_PCI_H\n> +#define QEMU_HW_NET_PCI_H\n> +\n> +#include \"net/net.h\"\n> +#include \"hw/pci/pci.h\"\n> +#include \"hw/pci/pci_bus.h\"\n> +\n> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> +                               const char *default_model,\n> +                               const char *default_devaddr);\n> +\n> +#endif\n> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h\n> index aa7ef9cf69..6a0f7b5472 100644\n> --- a/include/hw/pci/pci.h\n> +++ b/include/hw/pci/pci.h\n> @@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,\n>                                            PCIINTxRoutingNotifier notifier);\n>  void pci_device_reset(PCIDevice *dev);\n>  \n> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> -                               const char *default_model,\n> -                               const char *default_devaddr);\n> -\n>  PCIDevice *pci_vga_init(PCIBus *bus);\n>  \n>  int pci_bus_num(PCIBus *s);\n> diff --git a/hw/arm/virt.c b/hw/arm/virt.c\n> index 9e18b410d7..39fab3acb9 100644\n> --- a/hw/arm/virt.c\n> +++ b/hw/arm/virt.c\n> @@ -35,6 +35,7 @@\n>  #include \"hw/arm/primecell.h\"\n>  #include \"hw/arm/virt.h\"\n>  #include \"hw/devices.h\"\n> +#include \"hw/net/pci.h\"\n>  #include \"net/net.h\"\n>  #include \"sysemu/block-backend.h\"\n>  #include \"sysemu/device_tree.h\"\n> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c\n> index 6945fa47c3..fb6a2f9363 100644\n> --- a/hw/mips/mips_malta.c\n> +++ b/hw/mips/mips_malta.c\n> @@ -48,6 +48,7 @@\n>  #include \"hw/timer/mc146818rtc.h\"\n>  #include \"hw/input/i8042.h\"\n>  #include \"hw/timer/i8254.h\"\n> +#include \"hw/net/pci.h\"\n>  #include \"sysemu/blockdev.h\"\n>  #include \"exec/address-spaces.h\"\n>  #include \"hw/sysbus.h\"             /* SysBusDevice */\n> diff --git a/hw/pci/pci.c b/hw/pci/pci.c\n> index 1e6fb88eba..9b678c8fd0 100644\n> --- a/hw/pci/pci.c\n> +++ b/hw/pci/pci.c\n> @@ -28,7 +28,6 @@\n>  #include \"hw/pci/pci_bus.h\"\n>  #include \"hw/pci/pci_host.h\"\n>  #include \"monitor/monitor.h\"\n> -#include \"net/net.h\"\n>  #include \"sysemu/sysemu.h\"\n>  #include \"hw/loader.h\"\n>  #include \"qemu/error-report.h\"\n> @@ -41,6 +40,7 @@\n>  #include \"hw/hotplug.h\"\n>  #include \"hw/boards.h\"\n>  #include \"qemu/cutils.h\"\n> +#include \"pci_internal.h\"\n>  \n>  //#define DEBUG_PCI\n>  #ifdef DEBUG_PCI\n> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,\n>      return 0;\n>  }\n>  \n> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,\n> -                                 const char *devaddr)\n> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)\n>  {\n>      int dom, bus;\n>      unsigned slot;\n> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)\n>      return head;\n>  }\n>  \n> -static const char * const pci_nic_models[] = {\n> -    \"ne2k_pci\",\n> -    \"i82551\",\n> -    \"i82557b\",\n> -    \"i82559er\",\n> -    \"rtl8139\",\n> -    \"e1000\",\n> -    \"pcnet\",\n> -    \"virtio\",\n> -    \"sungem\",\n> -    NULL\n> -};\n> -\n> -static const char * const pci_nic_names[] = {\n> -    \"ne2k_pci\",\n> -    \"i82551\",\n> -    \"i82557b\",\n> -    \"i82559er\",\n> -    \"rtl8139\",\n> -    \"e1000\",\n> -    \"pcnet\",\n> -    \"virtio-net-pci\",\n> -    \"sungem\",\n> -    NULL\n> -};\n> -\n> -/* Initialize a PCI NIC.  */\n> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> -                               const char *default_model,\n> -                               const char *default_devaddr)\n> -{\n> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n> -    PCIBus *bus;\n> -    PCIDevice *pci_dev;\n> -    DeviceState *dev;\n> -    int devfn;\n> -    int i;\n> -\n> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n> -        exit(0);\n> -    }\n> -\n> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n> -    if (i < 0) {\n> -        exit(1);\n> -    }\n> -\n> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n> -    if (!bus) {\n> -        error_report(\"Invalid PCI device address %s for device %s\",\n> -                     devaddr, pci_nic_names[i]);\n> -        exit(1);\n> -    }\n> -\n> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n> -    dev = &pci_dev->qdev;\n> -    qdev_set_nic_properties(dev, nd);\n> -    qdev_init_nofail(dev);\n> -\n> -    return pci_dev;\n> -}\n> -\n>  PCIDevice *pci_vga_init(PCIBus *bus)\n>  {\n>      switch (vga_interface_type) {\n> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c\n> new file mode 100644\n> index 0000000000..fb1a10ff12\n> --- /dev/null\n> +++ b/hw/pci/pci_nic.c\n> @@ -0,0 +1,77 @@\n> +/*\n> + * QEMU PCI network interface\n> + *\n> + * Copyright (c) 2004 Fabrice Bellard\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#include \"qemu/osdep.h\"\n> +#include \"qemu/error-report.h\"\n> +#include \"hw/pci/pci.h\"\n> +#include \"hw/pci/pci_bus.h\"\n> +#include \"hw/net/pci.h\"\n> +#include \"net/net.h\"\n> +#include \"pci_internal.h\"\n> +\n> +static const char *const pci_nic_models[] = {\n> +    \"ne2k_pci\",\n> +    \"i82551\",\n> +    \"i82557b\",\n> +    \"i82559er\",\n> +    \"rtl8139\",\n> +    \"e1000\",\n> +    \"pcnet\",\n> +    \"virtio\",\n> +    \"sungem\",\n> +    NULL\n> +};\n> +\n> +static const char *const pci_nic_names[] = {\n> +    \"ne2k_pci\",\n> +    \"i82551\",\n> +    \"i82557b\",\n> +    \"i82559er\",\n> +    \"rtl8139\",\n> +    \"e1000\",\n> +    \"pcnet\",\n> +    \"virtio-net-pci\",\n> +    \"sungem\",\n> +    NULL\n> +};\n> +\n> +/* Initialize a PCI NIC.  */\n> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> +                               const char *default_model,\n> +                               const char *default_devaddr)\n> +{\n> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n> +    PCIBus *bus;\n> +    PCIDevice *pci_dev;\n> +    DeviceState *dev;\n> +    int devfn;\n> +    int i;\n> +\n> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n> +        exit(0);\n> +    }\n> +\n> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n> +    if (i < 0) {\n> +        exit(1);\n> +    }\n> +\n> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n> +    if (!bus) {\n> +        error_report(\"Invalid PCI device address %s for device %s\",\n> +                     devaddr, pci_nic_names[i]);\n> +        exit(1);\n> +    }\n> +\n> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n> +    dev = &pci_dev->qdev;\n> +    qdev_set_nic_properties(dev, nd);\n> +    qdev_init_nofail(dev);\n> +\n> +    return pci_dev;\n> +}\n> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c\n> index db0e49ab8f..482757ca7b 100644\n> --- a/hw/ppc/e500.c\n> +++ b/hw/ppc/e500.c\n> @@ -24,6 +24,7 @@\n>  #include \"hw/hw.h\"\n>  #include \"hw/char/serial.h\"\n>  #include \"hw/pci/pci.h\"\n> +#include \"hw/net/pci.h\"\n>  #include \"hw/boards.h\"\n>  #include \"sysemu/sysemu.h\"\n>  #include \"sysemu/kvm.h\"\n> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\n> index 17ea77618c..96007051e2 100644\n> --- a/hw/ppc/spapr.c\n> +++ b/hw/ppc/spapr.c\n> @@ -56,6 +56,7 @@\n>  #include \"hw/pci-host/spapr.h\"\n>  #include \"hw/ppc/xics.h\"\n>  #include \"hw/pci/msi.h\"\n> +#include \"hw/net/pci.h\"\n>  \n>  #include \"hw/pci/pci.h\"\n>  #include \"hw/scsi/scsi.h\"\n> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs\n> index 9f905e6344..125428fd54 100644\n> --- a/hw/pci/Makefile.objs\n> +++ b/hw/pci/Makefile.objs\n> @@ -1,4 +1,5 @@\n>  common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o\n> +common-obj-$(CONFIG_PCI) += pci_nic.o\n>  common-obj-$(CONFIG_PCI) += msix.o msi.o\n>  common-obj-$(CONFIG_PCI) += shpc.o\n>  common-obj-$(CONFIG_PCI) += slotid_cap.o","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\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"dFTlk3H1\"; \n\tdkim-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 3xzfGM2484z9t67\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 15:36:11 +1000 (AEST)","from localhost ([::1]:33767 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 1dvd6m-0003Ya-Pb\n\tfor incoming@patchwork.ozlabs.org; Sat, 23 Sep 2017 01:36:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36117)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dvd0H-0007JZ-9z\n\tfor qemu-devel@nongnu.org; Sat, 23 Sep 2017 01:29:27 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dvd0F-0002AL-BQ\n\tfor qemu-devel@nongnu.org; Sat, 23 Sep 2017 01:29:25 -0400","from ozlabs.org ([2401:3900:2:1::2]:59011)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dvd0E-000292-HN; Sat, 23 Sep 2017 01:29:23 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xzf6R4dhkz9t3v; Sat, 23 Sep 2017 15:29:19 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1506144559;\n\tbh=qnmCsXzuTcXa+1PnMq8wcWPp3rlIs8PMf2RiK/IK2Us=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=dFTlk3H1QgSpSbEkSdOr59WZhurYlHG8aggNmzZc+AAB5+oK/qha9zUXW0z3GJ1/0\n\tDaViNznpCKWmM/C3H5izjc7IgQT1OK7Q1pEnxziQvbHnIRPviHEN5j7lpB7LiNfJlx\n\tHE2feBqKL+BM2pSoi56ZbMY9zZJUXwx1CmqAZa60=","Date":"Sat, 23 Sep 2017 15:12:27 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170923051227.GB4998@umbus.fritz.box>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-5-f4bug@amsat.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"1ugEqy3masBx2OgH\"","Content-Disposition":"inline","In-Reply-To":"<20170922160111.31885-5-f4bug@amsat.org>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2401:3900:2:1::2","Subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","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":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, qemu-trivial@nongnu.org,\n\tJason Wang <jasowang@redhat.com>, Alexander Graf <agraf@suse.de>,\n\tqemu-devel@nongnu.org, Yongbok Kim <yongbok.kim@imgtec.com>,\n\tqemu-arm@nongnu.org, qemu-ppc@nongnu.org,\n\tMarcel Apfelbaum <marcel@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, \n\tAurelien Jarno <aurelien@aurel32.net>","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":1774763,"web_url":"http://patchwork.ozlabs.org/comment/1774763/","msgid":"<8a52b6be-ce55-307f-2bba-85858f739210@redhat.com>","list_archive_url":null,"date":"2017-09-25T14:30:35","subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","submitter":{"id":65362,"url":"http://patchwork.ozlabs.org/api/people/65362/","name":"Marcel Apfelbaum","email":"marcel@redhat.com"},"content":"Hi Philippe,\n\nIt seems the patch is doing much more than\nwhat is mentioned in the subject.\n\nOn 22/09/2017 19:01, Philippe Mathieu-Daudé wrote:\n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n> ---\n>   hw/pci/pci_internal.h | 16 +++++++++++\n>   include/hw/net/pci.h  | 20 +++++++++++++\n>   include/hw/pci/pci.h  |  4 ---\n>   hw/arm/virt.c         |  1 +\n>   hw/mips/mips_malta.c  |  1 +\n>   hw/pci/pci.c          | 67 ++------------------------------------------\n>   hw/pci/pci_nic.c      | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++\n>   hw/ppc/e500.c         |  1 +\n>   hw/ppc/spapr.c        |  1 +\n>   hw/pci/Makefile.objs  |  1 +\n>   10 files changed, 120 insertions(+), 69 deletions(-)\n>   create mode 100644 hw/pci/pci_internal.h\n>   create mode 100644 include/hw/net/pci.h\n>   create mode 100644 hw/pci/pci_nic.c\n> \n> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h\n> new file mode 100644\n> index 0000000000..d967468767\n> --- /dev/null\n> +++ b/hw/pci/pci_internal.h\n> @@ -0,0 +1,16 @@\n> +/*\n> + * QEMU PCI internal\n> + *\n> + * Copyright (c) 2005 Fabrice Bellard\n> + * > + * This work is licensed under the terms of the GNU GPL, version 2 \nor later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#ifndef QEMU_HW_PCI_INTERNAL_H\n> +#define QEMU_HW_PCI_INTERNAL_H\n> +\n> +#include \"hw/pci/pci_bus.h\"\n> +\n> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr);\n> +\n> +#endif\n\nWhy don't add the function directly to hw/pci/pci_nic.c ?\nWe have only one calling site anyway.\n\nI have nothing against adding an internal H file, but then\nwe would need to add there *all* the functions used\nonly by the pci sub-system. And that may be out of the scope\nof your series.\n\n\n\n\n> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h\n> new file mode 100644\n> index 0000000000..529591b7f3\n> --- /dev/null\n> +++ b/include/hw/net/pci.h\n> @@ -0,0 +1,20 @@\n> +/*\n> + * QEMU network devices\n> + *\n> + * Copyright (c) 2005 Fabrice Bellard\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#ifndef QEMU_HW_NET_PCI_H\n> +#define QEMU_HW_NET_PCI_H\n> +\n> +#include \"net/net.h\"\n> +#include \"hw/pci/pci.h\"\n> +#include \"hw/pci/pci_bus.h\"\n> +\n> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> +                               const char *default_model,\n> +                               const char *default_devaddr);\n> +\n\nCan you add a short explanation on how the split\nhelps removing i386/pc dependency from non-PC world?\n- it is not straight forward, at least for me.\n\n\nThanks,\nMarcel\n\n> +#endif\n> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h\n> index aa7ef9cf69..6a0f7b5472 100644\n> --- a/include/hw/pci/pci.h\n> +++ b/include/hw/pci/pci.h\n> @@ -422,10 +422,6 @@ void pci_device_set_intx_routing_notifier(PCIDevice *dev,\n>                                             PCIINTxRoutingNotifier notifier);\n>   void pci_device_reset(PCIDevice *dev);\n>   \n> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> -                               const char *default_model,\n> -                               const char *default_devaddr);\n> -\n>   PCIDevice *pci_vga_init(PCIBus *bus);\n>   \n>   int pci_bus_num(PCIBus *s);\n> diff --git a/hw/arm/virt.c b/hw/arm/virt.c\n> index 9e18b410d7..39fab3acb9 100644\n> --- a/hw/arm/virt.c\n> +++ b/hw/arm/virt.c\n> @@ -35,6 +35,7 @@\n>   #include \"hw/arm/primecell.h\"\n>   #include \"hw/arm/virt.h\"\n>   #include \"hw/devices.h\"\n> +#include \"hw/net/pci.h\"\n>   #include \"net/net.h\"\n>   #include \"sysemu/block-backend.h\"\n>   #include \"sysemu/device_tree.h\"\n> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c\n> index 6945fa47c3..fb6a2f9363 100644\n> --- a/hw/mips/mips_malta.c\n> +++ b/hw/mips/mips_malta.c\n> @@ -48,6 +48,7 @@\n>   #include \"hw/timer/mc146818rtc.h\"\n>   #include \"hw/input/i8042.h\"\n>   #include \"hw/timer/i8254.h\"\n> +#include \"hw/net/pci.h\"\n>   #include \"sysemu/blockdev.h\"\n>   #include \"exec/address-spaces.h\"\n>   #include \"hw/sysbus.h\"             /* SysBusDevice */\n> diff --git a/hw/pci/pci.c b/hw/pci/pci.c\n> index 1e6fb88eba..9b678c8fd0 100644\n> --- a/hw/pci/pci.c\n> +++ b/hw/pci/pci.c\n> @@ -28,7 +28,6 @@\n>   #include \"hw/pci/pci_bus.h\"\n>   #include \"hw/pci/pci_host.h\"\n>   #include \"monitor/monitor.h\"\n> -#include \"net/net.h\"\n>   #include \"sysemu/sysemu.h\"\n>   #include \"hw/loader.h\"\n>   #include \"qemu/error-report.h\"\n> @@ -41,6 +40,7 @@\n>   #include \"hw/hotplug.h\"\n>   #include \"hw/boards.h\"\n>   #include \"qemu/cutils.h\"\n> +#include \"pci_internal.h\"\n>   \n>   //#define DEBUG_PCI\n>   #ifdef DEBUG_PCI\n> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int *domp, int *busp,\n>       return 0;\n>   }\n>   \n> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,\n> -                                 const char *devaddr)\n> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char *devaddr)\n>   {\n>       int dom, bus;\n>       unsigned slot;\n> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)\n>       return head;\n>   }\n>   \n> -static const char * const pci_nic_models[] = {\n> -    \"ne2k_pci\",\n> -    \"i82551\",\n> -    \"i82557b\",\n> -    \"i82559er\",\n> -    \"rtl8139\",\n> -    \"e1000\",\n> -    \"pcnet\",\n> -    \"virtio\",\n> -    \"sungem\",\n> -    NULL\n> -};\n> -\n> -static const char * const pci_nic_names[] = {\n> -    \"ne2k_pci\",\n> -    \"i82551\",\n> -    \"i82557b\",\n> -    \"i82559er\",\n> -    \"rtl8139\",\n> -    \"e1000\",\n> -    \"pcnet\",\n> -    \"virtio-net-pci\",\n> -    \"sungem\",\n> -    NULL\n> -};\n> -\n> -/* Initialize a PCI NIC.  */\n> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> -                               const char *default_model,\n> -                               const char *default_devaddr)\n> -{\n> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n> -    PCIBus *bus;\n> -    PCIDevice *pci_dev;\n> -    DeviceState *dev;\n> -    int devfn;\n> -    int i;\n> -\n> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n> -        exit(0);\n> -    }\n> -\n> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n> -    if (i < 0) {\n> -        exit(1);\n> -    }\n> -\n> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n> -    if (!bus) {\n> -        error_report(\"Invalid PCI device address %s for device %s\",\n> -                     devaddr, pci_nic_names[i]);\n> -        exit(1);\n> -    }\n> -\n> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n> -    dev = &pci_dev->qdev;\n> -    qdev_set_nic_properties(dev, nd);\n> -    qdev_init_nofail(dev);\n> -\n> -    return pci_dev;\n> -}\n> -\n>   PCIDevice *pci_vga_init(PCIBus *bus)\n>   {\n>       switch (vga_interface_type) {\n> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c\n> new file mode 100644\n> index 0000000000..fb1a10ff12\n> --- /dev/null\n> +++ b/hw/pci/pci_nic.c\n> @@ -0,0 +1,77 @@\n> +/*\n> + * QEMU PCI network interface\n> + *\n> + * Copyright (c) 2004 Fabrice Bellard\n> + *\n> + * This work is licensed under the terms of the GNU GPL, version 2 or later.\n> + * See the COPYING file in the top-level directory.\n> + */\n> +#include \"qemu/osdep.h\"\n> +#include \"qemu/error-report.h\"\n> +#include \"hw/pci/pci.h\"\n> +#include \"hw/pci/pci_bus.h\"\n> +#include \"hw/net/pci.h\"\n> +#include \"net/net.h\"\n> +#include \"pci_internal.h\"\n> +\n> +static const char *const pci_nic_models[] = {\n> +    \"ne2k_pci\",\n> +    \"i82551\",\n> +    \"i82557b\",\n> +    \"i82559er\",\n> +    \"rtl8139\",\n> +    \"e1000\",\n> +    \"pcnet\",\n> +    \"virtio\",\n> +    \"sungem\",\n> +    NULL\n> +};\n> +\n> +static const char *const pci_nic_names[] = {\n> +    \"ne2k_pci\",\n> +    \"i82551\",\n> +    \"i82557b\",\n> +    \"i82559er\",\n> +    \"rtl8139\",\n> +    \"e1000\",\n> +    \"pcnet\",\n> +    \"virtio-net-pci\",\n> +    \"sungem\",\n> +    NULL\n> +};\n> +\n> +/* Initialize a PCI NIC.  */\n> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n> +                               const char *default_model,\n> +                               const char *default_devaddr)\n> +{\n> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n> +    PCIBus *bus;\n> +    PCIDevice *pci_dev;\n> +    DeviceState *dev;\n> +    int devfn;\n> +    int i;\n> +\n> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n> +        exit(0);\n> +    }\n> +\n> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n> +    if (i < 0) {\n> +        exit(1);\n> +    }\n> +\n> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n> +    if (!bus) {\n> +        error_report(\"Invalid PCI device address %s for device %s\",\n> +                     devaddr, pci_nic_names[i]);\n> +        exit(1);\n> +    }\n> +\n> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n> +    dev = &pci_dev->qdev;\n> +    qdev_set_nic_properties(dev, nd);\n> +    qdev_init_nofail(dev);\n> +\n> +    return pci_dev;\n> +}\n> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c\n> index db0e49ab8f..482757ca7b 100644\n> --- a/hw/ppc/e500.c\n> +++ b/hw/ppc/e500.c\n> @@ -24,6 +24,7 @@\n>   #include \"hw/hw.h\"\n>   #include \"hw/char/serial.h\"\n>   #include \"hw/pci/pci.h\"\n> +#include \"hw/net/pci.h\"\n>   #include \"hw/boards.h\"\n>   #include \"sysemu/sysemu.h\"\n>   #include \"sysemu/kvm.h\"\n> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\n> index 17ea77618c..96007051e2 100644\n> --- a/hw/ppc/spapr.c\n> +++ b/hw/ppc/spapr.c\n> @@ -56,6 +56,7 @@\n>   #include \"hw/pci-host/spapr.h\"\n>   #include \"hw/ppc/xics.h\"\n>   #include \"hw/pci/msi.h\"\n> +#include \"hw/net/pci.h\"\n>   \n>   #include \"hw/pci/pci.h\"\n>   #include \"hw/scsi/scsi.h\"\n> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs\n> index 9f905e6344..125428fd54 100644\n> --- a/hw/pci/Makefile.objs\n> +++ b/hw/pci/Makefile.objs\n> @@ -1,4 +1,5 @@\n>   common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o\n> +common-obj-$(CONFIG_PCI) += pci_nic.o\n>   common-obj-$(CONFIG_PCI) += msix.o msi.o\n>   common-obj-$(CONFIG_PCI) += shpc.o\n>   common-obj-$(CONFIG_PCI) += slotid_cap.o\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>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=marcel@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 3y163P6kKWz9sRq\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 00:31:45 +1000 (AEST)","from localhost ([::1]:42745 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 1dwUQB-0004iu-Uy\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 10:31:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47629)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <marcel@redhat.com>) id 1dwUPZ-0004f9-Nc\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 10:31:12 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <marcel@redhat.com>) id 1dwUPT-0006Ox-JT\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 10:31:05 -0400","from mx1.redhat.com ([209.132.183.28]:35475)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <marcel@redhat.com>)\n\tid 1dwUPJ-0006KQ-Cs; Mon, 25 Sep 2017 10:30:49 -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 F37857CDE0;\n\tMon, 25 Sep 2017 14:30:47 +0000 (UTC)","from mapfelba-osx.local (unknown [10.35.206.23])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 2FA0E17DC8;\n\tMon, 25 Sep 2017 14:30:38 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com F37857CDE0","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tPeter Maydell <peter.maydell@linaro.org>,\n\tThomas Huth <thuth@redhat.com>, \tPaolo Bonzini <pbonzini@redhat.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, \n\tAurelien Jarno <aurelien@aurel32.net>, Yongbok Kim\n\t<yongbok.kim@imgtec.com>, Alexander Graf <agraf@suse.de>, David Gibson\n\t<david@gibson.dropbear.id.au>, \tJason Wang <jasowang@redhat.com>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-5-f4bug@amsat.org>","From":"Marcel Apfelbaum <marcel@redhat.com>","Message-ID":"<8a52b6be-ce55-307f-2bba-85858f739210@redhat.com>","Date":"Mon, 25 Sep 2017 17:30:35 +0300","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0)\n\tGecko/20100101 Thunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170922160111.31885-5-f4bug@amsat.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","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.28]);\n\tMon, 25 Sep 2017 14:30:48 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","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 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","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":"qemu-trivial@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,\n\tqemu-devel@nongnu.org","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":1778511,"web_url":"http://patchwork.ozlabs.org/comment/1778511/","msgid":"<72e73fee-0e1e-6988-038d-a9823e7b6d19@amsat.org>","list_archive_url":null,"date":"2017-10-02T18:38:12","subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"Hi Marcel,\n\nOn 09/25/2017 11:30 AM, Marcel Apfelbaum wrote:\n> Hi Philippe,\n> \n> It seems the patch is doing much more than\n> what is mentioned in the subject.\n> \n> On 22/09/2017 19:01, Philippe Mathieu-Daudé wrote:\n>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n>> ---\n>>   hw/pci/pci_internal.h | 16 +++++++++++\n>>   include/hw/net/pci.h  | 20 +++++++++++++\n>>   include/hw/pci/pci.h  |  4 ---\n>>   hw/arm/virt.c         |  1 +\n>>   hw/mips/mips_malta.c  |  1 +\n>>   hw/pci/pci.c          | 67 ++------------------------------------------\n>>   hw/pci/pci_nic.c      | 77 \n>> +++++++++++++++++++++++++++++++++++++++++++++++++++\n>>   hw/ppc/e500.c         |  1 +\n>>   hw/ppc/spapr.c        |  1 +\n>>   hw/pci/Makefile.objs  |  1 +\n>>   10 files changed, 120 insertions(+), 69 deletions(-)\n>>   create mode 100644 hw/pci/pci_internal.h\n>>   create mode 100644 include/hw/net/pci.h\n>>   create mode 100644 hw/pci/pci_nic.c\n>>\n>> diff --git a/hw/pci/pci_internal.h b/hw/pci/pci_internal.h\n>> new file mode 100644\n>> index 0000000000..d967468767\n>> --- /dev/null\n>> +++ b/hw/pci/pci_internal.h\n>> @@ -0,0 +1,16 @@\n>> +/*\n>> + * QEMU PCI internal\n>> + *\n>> + * Copyright (c) 2005 Fabrice Bellard\n>> + * > + * This work is licensed under the terms of the GNU GPL, version 2 \n> or later.\n>> + * See the COPYING file in the top-level directory.\n>> + */\n>> +#ifndef QEMU_HW_PCI_INTERNAL_H\n>> +#define QEMU_HW_PCI_INTERNAL_H\n>> +\n>> +#include \"hw/pci/pci_bus.h\"\n>> +\n>> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char \n>> *devaddr);\n>> +\n>> +#endif\n> \n> Why don't add the function directly to hw/pci/pci_nic.c ?\n> We have only one calling site anyway.\n\nYou right!\n\n> \n> I have nothing against adding an internal H file, but then\n> we would need to add there *all* the functions used\n> only by the pci sub-system. And that may be out of the scope\n> of your series.\n> \n> \n> \n> \n>> diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h\n>> new file mode 100644\n>> index 0000000000..529591b7f3\n>> --- /dev/null\n>> +++ b/include/hw/net/pci.h\n>> @@ -0,0 +1,20 @@\n>> +/*\n>> + * QEMU network devices\n>> + *\n>> + * Copyright (c) 2005 Fabrice Bellard\n>> + *\n>> + * This work is licensed under the terms of the GNU GPL, version 2 or \n>> later.\n>> + * See the COPYING file in the top-level directory.\n>> + */\n>> +#ifndef QEMU_HW_NET_PCI_H\n>> +#define QEMU_HW_NET_PCI_H\n>> +\n>> +#include \"net/net.h\"\n>> +#include \"hw/pci/pci.h\"\n>> +#include \"hw/pci/pci_bus.h\"\n>> +\n>> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n>> +                               const char *default_model,\n>> +                               const char *default_devaddr);\n>> +\n> \n> Can you add a short explanation on how the split\n> helps removing i386/pc dependency from non-PC world?\n> - it is not straight forward, at least for me.\n\nI thought there was an old dependency on \"hw/pci/pci.h\" to something \nfrom i386/pc, so every machine using a PCI NIC would have this \ndependency. Extracting the NIC part as \"hw/net/pci.h\" would solve this \nissue. I didn't check attentively but it seems I was wrong, so I'll \neither drop this patch or reword it.\n\nRegards,\n\nPhil.\n\n> \n> \n> Thanks,\n> Marcel\n> \n>> +#endif\n>> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h\n>> index aa7ef9cf69..6a0f7b5472 100644\n>> --- a/include/hw/pci/pci.h\n>> +++ b/include/hw/pci/pci.h\n>> @@ -422,10 +422,6 @@ void \n>> pci_device_set_intx_routing_notifier(PCIDevice *dev,\n>>                                             PCIINTxRoutingNotifier \n>> notifier);\n>>   void pci_device_reset(PCIDevice *dev);\n>> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n>> -                               const char *default_model,\n>> -                               const char *default_devaddr);\n>> -\n>>   PCIDevice *pci_vga_init(PCIBus *bus);\n>>   int pci_bus_num(PCIBus *s);\n>> diff --git a/hw/arm/virt.c b/hw/arm/virt.c\n>> index 9e18b410d7..39fab3acb9 100644\n>> --- a/hw/arm/virt.c\n>> +++ b/hw/arm/virt.c\n>> @@ -35,6 +35,7 @@\n>>   #include \"hw/arm/primecell.h\"\n>>   #include \"hw/arm/virt.h\"\n>>   #include \"hw/devices.h\"\n>> +#include \"hw/net/pci.h\"\n>>   #include \"net/net.h\"\n>>   #include \"sysemu/block-backend.h\"\n>>   #include \"sysemu/device_tree.h\"\n>> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c\n>> index 6945fa47c3..fb6a2f9363 100644\n>> --- a/hw/mips/mips_malta.c\n>> +++ b/hw/mips/mips_malta.c\n>> @@ -48,6 +48,7 @@\n>>   #include \"hw/timer/mc146818rtc.h\"\n>>   #include \"hw/input/i8042.h\"\n>>   #include \"hw/timer/i8254.h\"\n>> +#include \"hw/net/pci.h\"\n>>   #include \"sysemu/blockdev.h\"\n>>   #include \"exec/address-spaces.h\"\n>>   #include \"hw/sysbus.h\"             /* SysBusDevice */\n>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c\n>> index 1e6fb88eba..9b678c8fd0 100644\n>> --- a/hw/pci/pci.c\n>> +++ b/hw/pci/pci.c\n>> @@ -28,7 +28,6 @@\n>>   #include \"hw/pci/pci_bus.h\"\n>>   #include \"hw/pci/pci_host.h\"\n>>   #include \"monitor/monitor.h\"\n>> -#include \"net/net.h\"\n>>   #include \"sysemu/sysemu.h\"\n>>   #include \"hw/loader.h\"\n>>   #include \"qemu/error-report.h\"\n>> @@ -41,6 +40,7 @@\n>>   #include \"hw/hotplug.h\"\n>>   #include \"hw/boards.h\"\n>>   #include \"qemu/cutils.h\"\n>> +#include \"pci_internal.h\"\n>>   //#define DEBUG_PCI\n>>   #ifdef DEBUG_PCI\n>> @@ -671,8 +671,7 @@ static int pci_parse_devaddr(const char *addr, int \n>> *domp, int *busp,\n>>       return 0;\n>>   }\n>> -static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root,\n>> -                                 const char *devaddr)\n>> +PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, const char \n>> *devaddr)\n>>   {\n>>       int dom, bus;\n>>       unsigned slot;\n>> @@ -1812,68 +1811,6 @@ PciInfoList *qmp_query_pci(Error **errp)\n>>       return head;\n>>   }\n>> -static const char * const pci_nic_models[] = {\n>> -    \"ne2k_pci\",\n>> -    \"i82551\",\n>> -    \"i82557b\",\n>> -    \"i82559er\",\n>> -    \"rtl8139\",\n>> -    \"e1000\",\n>> -    \"pcnet\",\n>> -    \"virtio\",\n>> -    \"sungem\",\n>> -    NULL\n>> -};\n>> -\n>> -static const char * const pci_nic_names[] = {\n>> -    \"ne2k_pci\",\n>> -    \"i82551\",\n>> -    \"i82557b\",\n>> -    \"i82559er\",\n>> -    \"rtl8139\",\n>> -    \"e1000\",\n>> -    \"pcnet\",\n>> -    \"virtio-net-pci\",\n>> -    \"sungem\",\n>> -    NULL\n>> -};\n>> -\n>> -/* Initialize a PCI NIC.  */\n>> -PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n>> -                               const char *default_model,\n>> -                               const char *default_devaddr)\n>> -{\n>> -    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n>> -    PCIBus *bus;\n>> -    PCIDevice *pci_dev;\n>> -    DeviceState *dev;\n>> -    int devfn;\n>> -    int i;\n>> -\n>> -    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n>> -        exit(0);\n>> -    }\n>> -\n>> -    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n>> -    if (i < 0) {\n>> -        exit(1);\n>> -    }\n>> -\n>> -    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n>> -    if (!bus) {\n>> -        error_report(\"Invalid PCI device address %s for device %s\",\n>> -                     devaddr, pci_nic_names[i]);\n>> -        exit(1);\n>> -    }\n>> -\n>> -    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n>> -    dev = &pci_dev->qdev;\n>> -    qdev_set_nic_properties(dev, nd);\n>> -    qdev_init_nofail(dev);\n>> -\n>> -    return pci_dev;\n>> -}\n>> -\n>>   PCIDevice *pci_vga_init(PCIBus *bus)\n>>   {\n>>       switch (vga_interface_type) {\n>> diff --git a/hw/pci/pci_nic.c b/hw/pci/pci_nic.c\n>> new file mode 100644\n>> index 0000000000..fb1a10ff12\n>> --- /dev/null\n>> +++ b/hw/pci/pci_nic.c\n>> @@ -0,0 +1,77 @@\n>> +/*\n>> + * QEMU PCI network interface\n>> + *\n>> + * Copyright (c) 2004 Fabrice Bellard\n>> + *\n>> + * This work is licensed under the terms of the GNU GPL, version 2 or \n>> later.\n>> + * See the COPYING file in the top-level directory.\n>> + */\n>> +#include \"qemu/osdep.h\"\n>> +#include \"qemu/error-report.h\"\n>> +#include \"hw/pci/pci.h\"\n>> +#include \"hw/pci/pci_bus.h\"\n>> +#include \"hw/net/pci.h\"\n>> +#include \"net/net.h\"\n>> +#include \"pci_internal.h\"\n>> +\n>> +static const char *const pci_nic_models[] = {\n>> +    \"ne2k_pci\",\n>> +    \"i82551\",\n>> +    \"i82557b\",\n>> +    \"i82559er\",\n>> +    \"rtl8139\",\n>> +    \"e1000\",\n>> +    \"pcnet\",\n>> +    \"virtio\",\n>> +    \"sungem\",\n>> +    NULL\n>> +};\n>> +\n>> +static const char *const pci_nic_names[] = {\n>> +    \"ne2k_pci\",\n>> +    \"i82551\",\n>> +    \"i82557b\",\n>> +    \"i82559er\",\n>> +    \"rtl8139\",\n>> +    \"e1000\",\n>> +    \"pcnet\",\n>> +    \"virtio-net-pci\",\n>> +    \"sungem\",\n>> +    NULL\n>> +};\n>> +\n>> +/* Initialize a PCI NIC.  */\n>> +PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,\n>> +                               const char *default_model,\n>> +                               const char *default_devaddr)\n>> +{\n>> +    const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;\n>> +    PCIBus *bus;\n>> +    PCIDevice *pci_dev;\n>> +    DeviceState *dev;\n>> +    int devfn;\n>> +    int i;\n>> +\n>> +    if (qemu_show_nic_models(nd->model, pci_nic_models)) {\n>> +        exit(0);\n>> +    }\n>> +\n>> +    i = qemu_find_nic_model(nd, pci_nic_models, default_model);\n>> +    if (i < 0) {\n>> +        exit(1);\n>> +    }\n>> +\n>> +    bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);\n>> +    if (!bus) {\n>> +        error_report(\"Invalid PCI device address %s for device %s\",\n>> +                     devaddr, pci_nic_names[i]);\n>> +        exit(1);\n>> +    }\n>> +\n>> +    pci_dev = pci_create(bus, devfn, pci_nic_names[i]);\n>> +    dev = &pci_dev->qdev;\n>> +    qdev_set_nic_properties(dev, nd);\n>> +    qdev_init_nofail(dev);\n>> +\n>> +    return pci_dev;\n>> +}\n>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c\n>> index db0e49ab8f..482757ca7b 100644\n>> --- a/hw/ppc/e500.c\n>> +++ b/hw/ppc/e500.c\n>> @@ -24,6 +24,7 @@\n>>   #include \"hw/hw.h\"\n>>   #include \"hw/char/serial.h\"\n>>   #include \"hw/pci/pci.h\"\n>> +#include \"hw/net/pci.h\"\n>>   #include \"hw/boards.h\"\n>>   #include \"sysemu/sysemu.h\"\n>>   #include \"sysemu/kvm.h\"\n>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\n>> index 17ea77618c..96007051e2 100644\n>> --- a/hw/ppc/spapr.c\n>> +++ b/hw/ppc/spapr.c\n>> @@ -56,6 +56,7 @@\n>>   #include \"hw/pci-host/spapr.h\"\n>>   #include \"hw/ppc/xics.h\"\n>>   #include \"hw/pci/msi.h\"\n>> +#include \"hw/net/pci.h\"\n>>   #include \"hw/pci/pci.h\"\n>>   #include \"hw/scsi/scsi.h\"\n>> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs\n>> index 9f905e6344..125428fd54 100644\n>> --- a/hw/pci/Makefile.objs\n>> +++ b/hw/pci/Makefile.objs\n>> @@ -1,4 +1,5 @@\n>>   common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o\n>> +common-obj-$(CONFIG_PCI) += pci_nic.o\n>>   common-obj-$(CONFIG_PCI) += msix.o msi.o\n>>   common-obj-$(CONFIG_PCI) += shpc.o\n>>   common-obj-$(CONFIG_PCI) += slotid_cap.o\n>>\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.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=\"EnGnqV9b\"; 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 3y5WCq5xLkz9rxl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  3 Oct 2017 05:39:19 +1100 (AEDT)","from localhost ([::1]:53703 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@gnu.org>)\n\tid 1dz5cb-0000tu-TN\n\tfor incoming@patchwork.ozlabs.org; Mon, 02 Oct 2017 14:39:17 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:34084)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dz5cC-0000ju-Lg\n\tfor qemu-devel@nongnu.org; Mon, 02 Oct 2017 14:38:54 -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 1dz5c7-0000Yl-Mf\n\tfor qemu-devel@nongnu.org; Mon, 02 Oct 2017 14:38:52 -0400","from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:37667)\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 1dz5bg-0008HM-Bq; Mon, 02 Oct 2017 14:38:20 -0400","by mail-qk0-x241.google.com with SMTP id a12so1742091qka.4;\n\tMon, 02 Oct 2017 11:38:20 -0700 (PDT)","from [192.168.1.240] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tw20sm727370qkb.95.2017.10.02.11.38.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 02 Oct 2017 11:38:18 -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=61nzUa2Fs63Efy7BCqoIWXL3Svbx2sgerNattuqIK7Y=;\n\tb=EnGnqV9bScZaBqNB1r6HsmQDSeNjSXATooVuZCiKEObRWV3W+kZmfoye9tELlVEveo\n\tHzCJ0jB2MDt6Ll4CL0OwuFT05vxW0PVC/SeJb3VQbKtgUKB3psd5CT/bMAFeU8Q79SDk\n\tytF7ajQxHPZ2GoEGq03iK9CgW11wjrONe4EdRacTLSUXX5cJTGIxjHjeFFzNxXF9dVW4\n\tRWk5WAtFtsg2PW387Vqt3SZ3NZpb213ankcN3ukPiAYR3wu2PAwMC3EGsQk60bO0yQPo\n\tdt3ZenXyW9fK49UKFD3bYK3KvDvjGtxXq5XJ5135pRf7p99vrE2KVh4WlqJnc0g773N5\n\thoRw==","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=61nzUa2Fs63Efy7BCqoIWXL3Svbx2sgerNattuqIK7Y=;\n\tb=c8cDNdXhN8srZi0MV7SYIqPNQ0GG3qe/bqkkOkuXucZe1FTCVf6pa6VDF6OyMKSlbA\n\thIF4jtq+xSAKF4uUQt39qbzM9+uXJ+DrsCmB3xo73irTwKj0xQ5kAL4MZuhxdo7S3SqA\n\tmOu4mgB3qKxkNTmZ+I0lB6klTlaj1OCCvmqeYsknr9hnmE0qLVNTJiAqrVI3HGssZiMs\n\t4oxnQr8qsM60+HOvLUZ4g8CxADe/qdLYQJYwf9EGLNsp+EekID2t56uX7tJUX2d02IqF\n\twduVZsZyTAy99fXjXs/NveSKBHjlW8wMU3mkrdD0rWZf1za9s9F83/RH6IzlOCs79+Z2\n\t5HTA==","X-Gm-Message-State":"AMCzsaWlmpReTi6CMXqAKZyQ+xwvtRh1uW9siXGL0uKngU5J926x6PKo\n\ttBfmDaMgxytAf9oEJOGAPZypYsnk","X-Google-Smtp-Source":"AOwi7QDF348AhrCKYfenNoBhHb2eT+0t3W/BNBtVcF7zUJxXtIVcoQ9nqyqPA3t6utxOemp5igGh/w==","X-Received":"by 10.55.91.69 with SMTP id p66mr16613623qkb.167.1506969499384; \n\tMon, 02 Oct 2017 11:38:19 -0700 (PDT)","To":"Marcel Apfelbaum <marcel@redhat.com>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-5-f4bug@amsat.org>\n\t<8a52b6be-ce55-307f-2bba-85858f739210@redhat.com>","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","Message-ID":"<72e73fee-0e1e-6988-038d-a9823e7b6d19@amsat.org>","Date":"Mon, 2 Oct 2017 15:38:12 -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":"<8a52b6be-ce55-307f-2bba-85858f739210@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:c09::241","Subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","X-BeenThere":"qemu-devel@gnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.gnu.org>","List-Unsubscribe":"<https://lists.gnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@gnu.org?subject=unsubscribe>","List-Archive":"<http://lists.gnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@gnu.org>","List-Help":"<mailto:qemu-devel-request@gnu.org?subject=help>","List-Subscribe":"<https://lists.gnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@gnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, qemu-trivial@nongnu.org,\n\tJason Wang <jasowang@redhat.com>, Alexander Graf <agraf@suse.de>,\n\tqemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,\n\tYongbok Kim <yongbok.kim@imgtec.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, \n\tAurelien Jarno <aurelien@aurel32.net>,\n\tDavid Gibson <david@gibson.dropbear.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@gnu.org>"}},{"id":1787901,"web_url":"http://patchwork.ozlabs.org/comment/1787901/","msgid":"<222c1152-fecb-f8ca-2714-43bf3678a34c@amsat.org>","list_archive_url":null,"date":"2017-10-17T00:24:23","subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"content":"Hi Marcel,\n\n>> It seems the patch is doing much more than\n>> what is mentioned in the subject.\n>>\n[...]\n>> Can you add a short explanation on how the split\n>> helps removing i386/pc dependency from non-PC world?\n>> - it is not straight forward, at least for me.\n> \n> I thought there was an old dependency on \"hw/pci/pci.h\" to something\n> from i386/pc, so every machine using a PCI NIC would have this\n> dependency. Extracting the NIC part as \"hw/net/pci.h\" would solve this\n> issue. I didn't check attentively but it seems I was wrong, so I'll\n> either drop this patch or reword it.\n\nI finally opted to drop it for this series and include it reworded in\npart 2 which include more PCI-related patches.\n\nRegards,\n\nPhil.","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=\"imGD6rv8\"; 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 3yGGdX1Kt0z9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 17 Oct 2017 11:43:28 +1100 (AEDT)","from localhost ([::1]:35888 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 1e4Fyf-00054u-Am\n\tfor incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 20:43:25 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37403)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1e4FgX-00079g-BO\n\tfor qemu-devel@nongnu.org; Mon, 16 Oct 2017 20:24:46 -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 1e4FgW-0002Mv-IH\n\tfor qemu-devel@nongnu.org; Mon, 16 Oct 2017 20:24:41 -0400","from mail-qt0-x22b.google.com ([2607:f8b0:400d:c0d::22b]:53473)\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 1e4FgM-0002Gm-5G; Mon, 16 Oct 2017 20:24:30 -0400","by mail-qt0-x22b.google.com with SMTP id n61so80452qte.10;\n\tMon, 16 Oct 2017 17:24:30 -0700 (PDT)","from [192.168.1.240] ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tu127sm498778qkf.79.2017.10.16.17.24.24\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 16 Oct 2017 17:24:28 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:subject:from:to:cc:references:openpgp:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=uRcGpz2dVMKg82Bu+z/sdV0WGC6q2d5lc5kUqNXhOJU=;\n\tb=imGD6rv8Gh323f+WNSt/y0ZOl0CHwLSVjmUtVDavntTh77cyvj/Bfm1L9IVc297Pw9\n\tBzzniCn/XbFGImVvir3qjvWf71pH9CJDPB9l37pfXj7YHoD2N5wHB/78tT5P5N0WISsT\n\tS+AAPN8kn//3ToRrzyivCVTDZ9C6TzF1G+3E2GuP678fQFqVaXyl67O862CU5Eu5egaH\n\tO+s+9bgKxZFagG917bNcnNzq+Y26gv76eleHAZH/SheINnEzcBuXfHpOGdvAspUuNrq+\n\t69G+X7EZJYKVzLxpAjpWhSAACP2gBMhY31c9Cqy2Z+O9Y+9TuHpwv0aTy+3nCuOpJOVU\n\taStA==","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:from:to:cc:references:openpgp\n\t:message-id:date:user-agent:mime-version:in-reply-to\n\t:content-language:content-transfer-encoding;\n\tbh=uRcGpz2dVMKg82Bu+z/sdV0WGC6q2d5lc5kUqNXhOJU=;\n\tb=lDxTqtlcbX0UGcPtdrGL8++kDdUvkhMgDYVbecuGrWpxN0Ka5TXy5dURDldWzrx9jL\n\tA+wnJZkx5oRApNMMIe9TD0hiMX901LWT7pz08a/5WrPzEoINrQpcSUXOLiR4D9uU/mKA\n\tAg79vPf6K69YXyAmzFUxabbCToPC5KtKaMFm6EWKxrUdRtp6Y9trTwZszusb/CxQt21K\n\ts7Hf9CBvCxr9qPbsfY3gkmie37tiEvCTqar1Q7sQDcrIxgtb7JXp90i8Go34FMmFVdUB\n\tqwdzSRrNWTe7kyIHCGKi++WkvhicbaAGJVX0s1LZQskW6Dp/L5txtDs+cCHct47qtgTE\n\tsSpA==","X-Gm-Message-State":"AMCzsaWpkNzZktW+KmNye9U7WwRq2PRcGXCQthPBAmA51pbHlsYOiPmf\n\tkahOI2ddkdjvXUnbH641gp0moqzkvd0=","X-Google-Smtp-Source":"AOwi7QDCHIYlWuySPoYlQaoHG9DZdEKU6G4xfvAh2fGM/FD0rf4ge+3ijFLtmKWIno5UxvGp6Ki/9w==","X-Received":"by 10.200.12.69 with SMTP id l5mr17348155qti.268.1508199869439; \n\tMon, 16 Oct 2017 17:24:29 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","To":"Marcel Apfelbaum <marcel@redhat.com>, Jason Wang <jasowang@redhat.com>, \n\tMichael Tokarev <mjt@tls.msk.ru>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-5-f4bug@amsat.org>\n\t<8a52b6be-ce55-307f-2bba-85858f739210@redhat.com>\n\t<72e73fee-0e1e-6988-038d-a9823e7b6d19@amsat.org>","Openpgp":"id=FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE;\n\turl=http://pgp.mit.edu/pks/lookup?op=get&search=0xE3E32C2CDEADC0DE","Message-ID":"<222c1152-fecb-f8ca-2714-43bf3678a34c@amsat.org>","Date":"Mon, 16 Oct 2017 21:24:23 -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":"<72e73fee-0e1e-6988-038d-a9823e7b6d19@amsat.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::22b","Subject":"Re: [Qemu-devel] [PATCH 27/34] hw/pci: declare\n\tpci_nic_init_nofail() in \"hw/net/pci.h\"","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":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>, qemu-trivial@nongnu.org,\n\tAlexander Graf <agraf@suse.de>, qemu-devel@nongnu.org,\n\tqemu-arm@nongnu.org, qemu-ppc@nongnu.org,\n\tYongbok Kim <yongbok.kim@imgtec.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, \n\tAurelien Jarno <aurelien@aurel32.net>,\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>"}}]