From nobody Thu May 2 21:35:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522856144766930.7380387876422; Wed, 4 Apr 2018 08:35:44 -0700 (PDT) Received: from localhost ([::1]:38239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3kRq-00011y-BU for importer@patchew.org; Wed, 04 Apr 2018 11:35:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3kPq-0008Md-J9 for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3kPn-0005qn-DK for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:38 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55688 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3kPn-0005pn-8f for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 475798182D0C; Wed, 4 Apr 2018 15:33:32 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id 844AB2024CA2; Wed, 4 Apr 2018 15:33:30 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Jason Wang Date: Wed, 4 Apr 2018 17:33:22 +0200 Message-Id: <1522856003-26861-2-git-send-email-thuth@redhat.com> In-Reply-To: <1522856003-26861-1-git-send-email-thuth@redhat.com> References: <1522856003-26861-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 04 Apr 2018 15:33:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 04 Apr 2018 15:33:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH for-2.13 1/2] net: Get rid of 'vlan' terminology and use 'hub' instead in the source files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 'vlan' is very confusing since it does not mean something like IEEE 802.1Q, but rather emulated hubs, so let's switch to that terminology instead. Buglink: https://bugs.launchpad.net/qemu/+bug/658904 Signed-off-by: Thomas Huth --- hw/core/qdev-properties-system.c | 18 +++++++++--------- include/hw/qdev-properties.h | 6 +++--- include/net/net.h | 2 +- net/hub.c | 4 ++-- net/net.c | 2 +- net/slirp.c | 8 ++++---- net/tap.c | 4 ++-- qapi/net.json | 10 +++++----- qemu-options.hx | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 1d3ba72..704129e 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -321,9 +321,9 @@ const PropertyInfo qdev_prop_netdev =3D { .set =3D set_netdev, }; =20 -/* --- vlan --- */ +/* --- hub --- */ =20 -static int print_vlan(DeviceState *dev, Property *prop, char *dest, size_t= len) +static int print_hub(DeviceState *dev, Property *prop, char *dest, size_t = len) { NetClientState **ptr =3D qdev_get_prop_ptr(dev, prop); =20 @@ -337,7 +337,7 @@ static int print_vlan(DeviceState *dev, Property *prop,= char *dest, size_t len) return snprintf(dest, len, ""); } =20 -static void get_vlan(Object *obj, Visitor *v, const char *name, void *opaq= ue, +static void get_hub(Object *obj, Visitor *v, const char *name, void *opaqu= e, Error **errp) { DeviceState *dev =3D DEVICE(obj); @@ -355,7 +355,7 @@ static void get_vlan(Object *obj, Visitor *v, const cha= r *name, void *opaque, visit_type_int32(v, name, &id, errp); } =20 -static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaq= ue, +static void set_hub(Object *obj, Visitor *v, const char *name, void *opaqu= e, Error **errp) { DeviceState *dev =3D DEVICE(obj); @@ -394,12 +394,12 @@ static void set_vlan(Object *obj, Visitor *v, const c= har *name, void *opaque, *ptr =3D hubport; } =20 -const PropertyInfo qdev_prop_vlan =3D { +const PropertyInfo qdev_prop_hub =3D { .name =3D "int32", - .description =3D "Integer VLAN id to connect to", - .print =3D print_vlan, - .get =3D get_vlan, - .set =3D set_vlan, + .description =3D "Integer hub id to connect to", + .print =3D print_hub, + .get =3D get_hub, + .set =3D set_hub, }; =20 void qdev_prop_set_drive(DeviceState *dev, const char *name, diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index b2ad8e9..dbc1802 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -29,7 +29,7 @@ extern const PropertyInfo qdev_prop_bios_chs_trans; extern const PropertyInfo qdev_prop_fdc_drive_type; extern const PropertyInfo qdev_prop_drive; extern const PropertyInfo qdev_prop_netdev; -extern const PropertyInfo qdev_prop_vlan; +extern const PropertyInfo qdev_prop_hub; extern const PropertyInfo qdev_prop_pci_devfn; extern const PropertyInfo qdev_prop_blocksize; extern const PropertyInfo qdev_prop_pci_host_devaddr; @@ -195,8 +195,8 @@ extern const PropertyInfo qdev_prop_off_auto_pcibar; DEFINE_PROP(_n, _s, _f, qdev_prop_string, char*) #define DEFINE_PROP_NETDEV(_n, _s, _f) \ 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_HUB(_n, _s, _f) \ + DEFINE_PROP(_n, _s, _f, qdev_prop_hub, NICPeers) #define DEFINE_PROP_DRIVE(_n, _s, _f) \ DEFINE_PROP(_n, _s, _f, qdev_prop_drive, BlockBackend *) #define DEFINE_PROP_MACADDR(_n, _s, _f) \ diff --git a/include/net/net.h b/include/net/net.h index 1f7341e..f903465 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -37,7 +37,7 @@ typedef struct NICConf { =20 #define DEFINE_NIC_PROPERTIES(_state, _conf) \ DEFINE_PROP_MACADDR("mac", _state, _conf.macaddr), \ - DEFINE_PROP_VLAN("vlan", _state, _conf.peers), \ + DEFINE_PROP_HUB("vlan", _state, _conf.peers), \ DEFINE_PROP_NETDEV("netdev", _state, _conf.peers) =20 =20 diff --git a/net/hub.c b/net/hub.c index 5e84a9a..fbf0f76 100644 --- a/net/hub.c +++ b/net/hub.c @@ -345,10 +345,10 @@ void net_hub_check_clients(void) } } 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) { - warn_report("vlan %d is not connected to host network", hub->i= d); + warn_report("hub %d is not connected to host network", hub->id= ); } } } diff --git a/net/net.c b/net/net.c index 29f8398..c164795 100644 --- a/net/net.c +++ b/net/net.c @@ -1365,7 +1365,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 * 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 * disconnected mode. For now maintain this compatibility. */ diff --git a/net/slirp.c b/net/slirp.c index 8991816..6922524 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -415,7 +415,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const cha= r *hub_id, if (hub_id) { nc =3D net_hub_find_client_by_name(strtol(hub_id, NULL, 0), na= me); if (!nc) { - monitor_printf(mon, "unrecognized (vlan-id, stackname) pai= r\n"); + monitor_printf(mon, "unrecognized (hub-id, stackname) pair= \n"); return NULL; } } else { @@ -870,9 +870,9 @@ void hmp_info_usernet(Monitor *mon, const QDict *qdict) =20 QTAILQ_FOREACH(s, &slirp_stacks, entry) { int id; - bool got_vlan_id =3D net_hub_id_for_client(&s->nc, &id) =3D=3D 0; - monitor_printf(mon, "VLAN %d (%s):\n", - got_vlan_id ? id : -1, + bool got_hub_id =3D net_hub_id_for_client(&s->nc, &id) =3D=3D 0; + monitor_printf(mon, "Hub %d (%s):\n", + got_hub_id ? id : -1, s->nc.name); slirp_connection_info(s->slirp, mon); } diff --git a/net/tap.c b/net/tap.c index 2b3a36f..de05f20 100644 --- a/net/tap.c +++ b/net/tap.c @@ -766,10 +766,10 @@ int net_init_tap(const Netdev *netdev, const char *na= me, queues =3D tap->has_queues ? tap->queues : 1; vhostfdname =3D tap->has_vhostfd ? tap->vhostfd : NULL; =20 - /* QEMU vlans does not support multiqueue tap, in this case peer is se= t. + /* QEMU hubs do not support multiqueue tap, in this case peer is set. * For -netdev, peer is always NULL. */ 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; } =20 diff --git a/qapi/net.json b/qapi/net.json index 9117c56..3929d70 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -209,7 +209,7 @@ ## # @NetdevTapOptions: # -# Connect the host TAP network interface name to the VLAN. +# Used to configure a host TAP network interface backend. # # @ifname: interface name # @@ -267,8 +267,8 @@ ## # @NetdevSocketOptions: # -# Connect the VLAN to a remote VLAN in another QEMU virtual machine using = a TCP -# socket connection. +# Used to establish a network connection to another QEMU virtual machine +# using a TCP socket connection. # # @fd: file descriptor of an already opened socket # @@ -296,7 +296,7 @@ ## # @NetdevL2TPv3Options: # -# Connect the VLAN to Ethernet over L2TPv3 Static tunnel +# Configure an Ethernet over L2TPv3 Static tunnel # # @src: source address # @@ -352,7 +352,7 @@ ## # @NetdevVdeOptions: # -# Connect the VLAN to a vde switch running on the host. +# Connect to a vde switch running on the host. # # @sock: socket path # diff --git a/qemu-options.hx b/qemu-options.hx index 3ece30d..b85c2ab 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2003,7 +2003,7 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, " configure a vhost-user network, backed by a chardev '= dev'\n" #endif "-netdev hubport,id=3Dstr,hubid=3Dn[,netdev=3Dnd]\n" - " configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_A= LL) + " configure a hub port on the hub with ID 'n'\n", QEMU_= ARCH_ALL) DEF("nic", HAS_ARG, QEMU_OPTION_nic, "--nic [tap|bridge|" #ifdef CONFIG_SLIRP @@ -2030,8 +2030,8 @@ DEF("nic", HAS_ARG, QEMU_OPTION_nic, DEF("net", HAS_ARG, QEMU_OPTION_net, "-net nic[,vlan=3Dn][,netdev=3Dnd][,macaddr=3Dmac][,model=3Dtype][,nam= e=3Dstr][,addr=3Dstr][,vectors=3Dv]\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" - " NICs please use '-device devtype,netdev=3Dnd' instead= )\n" + " connect it either to hub (a.k.a. vlan) 'n' or the net= dev 'nd' (for\n" + " pluggable NICs please use '-device devtype,netdev=3Dn= d' instead)\n" "-net [" #ifdef CONFIG_SLIRP "user|" --=20 1.8.3.1 From nobody Thu May 2 21:35:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522856148250471.6364378834314; Wed, 4 Apr 2018 08:35:48 -0700 (PDT) Received: from localhost ([::1]:38243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3kRs-00018U-4D for importer@patchew.org; Wed, 04 Apr 2018 11:35:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3kPt-0008NW-JF for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3kPn-0005qy-FI for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42148 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3kPn-0005qA-A1 for qemu-devel@nongnu.org; Wed, 04 Apr 2018 11:33:35 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 832DA403B1E7; Wed, 4 Apr 2018 15:33:34 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3AEE2024CA2; Wed, 4 Apr 2018 15:33:32 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Jason Wang Date: Wed, 4 Apr 2018 17:33:23 +0200 Message-Id: <1522856003-26861-3-git-send-email-thuth@redhat.com> In-Reply-To: <1522856003-26861-1-git-send-email-thuth@redhat.com> References: <1522856003-26861-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 15:33:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 15:33:34 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH for-2.13 2/2] net: Get rid of 'vlan' terminology and use 'hub' instead in the doc files X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 'vlan' is very confusing since it does not mean something like IEEE 802.1Q, but rather emulated hubs, so let's switch to that terminology instead. While we're at it, move the subsection about hub a little bit downward in the documentation (it's not as important anymore as it was before the invention of the -netdev parameter), and extend it a little bit. Buglink: https://bugs.launchpad.net/qemu/+bug/658904 Signed-off-by: Thomas Huth --- docs/qdev-device-use.txt | 4 ++-- qemu-doc.texi | 41 ++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt index 8f188d1..0f95425 100644 --- a/docs/qdev-device-use.txt +++ b/docs/qdev-device-use.txt @@ -277,8 +277,8 @@ devices and ne2k_isa are. =20 Some PCI devices aren't available with -net nic, e.g. i82558a. =20 -To connect to a VLAN instead of an ordinary host part, replace -netdev=3DNET-ID by vlan=3DVLAN. +To connect to a hub instead of an ordinary host part, replace +netdev=3DNET-ID by vlan=3DHUB-ID. =20 =3D=3D=3D Graphics Devices =3D=3D=3D =20 diff --git a/qemu-doc.texi b/qemu-doc.texi index 89fa805..db7edb3 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -713,20 +713,12 @@ state is not saved or restored properly (in particula= r USB). @node pcsys_network @section Network emulation =20 -QEMU can simulate several network cards (PCI or ISA cards on the PC -target) and can connect them to an arbitrary number of Virtual Local -Area Networks (VLANs). Host TAP devices can be connected to any QEMU -VLAN. VLAN can be connected between separate instances of QEMU to -simulate large networks. For simpler usage, a non privileged user mode -network stack can replace the TAP device to have a basic network -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). +QEMU can simulate several network cards (e.g. PCI or ISA cards on the PC +target) and can connect them to a network backend on the host or an emulat= ed +hub. The various host network backends can either be used to connect the N= IC of +the guest to a real network (e.g. by using a TAP devices or the non-privil= eged +user mode network stack), or to other guest instances running in another Q= EMU +process (e.g. by using the socket host network backend). =20 @subsection Using TAP network interfaces =20 @@ -762,7 +754,7 @@ network). The virtual network configuration is the foll= owing: =20 @example =20 - QEMU VLAN <------> Firewall/DHCP server <-----> Internet + guest (10.0.2.15) <------> Firewall/DHCP server <-----> Internet | (10.0.2.2) | ----> DNS server (10.0.2.3) @@ -797,11 +789,22 @@ When using the @option{'-netdev user,hostfwd=3D...'} = option, TCP or UDP connections can be redirected from the host to the guest. It allows for example to redirect X11, telnet or SSH connections. =20 -@subsection Connecting VLANs between QEMU instances +@subsection Hubs + +QEMU can simulate several hubs. A hub can be symbolised as a virtual conne= ction +between several network devices. These devices can be for example QEMU vir= tual +ethernet cards or virtual Host ethernet devices (TAP devices). You can con= nect +guest NICs or host network backends to such a hub using the @option{-netdev +hubport} or @option{-nic hubport} options, or by using the @var{vlan=3DHUB= -ID} +parameter of the legacy @option{-net} option. + +@subsection Connecting emulated networks between QEMU instances =20 -Using the @option{-net socket} option, it is possible to make VLANs -that span several QEMU instances. See @ref{sec_invocation} to have a -basic example. +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. =20 @node pcsys_other_devs @section Other Devices --=20 1.8.3.1