aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2022-11-10 13:52:22 +0100
committerJason Wang <jasowang@redhat.com>2023-02-17 13:31:33 +0800
commitc6941b3b9b7445f7760c462882f8397b9dc51e30 (patch)
treedb3f9ce119680c488433f24f99963c13103be0cc /include/net
parent6dffbe36af79e26a4d23f94a9a1c1201de99c261 (diff)
net: Move the code to collect available NIC models to a separate function
The code that collects the available NIC models is not really specific to PCI anymore and will be required in the next patch, too, so let's move this into a new separate function in net.c instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/net.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/net.h b/include/net/net.h
index fad589cc1d..1d88621c12 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -203,6 +203,20 @@ void net_socket_rs_init(SocketReadState *rs,
bool vnet_hdr);
NetClientState *qemu_get_peer(NetClientState *nc, int queue_index);
+/**
+ * qemu_get_nic_models:
+ * @device_type: Defines which devices should be taken into consideration
+ * (e.g. TYPE_DEVICE for all devices, or TYPE_PCI_DEVICE for PCI)
+ *
+ * Get an array of pointers to names of NIC devices that are available in
+ * the QEMU binary. The array is terminated with a NULL pointer entry.
+ * The caller is responsible for freeing the memory when it is not required
+ * anymore, e.g. with g_ptr_array_free(..., true).
+ *
+ * Returns: Pointer to the array that contains the pointers to the names.
+ */
+GPtrArray *qemu_get_nic_models(const char *device_type);
+
/* NIC info */
#define MAX_NICS 8