mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
net: Rename VLANClientState to NetClientState
The vlan feature is no longer part of net core. Rename VLANClientState to NetClientState because net clients are not explicitly associated with a vlan at all, instead they have a peer net client to which they are connected. This patch is a mechanical search-and-replace except for a few whitespace fixups where changing VLANClientState to NetClientState misaligned whitespace. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
94878994dc
commit
4e68f7a081
50 changed files with 282 additions and 283 deletions
26
net/hub.c
26
net/hub.c
|
@ -25,7 +25,7 @@
|
|||
typedef struct NetHub NetHub;
|
||||
|
||||
typedef struct NetHubPort {
|
||||
VLANClientState nc;
|
||||
NetClientState nc;
|
||||
QLIST_ENTRY(NetHubPort) next;
|
||||
NetHub *hub;
|
||||
int id;
|
||||
|
@ -85,7 +85,7 @@ static NetHub *net_hub_new(int id)
|
|||
return hub;
|
||||
}
|
||||
|
||||
static ssize_t net_hub_port_receive(VLANClientState *nc,
|
||||
static ssize_t net_hub_port_receive(NetClientState *nc,
|
||||
const uint8_t *buf, size_t len)
|
||||
{
|
||||
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
|
||||
|
@ -93,7 +93,7 @@ static ssize_t net_hub_port_receive(VLANClientState *nc,
|
|||
return net_hub_receive(port->hub, port, buf, len);
|
||||
}
|
||||
|
||||
static ssize_t net_hub_port_receive_iov(VLANClientState *nc,
|
||||
static ssize_t net_hub_port_receive_iov(NetClientState *nc,
|
||||
const struct iovec *iov, int iovcnt)
|
||||
{
|
||||
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
|
||||
|
@ -101,7 +101,7 @@ static ssize_t net_hub_port_receive_iov(VLANClientState *nc,
|
|||
return net_hub_receive_iov(port->hub, port, iov, iovcnt);
|
||||
}
|
||||
|
||||
static void net_hub_port_cleanup(VLANClientState *nc)
|
||||
static void net_hub_port_cleanup(NetClientState *nc)
|
||||
{
|
||||
NetHubPort *port = DO_UPCAST(NetHubPort, nc, nc);
|
||||
|
||||
|
@ -118,7 +118,7 @@ static NetClientInfo net_hub_port_info = {
|
|||
|
||||
static NetHubPort *net_hub_port_new(NetHub *hub, const char *name)
|
||||
{
|
||||
VLANClientState *nc;
|
||||
NetClientState *nc;
|
||||
NetHubPort *port;
|
||||
int id = hub->num_ports++;
|
||||
char default_name[128];
|
||||
|
@ -145,7 +145,7 @@ static NetHubPort *net_hub_port_new(NetHub *hub, const char *name)
|
|||
*
|
||||
* If there is no existing hub with the given id then a new hub is created.
|
||||
*/
|
||||
VLANClientState *net_hub_add_port(int hub_id, const char *name)
|
||||
NetClientState *net_hub_add_port(int hub_id, const char *name)
|
||||
{
|
||||
NetHub *hub;
|
||||
NetHubPort *port;
|
||||
|
@ -167,11 +167,11 @@ VLANClientState *net_hub_add_port(int hub_id, const char *name)
|
|||
/**
|
||||
* Find a specific client on a hub
|
||||
*/
|
||||
VLANClientState *net_hub_find_client_by_name(int hub_id, const char *name)
|
||||
NetClientState *net_hub_find_client_by_name(int hub_id, const char *name)
|
||||
{
|
||||
NetHub *hub;
|
||||
NetHubPort *port;
|
||||
VLANClientState *peer;
|
||||
NetClientState *peer;
|
||||
|
||||
QLIST_FOREACH(hub, &hubs, next) {
|
||||
if (hub->id == hub_id) {
|
||||
|
@ -190,11 +190,11 @@ VLANClientState *net_hub_find_client_by_name(int hub_id, const char *name)
|
|||
/**
|
||||
* Find a available port on a hub; otherwise create one new port
|
||||
*/
|
||||
VLANClientState *net_hub_port_find(int hub_id)
|
||||
NetClientState *net_hub_port_find(int hub_id)
|
||||
{
|
||||
NetHub *hub;
|
||||
NetHubPort *port;
|
||||
VLANClientState *nc;
|
||||
NetClientState *nc;
|
||||
|
||||
QLIST_FOREACH(hub, &hubs, next) {
|
||||
if (hub->id == hub_id) {
|
||||
|
@ -234,7 +234,7 @@ void net_hub_info(Monitor *mon)
|
|||
*
|
||||
* @id Pointer for hub id output, may be NULL
|
||||
*/
|
||||
int net_hub_id_for_client(VLANClientState *nc, int *id)
|
||||
int net_hub_id_for_client(NetClientState *nc, int *id)
|
||||
{
|
||||
NetHubPort *port;
|
||||
|
||||
|
@ -254,7 +254,7 @@ int net_hub_id_for_client(VLANClientState *nc, int *id)
|
|||
}
|
||||
|
||||
int net_init_hubport(const NetClientOptions *opts, const char *name,
|
||||
VLANClientState *peer)
|
||||
NetClientState *peer)
|
||||
{
|
||||
const NetdevHubPortOptions *hubport;
|
||||
|
||||
|
@ -277,7 +277,7 @@ void net_hub_check_clients(void)
|
|||
{
|
||||
NetHub *hub;
|
||||
NetHubPort *port;
|
||||
VLANClientState *peer;
|
||||
NetClientState *peer;
|
||||
|
||||
QLIST_FOREACH(hub, &hubs, next) {
|
||||
int has_nic = 0, has_host_dev = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue