[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 01/46] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()
- To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
- From: Peter Maydell <peter.maydell@xxxxxxxxxx>
- Date: Fri, 26 Jan 2024 14:43:05 +0000
- Cc: qemu-devel@xxxxxxxxxx, Richard Henderson <richard.henderson@xxxxxxxxxx>, Beniamino Galvani <b.galvani@xxxxxxxxx>, Strahinja Jankovic <strahinja.p.jankovic@xxxxxxxxx>, Niek Linnenbank <nieklinnenbank@xxxxxxxxx>, Cédric Le Goater <clg@xxxxxxxx>, Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx>, Joel Stanley <joel@xxxxxxxxx>, Igor Mitsyanko <i.mitsyanko@xxxxxxxxx>, Jean-Christophe Dubois <jcd@xxxxxxxxxxxxxxx>, Andrey Smirnov <andrew.smirnov@xxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Rob Herring <robh@xxxxxxxxxx>, Subbaraya Sundeep <sundeep.lkml@xxxxxxxxx>, Jan Kiszka <jan.kiszka@xxxxxx>, Tyrone Ting <kfting@xxxxxxxxxxx>, Hao Wu <wuhaotsh@xxxxxxxxxx>, Radoslaw Biernacki <rad@xxxxxxxxxxxx>, Leif Lindholm <quic_llindhol@xxxxxxxxxxx>, Marcin Juszkiewicz <marcin.juszkiewicz@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Song Gao <gaosong@xxxxxxxxxxx>, Thomas Huth <huth@xxxxxxxxxxxxx>, Laurent Vivier <laurent@xxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Jia Liu <proljc@xxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Daniel Henrique Barboza <danielhb413@xxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Harsh Prateek Bora <harshpb@xxxxxxxxxxxxx>, Bin Meng <bin.meng@xxxxxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Weiwei Li <liwei1518@xxxxxxxxx>, Liu Zhiwei <zhiwei_liu@xxxxxxxxxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Eric Farman <farman@xxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Ilya Leoshkevich <iii@xxxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Magnus Damm <magnus.damm@xxxxxxxxx>, Artyom Tarasenko <atar4qemu@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, qemu-arm@xxxxxxxxxx, qemu-ppc@xxxxxxxxxx, qemu-riscv@xxxxxxxxxx, qemu-s390x@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, David Woodhouse <dwmw@xxxxxxxxxxxx>
- Delivery-date: Fri, 26 Jan 2024 14:43:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, 8 Jan 2024 at 20:49, David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
>
> From: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxx>
> Reviewed-by: Paul Durrant <paul@xxxxxxx>
> ---
> 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
|