mirror of https://github.com/xemu-project/xemu.git
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJa+UAZAAoJEO8Ells5jWIRTJIIAIcpNROupxHEfcAQKU7lIqys qx/FxKp+lknzzQMwUfmZwT3PuBD+tWuE7ugXgzjVulvE11F+Z3QBPTDBtOObaMa1 qpgIF3zzrNxtuWMc/72Q8/wEE1wtBUo+WTAGw9Xp1dVomYOOsg1wa7dsKdZhRfz7 nIwDW2ftw3/mx+uTW2/a163v+IDDL9L+HOLibQHWUxOMM39ASchiqAXLF4mfhpwH xr0OPd7wtcmrDsD/CLbdkGCJ/+vsXnY8pzNmy1RjJuDpWpqlgYpJJPtLBfXBo9VA 91sz5+KryzjpXXzKcQuhiU020O1dIKIe3PWqK6z0x0UjtZ1Yox5adZ3eFomHHwU= =bIws -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging # gpg: Signature made Mon 14 May 2018 08:51:53 BST # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: net: Get rid of 'vlan' terminology and use 'hub' instead in the doc files net: Get rid of 'vlan' terminology and use 'hub' instead in the source files net: Remove the deprecated "vlan" parameter net: Fix memory leak in net_param_nic() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
7a9180b77e
|
@ -277,9 +277,6 @@ devices and ne2k_isa are.
|
||||||
|
|
||||||
Some PCI devices aren't available with -net nic, e.g. i82558a.
|
Some PCI devices aren't available with -net nic, e.g. i82558a.
|
||||||
|
|
||||||
To connect to a VLAN instead of an ordinary host part, replace
|
|
||||||
netdev=NET-ID by vlan=VLAN.
|
|
||||||
|
|
||||||
=== Graphics Devices ===
|
=== Graphics Devices ===
|
||||||
|
|
||||||
Host and guest part of graphics devices have always been separate.
|
Host and guest part of graphics devices have always been separate.
|
||||||
|
|
|
@ -321,86 +321,6 @@ const PropertyInfo qdev_prop_netdev = {
|
||||||
.set = set_netdev,
|
.set = set_netdev,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --- vlan --- */
|
|
||||||
|
|
||||||
static int print_vlan(DeviceState *dev, Property *prop, char *dest, size_t len)
|
|
||||||
{
|
|
||||||
NetClientState **ptr = qdev_get_prop_ptr(dev, prop);
|
|
||||||
|
|
||||||
if (*ptr) {
|
|
||||||
int id;
|
|
||||||
if (!net_hub_id_for_client(*ptr, &id)) {
|
|
||||||
return snprintf(dest, len, "%d", id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return snprintf(dest, len, "<null>");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void get_vlan(Object *obj, Visitor *v, const char *name, void *opaque,
|
|
||||||
Error **errp)
|
|
||||||
{
|
|
||||||
DeviceState *dev = DEVICE(obj);
|
|
||||||
Property *prop = opaque;
|
|
||||||
NetClientState **ptr = qdev_get_prop_ptr(dev, prop);
|
|
||||||
int32_t id = -1;
|
|
||||||
|
|
||||||
if (*ptr) {
|
|
||||||
int hub_id;
|
|
||||||
if (!net_hub_id_for_client(*ptr, &hub_id)) {
|
|
||||||
id = hub_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
visit_type_int32(v, name, &id, errp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque,
|
|
||||||
Error **errp)
|
|
||||||
{
|
|
||||||
DeviceState *dev = DEVICE(obj);
|
|
||||||
Property *prop = opaque;
|
|
||||||
NICPeers *peers_ptr = qdev_get_prop_ptr(dev, prop);
|
|
||||||
NetClientState **ptr = &peers_ptr->ncs[0];
|
|
||||||
Error *local_err = NULL;
|
|
||||||
int32_t id;
|
|
||||||
NetClientState *hubport;
|
|
||||||
|
|
||||||
if (dev->realized) {
|
|
||||||
qdev_prop_set_after_realize(dev, name, errp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
visit_type_int32(v, name, &id, &local_err);
|
|
||||||
if (local_err) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (id == -1) {
|
|
||||||
*ptr = NULL;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (*ptr) {
|
|
||||||
error_set_from_qdev_prop_error(errp, -EINVAL, dev, prop, name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
hubport = net_hub_port_find(id);
|
|
||||||
if (!hubport) {
|
|
||||||
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
|
|
||||||
name, prop->info->name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*ptr = hubport;
|
|
||||||
}
|
|
||||||
|
|
||||||
const PropertyInfo qdev_prop_vlan = {
|
|
||||||
.name = "int32",
|
|
||||||
.description = "Integer VLAN id to connect to",
|
|
||||||
.print = print_vlan,
|
|
||||||
.get = get_vlan,
|
|
||||||
.set = set_vlan,
|
|
||||||
};
|
|
||||||
|
|
||||||
void qdev_prop_set_drive(DeviceState *dev, const char *name,
|
void qdev_prop_set_drive(DeviceState *dev, const char *name,
|
||||||
BlockBackend *value, Error **errp)
|
BlockBackend *value, Error **errp)
|
||||||
|
|
|
@ -29,7 +29,6 @@ extern const PropertyInfo qdev_prop_bios_chs_trans;
|
||||||
extern const PropertyInfo qdev_prop_fdc_drive_type;
|
extern const PropertyInfo qdev_prop_fdc_drive_type;
|
||||||
extern const PropertyInfo qdev_prop_drive;
|
extern const PropertyInfo qdev_prop_drive;
|
||||||
extern const PropertyInfo qdev_prop_netdev;
|
extern const PropertyInfo qdev_prop_netdev;
|
||||||
extern const PropertyInfo qdev_prop_vlan;
|
|
||||||
extern const PropertyInfo qdev_prop_pci_devfn;
|
extern const PropertyInfo qdev_prop_pci_devfn;
|
||||||
extern const PropertyInfo qdev_prop_blocksize;
|
extern const PropertyInfo qdev_prop_blocksize;
|
||||||
extern const PropertyInfo qdev_prop_pci_host_devaddr;
|
extern const PropertyInfo qdev_prop_pci_host_devaddr;
|
||||||
|
@ -195,8 +194,6 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar;
|
||||||
DEFINE_PROP(_n, _s, _f, qdev_prop_string, char*)
|
DEFINE_PROP(_n, _s, _f, qdev_prop_string, char*)
|
||||||
#define DEFINE_PROP_NETDEV(_n, _s, _f) \
|
#define DEFINE_PROP_NETDEV(_n, _s, _f) \
|
||||||
DEFINE_PROP(_n, _s, _f, qdev_prop_netdev, NICPeers)
|
DEFINE_PROP(_n, _s, _f, qdev_prop_netdev, NICPeers)
|
||||||
#define DEFINE_PROP_VLAN(_n, _s, _f) \
|
|
||||||
DEFINE_PROP(_n, _s, _f, qdev_prop_vlan, NICPeers)
|
|
||||||
#define DEFINE_PROP_DRIVE(_n, _s, _f) \
|
#define DEFINE_PROP_DRIVE(_n, _s, _f) \
|
||||||
DEFINE_PROP(_n, _s, _f, qdev_prop_drive, BlockBackend *)
|
DEFINE_PROP(_n, _s, _f, qdev_prop_drive, BlockBackend *)
|
||||||
#define DEFINE_PROP_MACADDR(_n, _s, _f) \
|
#define DEFINE_PROP_MACADDR(_n, _s, _f) \
|
||||||
|
|
|
@ -37,7 +37,6 @@ typedef struct NICConf {
|
||||||
|
|
||||||
#define DEFINE_NIC_PROPERTIES(_state, _conf) \
|
#define DEFINE_NIC_PROPERTIES(_state, _conf) \
|
||||||
DEFINE_PROP_MACADDR("mac", _state, _conf.macaddr), \
|
DEFINE_PROP_MACADDR("mac", _state, _conf.macaddr), \
|
||||||
DEFINE_PROP_VLAN("vlan", _state, _conf.peers), \
|
|
||||||
DEFINE_PROP_NETDEV("netdev", _state, _conf.peers)
|
DEFINE_PROP_NETDEV("netdev", _state, _conf.peers)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A hub broadcasts incoming packets to all its ports except the source port.
|
* A hub broadcasts incoming packets to all its ports except the source port.
|
||||||
* Hubs can be used to provide independent network segments, also confusingly
|
* Hubs can be used to provide independent emulated network segments.
|
||||||
* named the QEMU 'vlan' feature.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct NetHub NetHub;
|
typedef struct NetHub NetHub;
|
||||||
|
@ -345,10 +344,10 @@ void net_hub_check_clients(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (has_host_dev && !has_nic) {
|
if (has_host_dev && !has_nic) {
|
||||||
warn_report("vlan %d with no nics", hub->id);
|
warn_report("hub %d with no nics", hub->id);
|
||||||
}
|
}
|
||||||
if (has_nic && !has_host_dev) {
|
if (has_nic && !has_host_dev) {
|
||||||
warn_report("vlan %d is not connected to host network", hub->id);
|
warn_report("hub %d is not connected to host network", hub->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
18
net/net.c
18
net/net.c
|
@ -965,7 +965,6 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
|
||||||
const Netdev *netdev;
|
const Netdev *netdev;
|
||||||
const char *name;
|
const char *name;
|
||||||
NetClientState *peer = NULL;
|
NetClientState *peer = NULL;
|
||||||
static bool vlan_warned;
|
|
||||||
|
|
||||||
if (is_netdev) {
|
if (is_netdev) {
|
||||||
netdev = object;
|
netdev = object;
|
||||||
|
@ -1036,15 +1035,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not add to a vlan if it's a nic with a netdev= parameter. */
|
/* Do not add to a hub if it's a nic with a netdev= parameter. */
|
||||||
if (netdev->type != NET_CLIENT_DRIVER_NIC ||
|
if (netdev->type != NET_CLIENT_DRIVER_NIC ||
|
||||||
!opts->u.nic.has_netdev) {
|
!opts->u.nic.has_netdev) {
|
||||||
peer = net_hub_add_port(net->has_vlan ? net->vlan : 0, NULL, NULL);
|
peer = net_hub_add_port(0, NULL, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (net->has_vlan && !vlan_warned) {
|
|
||||||
error_report("'vlan' is deprecated. Please use 'netdev' instead.");
|
|
||||||
vlan_warned = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,7 +1359,7 @@ void qmp_set_link(const char *name, bool up, Error **errp)
|
||||||
* If the peer is a HUBPORT or a backend, we do not change the
|
* If the peer is a HUBPORT or a backend, we do not change the
|
||||||
* link status.
|
* link status.
|
||||||
*
|
*
|
||||||
* This behavior is compatible with qemu vlans where there could be
|
* This behavior is compatible with qemu hubs where there could be
|
||||||
* multiple clients that can still communicate with each other in
|
* multiple clients that can still communicate with each other in
|
||||||
* disconnected mode. For now maintain this compatibility.
|
* disconnected mode. For now maintain this compatibility.
|
||||||
*/
|
*/
|
||||||
|
@ -1502,11 +1496,12 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
|
||||||
g_free(mac);
|
g_free(mac);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
error_setg(errp, "invalid syntax for ethernet address");
|
error_setg(errp, "invalid syntax for ethernet address");
|
||||||
return -1;
|
goto out;
|
||||||
}
|
}
|
||||||
if (is_multicast_ether_addr(ni->macaddr.a)) {
|
if (is_multicast_ether_addr(ni->macaddr.a)) {
|
||||||
error_setg(errp, "NIC cannot have multicast MAC address");
|
error_setg(errp, "NIC cannot have multicast MAC address");
|
||||||
return -1;
|
ret = -1;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qemu_macaddr_default_if_unset(&ni->macaddr);
|
qemu_macaddr_default_if_unset(&ni->macaddr);
|
||||||
|
@ -1518,6 +1513,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
|
||||||
nb_nics++;
|
nb_nics++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
g_free(nd_id);
|
g_free(nd_id);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,7 +415,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id,
|
||||||
if (hub_id) {
|
if (hub_id) {
|
||||||
nc = net_hub_find_client_by_name(strtol(hub_id, NULL, 0), name);
|
nc = net_hub_find_client_by_name(strtol(hub_id, NULL, 0), name);
|
||||||
if (!nc) {
|
if (!nc) {
|
||||||
monitor_printf(mon, "unrecognized (vlan-id, stackname) pair\n");
|
monitor_printf(mon, "unrecognized (hub-id, stackname) pair\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -870,9 +870,9 @@ void hmp_info_usernet(Monitor *mon, const QDict *qdict)
|
||||||
|
|
||||||
QTAILQ_FOREACH(s, &slirp_stacks, entry) {
|
QTAILQ_FOREACH(s, &slirp_stacks, entry) {
|
||||||
int id;
|
int id;
|
||||||
bool got_vlan_id = net_hub_id_for_client(&s->nc, &id) == 0;
|
bool got_hub_id = net_hub_id_for_client(&s->nc, &id) == 0;
|
||||||
monitor_printf(mon, "VLAN %d (%s):\n",
|
monitor_printf(mon, "Hub %d (%s):\n",
|
||||||
got_vlan_id ? id : -1,
|
got_hub_id ? id : -1,
|
||||||
s->nc.name);
|
s->nc.name);
|
||||||
slirp_connection_info(s->slirp, mon);
|
slirp_connection_info(s->slirp, mon);
|
||||||
}
|
}
|
||||||
|
|
|
@ -766,10 +766,10 @@ int net_init_tap(const Netdev *netdev, const char *name,
|
||||||
queues = tap->has_queues ? tap->queues : 1;
|
queues = tap->has_queues ? tap->queues : 1;
|
||||||
vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL;
|
vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL;
|
||||||
|
|
||||||
/* QEMU vlans does not support multiqueue tap, in this case peer is set.
|
/* QEMU hubs do not support multiqueue tap, in this case peer is set.
|
||||||
* For -netdev, peer is always NULL. */
|
* For -netdev, peer is always NULL. */
|
||||||
if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) {
|
if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) {
|
||||||
error_setg(errp, "Multiqueue tap cannot be used with QEMU vlans");
|
error_setg(errp, "Multiqueue tap cannot be used with hubs");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@
|
||||||
##
|
##
|
||||||
# @NetdevTapOptions:
|
# @NetdevTapOptions:
|
||||||
#
|
#
|
||||||
# Connect the host TAP network interface name to the VLAN.
|
# Used to configure a host TAP network interface backend.
|
||||||
#
|
#
|
||||||
# @ifname: interface name
|
# @ifname: interface name
|
||||||
#
|
#
|
||||||
|
@ -267,8 +267,8 @@
|
||||||
##
|
##
|
||||||
# @NetdevSocketOptions:
|
# @NetdevSocketOptions:
|
||||||
#
|
#
|
||||||
# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
|
# Socket netdevs are used to establish a network connection to another
|
||||||
# socket connection.
|
# QEMU virtual machine via a TCP socket.
|
||||||
#
|
#
|
||||||
# @fd: file descriptor of an already opened socket
|
# @fd: file descriptor of an already opened socket
|
||||||
#
|
#
|
||||||
|
@ -296,7 +296,7 @@
|
||||||
##
|
##
|
||||||
# @NetdevL2TPv3Options:
|
# @NetdevL2TPv3Options:
|
||||||
#
|
#
|
||||||
# Connect the VLAN to Ethernet over L2TPv3 Static tunnel
|
# Configure an Ethernet over L2TPv3 tunnel.
|
||||||
#
|
#
|
||||||
# @src: source address
|
# @src: source address
|
||||||
#
|
#
|
||||||
|
@ -352,7 +352,7 @@
|
||||||
##
|
##
|
||||||
# @NetdevVdeOptions:
|
# @NetdevVdeOptions:
|
||||||
#
|
#
|
||||||
# Connect the VLAN to a vde switch running on the host.
|
# Connect to a vde switch running on the host.
|
||||||
#
|
#
|
||||||
# @sock: socket path
|
# @sock: socket path
|
||||||
#
|
#
|
||||||
|
@ -490,8 +490,6 @@
|
||||||
#
|
#
|
||||||
# Captures the configuration of a network device; legacy.
|
# Captures the configuration of a network device; legacy.
|
||||||
#
|
#
|
||||||
# @vlan: vlan number
|
|
||||||
#
|
|
||||||
# @id: identifier for monitor commands
|
# @id: identifier for monitor commands
|
||||||
#
|
#
|
||||||
# @name: identifier for monitor commands, ignored if @id is present
|
# @name: identifier for monitor commands, ignored if @id is present
|
||||||
|
@ -499,10 +497,11 @@
|
||||||
# @opts: device type specific properties (legacy)
|
# @opts: device type specific properties (legacy)
|
||||||
#
|
#
|
||||||
# Since: 1.2
|
# Since: 1.2
|
||||||
|
#
|
||||||
|
# 'vlan' - removed with 2.12
|
||||||
##
|
##
|
||||||
{ 'struct': 'NetLegacy',
|
{ 'struct': 'NetLegacy',
|
||||||
'data': {
|
'data': {
|
||||||
'*vlan': 'int32',
|
|
||||||
'*id': 'str',
|
'*id': 'str',
|
||||||
'*name': 'str',
|
'*name': 'str',
|
||||||
'opts': 'NetLegacyOptions' } }
|
'opts': 'NetLegacyOptions' } }
|
||||||
|
|
|
@ -715,20 +715,12 @@ state is not saved or restored properly (in particular USB).
|
||||||
@node pcsys_network
|
@node pcsys_network
|
||||||
@section Network emulation
|
@section Network emulation
|
||||||
|
|
||||||
QEMU can simulate several network cards (PCI or ISA cards on the PC
|
QEMU can simulate several network cards (e.g. PCI or ISA cards on the PC
|
||||||
target) and can connect them to an arbitrary number of Virtual Local
|
target) and can connect them to a network backend on the host or an emulated
|
||||||
Area Networks (VLANs). Host TAP devices can be connected to any QEMU
|
hub. The various host network backends can either be used to connect the NIC of
|
||||||
VLAN. VLAN can be connected between separate instances of QEMU to
|
the guest to a real network (e.g. by using a TAP devices or the non-privileged
|
||||||
simulate large networks. For simpler usage, a non privileged user mode
|
user mode network stack), or to other guest instances running in another QEMU
|
||||||
network stack can replace the TAP device to have a basic network
|
process (e.g. by using the socket host network backend).
|
||||||
connection.
|
|
||||||
|
|
||||||
@subsection VLANs
|
|
||||||
|
|
||||||
QEMU simulates several VLANs. A VLAN can be symbolised as a virtual
|
|
||||||
connection between several network devices. These devices can be for
|
|
||||||
example QEMU virtual Ethernet cards or virtual Host ethernet devices
|
|
||||||
(TAP devices).
|
|
||||||
|
|
||||||
@subsection Using TAP network interfaces
|
@subsection Using TAP network interfaces
|
||||||
|
|
||||||
|
@ -764,7 +756,7 @@ network). The virtual network configuration is the following:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
|
|
||||||
QEMU VLAN <------> Firewall/DHCP server <-----> Internet
|
guest (10.0.2.15) <------> Firewall/DHCP server <-----> Internet
|
||||||
| (10.0.2.2)
|
| (10.0.2.2)
|
||||||
|
|
|
|
||||||
----> DNS server (10.0.2.3)
|
----> DNS server (10.0.2.3)
|
||||||
|
@ -799,11 +791,23 @@ When using the @option{'-netdev user,hostfwd=...'} option, TCP or UDP
|
||||||
connections can be redirected from the host to the guest. It allows for
|
connections can be redirected from the host to the guest. It allows for
|
||||||
example to redirect X11, telnet or SSH connections.
|
example to redirect X11, telnet or SSH connections.
|
||||||
|
|
||||||
@subsection Connecting VLANs between QEMU instances
|
@subsection Hubs
|
||||||
|
|
||||||
Using the @option{-net socket} option, it is possible to make VLANs
|
QEMU can simulate several hubs. A hub can be thought of as a virtual connection
|
||||||
that span several QEMU instances. See @ref{sec_invocation} to have a
|
between several network devices. These devices can be for example QEMU virtual
|
||||||
basic example.
|
ethernet cards or virtual Host ethernet devices (TAP devices). You can connect
|
||||||
|
guest NICs or host network backends to such a hub using the @option{-netdev
|
||||||
|
hubport} or @option{-nic hubport} options. The legacy @option{-net} option
|
||||||
|
also connects the given device to the emulated hub with ID 0 (i.e. the default
|
||||||
|
hub) unless you specify a netdev with @option{-net nic,netdev=xxx} here.
|
||||||
|
|
||||||
|
@subsection Connecting emulated networks between QEMU instances
|
||||||
|
|
||||||
|
Using the @option{-netdev socket} (or @option{-nic socket} or
|
||||||
|
@option{-net socket}) option, it is possible to create emulated
|
||||||
|
networks that span several QEMU instances.
|
||||||
|
See the description of the @option{-netdev socket} option in the
|
||||||
|
@ref{sec_invocation,,Invocation chapter} to have a basic example.
|
||||||
|
|
||||||
@node pcsys_other_devs
|
@node pcsys_other_devs
|
||||||
@section Other Devices
|
@section Other Devices
|
||||||
|
@ -2846,15 +2850,6 @@ with ``-device ...,netdev=x''), or ``-nic user,smb=/some/dir''
|
||||||
(for embedded NICs). The new syntax allows different settings to be
|
(for embedded NICs). The new syntax allows different settings to be
|
||||||
provided per NIC.
|
provided per NIC.
|
||||||
|
|
||||||
@subsection -net vlan (since 2.9.0)
|
|
||||||
|
|
||||||
The ``-net vlan=NN'' argument was mostly used to attach separate
|
|
||||||
network backends to different virtual NICs. This is the default
|
|
||||||
behavior for ``-netdev'' and ``-nic''. You can connect multiple
|
|
||||||
``-netdev'' and ``-nic'' devices to the same network using the
|
|
||||||
"hubport" network backend, created with ``-netdev hubport,hubid=NN,...''
|
|
||||||
and ``-nic hubport,hubid=NN''.
|
|
||||||
|
|
||||||
@subsection -drive cyls=...,heads=...,secs=...,trans=... (since 2.10.0)
|
@subsection -drive cyls=...,heads=...,secs=...,trans=... (since 2.10.0)
|
||||||
|
|
||||||
The drive geometry arguments are replaced by the the geometry arguments
|
The drive geometry arguments are replaced by the the geometry arguments
|
||||||
|
|
|
@ -2003,7 +2003,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
|
||||||
" configure a vhost-user network, backed by a chardev 'dev'\n"
|
" configure a vhost-user network, backed by a chardev 'dev'\n"
|
||||||
#endif
|
#endif
|
||||||
"-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
|
"-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
|
||||||
" configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL)
|
" configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
|
||||||
DEF("nic", HAS_ARG, QEMU_OPTION_nic,
|
DEF("nic", HAS_ARG, QEMU_OPTION_nic,
|
||||||
"--nic [tap|bridge|"
|
"--nic [tap|bridge|"
|
||||||
#ifdef CONFIG_SLIRP
|
#ifdef CONFIG_SLIRP
|
||||||
|
@ -2028,10 +2028,9 @@ DEF("nic", HAS_ARG, QEMU_OPTION_nic,
|
||||||
" provided a 'user' network connection)\n",
|
" provided a 'user' network connection)\n",
|
||||||
QEMU_ARCH_ALL)
|
QEMU_ARCH_ALL)
|
||||||
DEF("net", HAS_ARG, QEMU_OPTION_net,
|
DEF("net", HAS_ARG, QEMU_OPTION_net,
|
||||||
"-net nic[,vlan=n][,netdev=nd][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
|
"-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
|
||||||
" configure or create an on-board (or machine default) NIC and\n"
|
" configure or create an on-board (or machine default) NIC and\n"
|
||||||
" connect it either to VLAN 'n' or the netdev 'nd' (for pluggable\n"
|
" connect it to hub 0 (please use -nic unless you need a hub)\n"
|
||||||
" NICs please use '-device devtype,netdev=nd' instead)\n"
|
|
||||||
"-net ["
|
"-net ["
|
||||||
#ifdef CONFIG_SLIRP
|
#ifdef CONFIG_SLIRP
|
||||||
"user|"
|
"user|"
|
||||||
|
@ -2044,7 +2043,7 @@ DEF("net", HAS_ARG, QEMU_OPTION_net,
|
||||||
#ifdef CONFIG_NETMAP
|
#ifdef CONFIG_NETMAP
|
||||||
"netmap|"
|
"netmap|"
|
||||||
#endif
|
#endif
|
||||||
"socket][,vlan=n][,option][,option][,...]\n"
|
"socket][,option][,option][,...]\n"
|
||||||
" old way to initialize a host network interface\n"
|
" old way to initialize a host network interface\n"
|
||||||
" (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
|
" (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
|
||||||
STEXI
|
STEXI
|
||||||
|
@ -2462,17 +2461,14 @@ qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,sha
|
||||||
Create a hub port on the emulated hub with ID @var{hubid}.
|
Create a hub port on the emulated hub with ID @var{hubid}.
|
||||||
|
|
||||||
The hubport netdev lets you connect a NIC to a QEMU emulated hub instead of a
|
The hubport netdev lets you connect a NIC to a QEMU emulated hub instead of a
|
||||||
single netdev. @code{-net} and @code{-device} with the parameter @option{vlan}
|
single netdev. Alternatively, you can also connect the hubport to another
|
||||||
(deprecated), or @code{-nic hubport} can also be used to connect a
|
netdev with ID @var{nd} by using the @option{netdev=@var{nd}} option.
|
||||||
network device or a NIC to a hub. Alternatively, you can also connect the
|
|
||||||
hubport to another netdev with ID @var{nd} by using the @option{netdev=@var{nd}}
|
|
||||||
option.
|
|
||||||
|
|
||||||
@item -net nic[,vlan=@var{n}][,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
|
@item -net nic[,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
|
||||||
@findex -net
|
@findex -net
|
||||||
Legacy option to configure or create an on-board (or machine default) Network
|
Legacy option to configure or create an on-board (or machine default) Network
|
||||||
Interface Card(NIC) and connect it either to the emulated hub port ("vlan")
|
Interface Card(NIC) and connect it either to the emulated hub with ID 0 (i.e.
|
||||||
with number @var{n} (@var{n} = 0 is the default), or to the netdev @var{nd}.
|
the default hub), or to the netdev @var{nd}.
|
||||||
The NIC is an e1000 by default on the PC target. Optionally, the MAC address
|
The NIC is an e1000 by default on the PC target. Optionally, the MAC address
|
||||||
can be changed to @var{mac}, the device address set to @var{addr} (PCI cards
|
can be changed to @var{mac}, the device address set to @var{addr} (PCI cards
|
||||||
only), and a @var{name} can be assigned for use in monitor commands.
|
only), and a @var{name} can be assigned for use in monitor commands.
|
||||||
|
@ -2482,11 +2478,10 @@ that the card should have; this option currently only affects virtio cards; set
|
||||||
NIC is created. QEMU can emulate several different models of network card.
|
NIC is created. QEMU can emulate several different models of network card.
|
||||||
Use @code{-net nic,model=help} for a list of available devices for your target.
|
Use @code{-net nic,model=help} for a list of available devices for your target.
|
||||||
|
|
||||||
@item -net user|tap|bridge|socket|l2tpv3|vde[,...][,vlan=@var{n}][,name=@var{name}]
|
@item -net user|tap|bridge|socket|l2tpv3|vde[,...][,name=@var{name}]
|
||||||
Configure a host network backend (with the options corresponding to the same
|
Configure a host network backend (with the options corresponding to the same
|
||||||
@option{-netdev} option) and connect it to the emulated hub ("vlan") with the
|
@option{-netdev} option) and connect it to the emulated hub 0 (the default
|
||||||
number @var{n} (default is number 0). Use @var{name} to specify the name of the
|
hub). Use @var{name} to specify the name of the hub port.
|
||||||
hub port.
|
|
||||||
ETEXI
|
ETEXI
|
||||||
|
|
||||||
STEXI
|
STEXI
|
||||||
|
|
Loading…
Reference in New Issue