qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 5/5] Rework ipv6 options


From: Samuel Thibault
Subject: [Qemu-devel] [PULL 5/5] Rework ipv6 options
Date: Tue, 29 Mar 2016 01:28:24 +0200

Rename the recently-added ip6-foo options into ipv6-foo options, to make
them coherent with other ipv6 options.

Also rework the documentation.

Signed-off-by: Samuel Thibault <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
 net/net.c        | 16 ++++++++--------
 net/slirp.c      |  6 +++---
 qapi-schema.json | 25 ++++++++++++++++---------
 qemu-options.hx  | 18 ++++++++++--------
 4 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/net/net.c b/net/net.c
index 1a78edf..60ad9e6 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1051,33 +1051,33 @@ int net_client_init(QemuOpts *opts, int is_netdev, 
Error **errp)
     Visitor *v = opts_get_visitor(ov);
 
     {
-        /* Parse convenience option format ip6-net=fec0::0[/64] */
-        const char *ip6_net = qemu_opt_get(opts, "ip6-net");
+        /* Parse convenience option format ipv6-net=fec0::0[/64] */
+        const char *ip6_net = qemu_opt_get(opts, "ipv6-net");
 
         if (ip6_net) {
             char buf[strlen(ip6_net) + 1];
 
             if (get_str_sep(buf, sizeof(buf), &ip6_net, '/') < 0) {
                 /* Default 64bit prefix length.  */
-                qemu_opt_set(opts, "ip6-prefix", ip6_net, &error_abort);
-                qemu_opt_set_number(opts, "ip6-prefixlen", 64, &error_abort);
+                qemu_opt_set(opts, "ipv6-prefix", ip6_net, &error_abort);
+                qemu_opt_set_number(opts, "ipv6-prefixlen", 64, &error_abort);
             } else {
                 /* User-specified prefix length.  */
                 unsigned long len;
                 int err;
 
-                qemu_opt_set(opts, "ip6-prefix", buf, &error_abort);
+                qemu_opt_set(opts, "ipv6-prefix", buf, &error_abort);
                 err = qemu_strtoul(ip6_net, NULL, 10, &len);
 
                 if (err) {
                     error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
-                              "ip6-prefix", "a number");
+                              "ipv6-prefix", "a number");
                 } else {
-                    qemu_opt_set_number(opts, "ip6-prefixlen", len,
+                    qemu_opt_set_number(opts, "ipv6-prefixlen", len,
                                         &error_abort);
                 }
             }
-            qemu_opt_unset(opts, "ip6-net");
+            qemu_opt_unset(opts, "ipv6-net");
         }
     }
 
diff --git a/net/slirp.c b/net/slirp.c
index 95239bc..0013c27 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -828,10 +828,10 @@ int net_init_slirp(const NetClientOptions *opts, const 
char *name,
     net_init_slirp_configs(user->guestfwd, 0);
 
     ret = net_slirp_init(peer, "user", name, user->q_restrict, vnet,
-                         user->host, user->ip6_prefix, user->ip6_prefixlen,
-                         user->ip6_host, user->hostname, user->tftp,
+                         user->host, user->ipv6_prefix, user->ipv6_prefixlen,
+                         user->ipv6_host, user->hostname, user->tftp,
                          user->bootfile, user->dhcpstart,
-                         user->dns, user->ip6_dns, user->smb,
+                         user->dns, user->ipv6_dns, user->smb,
                          user->smbserver, dnssearch);
 
     while (slirp_configs) {
diff --git a/qapi-schema.json b/qapi-schema.json
index 7f8d799..8907790 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -2427,7 +2427,10 @@
 #
 # @ip: #optional legacy parameter, use net= instead
 #
-# @net: #optional IP address and optional netmask
+# @net: #optional IP network address that the guest will see, in the
+#       form addr[/netmask] The netmask is optional, and can be
+#       either in the form a.b.c.d or as a number of valid top-most
+#       bits. Default is 10.0.2.0/24.
 #
 # @host: #optional guest-visible address of the host
 #
@@ -2443,13 +2446,17 @@
 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
 #             to the guest
 #
-# @ip6-prefix: #optional IPv6 network prefix (default is fec0::) (since 2.6)
+# @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
+#               2.6). The network prefix is given in the usual
+#               hexadecimal IPv6 address notation.
 #
-# @ip6-prefixlen: #optional IPv6 network prefix length (default is 64) (since 
2.6)
+# @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
+#                  (since 2.6)
 #
-# @ip6-host: #optional guest-visible IPv6 address of the host (since 2.6)
+# @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
 #
-# @ip6-dns: #optional guest-visible IPv6 address of the virtual nameserver 
(since 2.6)
+# @ipv6-dns: #optional guest-visible IPv6 address of the virtual
+#            nameserver (since 2.6)
 #
 # @smb: #optional root directory of the built-in SMB server
 #
@@ -2474,10 +2481,10 @@
     '*dhcpstart': 'str',
     '*dns':       'str',
     '*dnssearch': ['String'],
-    '*ip6-prefix':      'str',
-    '*ip6-prefixlen':   'int',
-    '*ip6-host':        'str',
-    '*ip6-dns':         'str',
+    '*ipv6-prefix':      'str',
+    '*ipv6-prefixlen':   'int',
+    '*ipv6-host':        'str',
+    '*ipv6-dns':         'str',
     '*smb':       'str',
     '*smbserver': 'str',
     '*hostfwd':   ['String'],
diff --git a/qemu-options.hx b/qemu-options.hx
index b98fa3e..09162f5 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1551,9 +1551,9 @@ DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
 
 DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
 #ifdef CONFIG_SLIRP
-    "-netdev user,id=str[,net=addr[/mask]][,host=addr][,ip6-net=addr[/int]]\n"
-    "         
[,ip6-host=addr][,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
-    "         [,dns=addr][,ip6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
+    "-netdev user,id=str[,net=addr[/mask]][,host=addr][,ipv6-net=addr[/int]]\n"
+    "         
[,ipv6-host=addr][,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
+    "         [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
     "         [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
 #ifndef _WIN32
                                              "[,smb=dir[,smbserver=addr]]\n"
@@ -1710,11 +1710,13 @@ either in the form a.b.c.d or as number of valid 
top-most bits. Default is
 Specify the guest-visible address of the host. Default is the 2nd IP in the
 guest network, i.e. x.x.x.2.
 
address@hidden address@hidden/@var{int}]
-Set IPv6 network address the guest will see. Optionally specify the prefix
-size, as number of valid top-most bits. Default is fec0::/64.
address@hidden address@hidden/@var{int}]
+Set IPv6 network address the guest will see (default is fec0::/64). The
+network prefix is given in the usual hexadecimal IPv6 address
+notation. The prefix size is optional, and is given as the number of
+valid top-most bits (default is 64).
 
address@hidden address@hidden
address@hidden address@hidden
 Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
 the guest network, i.e. xxxx::2.
 
@@ -1735,7 +1737,7 @@ Specify the guest-visible address of the virtual 
nameserver. The address must
 be different from the host address. Default is the 3rd IP in the guest network,
 i.e. x.x.x.3.
 
address@hidden address@hidden
address@hidden address@hidden
 Specify the guest-visible address of the IPv6 virtual nameserver. The address
 must be different from the host address. Default is the 3rd IP in the guest
 network, i.e. xxxx::3.
-- 
2.8.0.rc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]