[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-8.3 v2 45/46] net: remove qemu_show_nic_models(), qemu_find_n
From: |
David Woodhouse |
Subject: |
[PATCH for-8.3 v2 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model() |
Date: |
Mon, 6 Nov 2023 19:49:50 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
These old functions can be removed now too. Let net_param_nic() print
the full set of network devices directly, and also make it note that a
list more specific to this platform/config will be available by using
'-nic model=help' instead.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
include/net/net.h | 3 ---
net/net.c | 39 ++++++---------------------------------
2 files changed, 6 insertions(+), 36 deletions(-)
diff --git a/include/net/net.h b/include/net/net.h
index 1512650190..290e604f03 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -201,9 +201,6 @@ void qemu_set_vnet_hdr_len(NetClientState *nc, int len);
int qemu_set_vnet_le(NetClientState *nc, bool is_le);
int qemu_set_vnet_be(NetClientState *nc, bool is_be);
void qemu_macaddr_default_if_unset(MACAddr *macaddr);
-int qemu_show_nic_models(const char *arg, const char *const *models);
-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,
diff --git a/net/net.c b/net/net.c
index ffc722069f..a3532a71a5 100644
--- a/net/net.c
+++ b/net/net.c
@@ -962,38 +962,6 @@ GPtrArray *qemu_get_nic_models(const char *device_type)
return nic_models;
}
-int qemu_show_nic_models(const char *arg, const char *const *models)
-{
- int i;
-
- if (!arg || !is_help_option(arg)) {
- return 0;
- }
-
- printf("Available NIC models:\n");
- for (i = 0 ; models[i]; i++) {
- printf("%s\n", models[i]);
- }
- return 1;
-}
-
-int qemu_find_nic_model(NICInfo *nd, const char * const *models,
- const char *default_model)
-{
- int i;
-
- if (!nd->model)
- nd->model = g_strdup(default_model);
-
- for (i = 0 ; models[i]; i++) {
- if (strcmp(nd->model, models[i]) == 0)
- return i;
- }
-
- error_report("Unsupported NIC model: %s", nd->model);
- return -1;
-}
-
static int net_init_nic(const Netdev *netdev, const char *name,
NetClientState *peer, Error **errp)
{
@@ -1776,9 +1744,14 @@ static int net_param_nic(void *dummy, QemuOpts *opts,
Error **errp)
}
if (is_help_option(type)) {
GPtrArray *nic_models = qemu_get_nic_models(TYPE_DEVICE);
+ int i;
show_netdevs();
printf("\n");
- qemu_show_nic_models(type, (const char **)nic_models->pdata);
+ printf("Supported NIC models "
+ "(use -nic model=help for a filtered list):\n");
+ for (i = 0 ; nic_models->pdata[i]; i++) {
+ printf("%s\n", (char *)nic_models->pdata[i]);
+ }
g_ptr_array_free(nic_models, true);
exit(0);
}
--
2.41.0
- [PATCH for-8.3 v2 32/46] hw/m68k/mcf5208: use qemu_create_nic_device(), (continued)
- [PATCH for-8.3 v2 32/46] hw/m68k/mcf5208: use qemu_create_nic_device(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 02/46] net: report list of available models according to platform, David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 36/46] hw/mips/jazz: use qemu_find_nic_info(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 11/46] hw/loongarch: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 12/46] hw/mips/fuloong2e: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 42/46] hw/xtensa/xtfpga: use qemu_create_nic_device(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 20/46] hw/xtensa/virt: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 07/46] hw/alpha/dp264: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 14/46] hw/mips/loongson3_virt: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 29/46] hw/arm/stellaris: use qemu_find_nic_info(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 45/46] net: remove qemu_show_nic_models(), qemu_find_nic_model(),
David Woodhouse <=
- [PATCH for-8.3 v2 43/46] net: remove qemu_check_nic_model(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 44/46] hw/pci: remove pci_nic_init_nofail(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 17/46] hw/ppc: use pci_init_nic_devices(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 39/46] hw/riscv: use qemu_configure_nic_device(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 33/46] hw/m68k/q800: use qemu_find_nic_info(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 27/46] hw/arm/highbank: use qemu_create_nic_device(), David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 28/46] hw/arm/npcm7xx: use qemu_configure_nic_device, allow emc0/emc1 as aliases, David Woodhouse, 2023/11/06
- [PATCH for-8.3 v2 04/46] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot(), David Woodhouse, 2023/11/06