qemu-cr16/include/net
Laurent Vivier 9b5b45c717 net: Define net_client_set_link()
The code to set the link status is currently located in
qmp_set_link(). This function identifies the device by name,
searches for the corresponding NetClientState, and then updates
the link status.

In some parts of the code, such as vhost-user.c, the
NetClientState are already available. Calling qmp_set_link()
from these locations leads to a redundant search for the clients.

This patch refactors the logic by introducing a new function,
net_client_set_link(), which accepts a NetClientState array
directly. qmp_set_link() is simplified to be a wrapper that
performs the client search and then calls the new function.
The vhost-user implementation is updated to use net_client_set_link()
directly, thereby eliminating the unnecessary client lookup.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2025-07-14 13:27:09 +08:00
..
announce.h net: remove AnnounceTimer from typedefs.h 2024-05-03 15:47:48 +02:00
can_emu.h net/can: Add can_dlc2len and can_len2dlc for CAN FD. 2020-09-30 19:11:37 +02:00
can_host.h qom: fix objects with improper parent type 2020-10-12 11:50:22 -04:00
checksum.h net: checksum: Convert data to void * 2024-11-25 13:59:50 +08:00
eth.h net: mark struct ip_header as QEMU_PACKED 2024-11-18 13:45:45 +01:00
filter.h qapi: Move @String out of common.json to discourage reuse 2024-02-12 10:04:32 +01:00
net.h net: Define net_client_set_link() 2025-07-14 13:27:09 +08:00
queue.h net: Remove deadcode 2024-10-03 17:26:05 +03:00
slirp.h net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2018-08-31 09:53:03 +02:00
tap.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
vhost-user.h vhost-user: Refactor vhost acked features saving 2023-01-08 01:54:22 -05:00
vhost-vdpa.h vhost-vdpa: remove the unused vhost_vdpa_get_acked_features() 2021-06-11 10:30:13 +08:00
vhost_net.h Revert "tap: setting error appropriately when calling net_init_tap_one()" 2024-03-29 14:59:07 +08:00