mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
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>
This commit is contained in:
parent
6dffbe36af
commit
c6941b3b9b
3 changed files with 49 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue