[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qem
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info() |
Date: |
Fri, 26 Jan 2024 14:43:05 +0000 |
On Mon, 8 Jan 2024 at 20:49, David Woodhouse <dwmw2@infradead.org> wrote:
>
> From: David Woodhouse <dwmw@amazon.co.uk>
>
> Most code which directly accesses nd_table[] and nb_nics uses them for
> one of two things. Either "I have created a NIC device and I'd like a
> configuration for it", or "I will create a NIC device *if* there is a
> configuration for it". With some variants on the theme around whether
> they actually *check* if the model specified in the configuration is
> the right one.
>
> Provide functions which perform both of those, allowing platforms to
> be a little more consistent and as a step towards making nd_table[]
> and nb_nics private to the net code.
>
> Also export the qemu_find_nic_info() helper, as some platforms have
> special cases they need to handle.
>
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
> Reviewed-by: Paul Durrant <paul@xen.org>
> ---
> include/net/net.h | 7 ++++++-
> net/net.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 57 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/net.h b/include/net/net.h
> index ffbd2c8d56..25ea83fd12 100644
> --- a/include/net/net.h
> +++ b/include/net/net.h
> @@ -207,7 +207,12 @@ int qemu_show_nic_models(const char *arg, const char
> *const *models);
> void qemu_check_nic_model(NICInfo *nd, const char *model);
> int qemu_find_nic_model(NICInfo *nd, const char * const *models,
> const char *default_model);
> -
> +NICInfo *qemu_find_nic_info(const char *typename, bool match_default,
> + const char *alias);
> +bool qemu_configure_nic_device(DeviceState *dev, bool match_default,
> + const char *alias);
> +DeviceState *qemu_create_nic_device(const char *typename, bool match_default,
> + const char *alias);
Could we have doc comments that document the purpose and API
for these new global functions, please?
thanks
-- PMM
- [PATCH v3 37/46] hw/net/lasi_i82596: use qemu_configure_nic_device(), (continued)
- [PATCH v3 37/46] hw/net/lasi_i82596: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 08/46] hw/arm/sbsa-ref: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
- [PATCH v3 28/46] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases, David Woodhouse, 2024/01/08
- [PATCH v3 31/46] hw/net/etraxfs-eth: use qemu_configure_nic_device(), David Woodhouse, 2024/01/08
- [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/08
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Thomas Huth, 2024/01/26
Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(),
Peter Maydell <=
- Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure, create}_nic_device(), qemu_find_nic_info(), Peter Maydell, 2024/01/26
- Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info(), David Woodhouse, 2024/01/26
[PATCH v3 46/46] net: make nb_nics and nd_table[] static in net/net.c, David Woodhouse, 2024/01/08
[PATCH v3 33/46] hw/m68k/q800: use qemu_find_nic_info(), David Woodhouse, 2024/01/08
[PATCH v3 19/46] hw/sparc64/sun4u: use pci_init_nic_devices(), David Woodhouse, 2024/01/08
[PATCH v3 06/46] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs, David Woodhouse, 2024/01/08