]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "conf: allow setting peer address in <ip> element of <interface>"
authorJán Tomko <jtomko@redhat.com>
Mon, 27 Jun 2016 09:56:17 +0000 (11:56 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 27 Jun 2016 10:54:55 +0000 (12:54 +0200)
This reverts commit 93135abf1454d8a1c8542e8c951ed615305ffa24.

This feature was accidentally pushed in the feature freeze.

docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/util/virnetdevip.h

index 2466df735d6ace47fda93480a1d5f9d29f771ec4..f660aa685c34cbdfae5ca027a2700d33154fe643 100644 (file)
@@ -4967,7 +4967,6 @@ qemu-kvm -net nic,model=? /dev/null
       &lt;source network='default'/&gt;
       &lt;target dev='vnet0'/&gt;
       <b>&lt;ip address='192.168.122.5' prefix='24'/&gt;</b>
-      <b>&lt;ip address='192.168.122.5' prefix='24' peer='10.0.0.10'/&gt;</b>
       <b>&lt;route family='ipv4' address='192.168.122.0' prefix='24' gateway='192.168.122.1'/&gt;</b>
       <b>&lt;route family='ipv4' address='192.168.122.8' gateway='192.168.122.1'/&gt;</b>
     &lt;/interface&gt;
@@ -4986,30 +4985,21 @@ qemu-kvm -net nic,model=? /dev/null
 </pre>
 
     <p>
-      <span class="since">Since 1.2.12</span> network devices and
-      hostdev devices with network capabilities can optionally be provided
-      one or more IP addresses to set on the network device in the
-      guest. Note that some hypervisors or network device types will
-      simply ignore them or only use the first one.
-      The <code>family</code> attribute can be set to
-      either <code>ipv4</code> or <code>ipv6</code>, and the
-      <code>address</code> attribute contains the IP address. The
-      optional <code>prefix</code> is the number of 1 bits in the
-      netmask, and will be automatically set if not specified - for
-      IPv4 the default prefix is determined according to the network
-      "class" (A, B, or C - see RFC870), and for IPv6 the default
-      prefix is 64. The optional <code>peer</code> attribute holds the
-      IP address of the other end of a point-to-point network
-      device <span class="since">(since 2.0.0)</span>.
-    </p>
-
-    <p>
-    <span class="since">Since 1.2.12</span> route elements can also be
-    added to define IP routes to add in the guest.  The attributes of
-    this element are described in the documentation for
-    the <code>route</code> element
-    in <a href="formatnetwork.html#elementsStaticroute">network
-    definitions</a>.  This is used by the LXC driver.
+    <span class="since">Since 1.2.12</span> the network devices and host devices
+    with network capabilities can be provided zero or more IP addresses to set
+    on the target device. Note that some hypervisors or network device types
+    will simply ignore them or only use the first one. The <code>family</code>
+    attribute can be set to either <code>ipv4</code> or <code>ipv6</code>, the
+    <code>address</code> attribute holds the IP address. The <code>prefix</code>
+    is not mandatory since some hypervisors do not handle it.
+    </p>
+
+    <p>
+    <span class="since">Since 1.2.12</span> route elements can also be added
+    to define the network routes to use for the network device. The attributes
+    of this element are described in the documentation for the <code>route</code>
+    element in <a href="formatnetwork.html#elementsStaticroute">network definitions</a>.
+    This is only used by the LXC driver.
     </p>
 
     <h5><a name="elementVhostuser">vhost-user interface</a></h5>
index 2d12da95e3f6cf269ff43ed141c4685d3c73bb32..563cb3c43781b0762b90237895370d4ceed386be 100644 (file)
             <ref name="ipPrefix"/>
           </attribute>
         </optional>
-        <optional>
-          <attribute name="peer">
-            <ref name="ipAddr"/>
-          </attribute>
-        </optional>
         <empty/>
       </element>
     </zeroOrMore>
index 3a81f7e2aaa813a17af217c7318b1e354aa39cb3..ef266afae7e28d767a5597ea1a753368a423263b 100644 (file)
@@ -6121,7 +6121,7 @@ virDomainNetIPParseXML(xmlNodePtr node)
     unsigned int prefixValue = 0;
     char *familyStr = NULL;
     int family = AF_UNSPEC;
-    char *address = NULL, *peer = NULL;
+    char *address = NULL;
 
     if (!(address = virXMLPropString(node, "address"))) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
@@ -6159,13 +6159,6 @@ virDomainNetIPParseXML(xmlNodePtr node)
     }
     ip->prefix = prefixValue;
 
-    if ((peer = virXMLPropString(node, "peer")) != NULL &&
-        virSocketAddrParse(&ip->peer, peer, family) < 0) {
-        virReportError(VIR_ERR_INVALID_ARG,
-                       _("Invalid peer '%s' in <ip>"), peer);
-        goto cleanup;
-    }
-
     ret = ip;
     ip = NULL;
 
@@ -6173,7 +6166,6 @@ virDomainNetIPParseXML(xmlNodePtr node)
     VIR_FREE(prefixStr);
     VIR_FREE(familyStr);
     VIR_FREE(address);
-    VIR_FREE(peer);
     VIR_FREE(ip);
     return ret;
 }
@@ -20272,12 +20264,6 @@ virDomainNetIPInfoFormat(virBufferPtr buf,
             virBufferAsprintf(buf, " family='%s'", familyStr);
         if (def->ips[i]->prefix)
             virBufferAsprintf(buf, " prefix='%u'", def->ips[i]->prefix);
-        if (VIR_SOCKET_ADDR_VALID(&def->ips[i]->peer)) {
-            if (!(ipStr = virSocketAddrFormat(&def->ips[i]->peer)))
-                return -1;
-            virBufferAsprintf(buf, " peer='%s'", ipStr);
-            VIR_FREE(ipStr);
-        }
         virBufferAddLit(buf, "/>\n");
     }
 
index 8277654033665650a8bdc1941a4671cbbbe17d75..86fb77e28536290298ad98ef5bbe7665ffa063fe 100644 (file)
@@ -26,9 +26,8 @@
 # include "virsocketaddr.h"
 
 typedef struct {
-    virSocketAddr address; /* ipv4 or ipv6 address */
-    virSocketAddr peer;    /* ipv4 or ipv6 address of peer */
-    unsigned int prefix;   /* number of 1 bits in the netmask */
+    virSocketAddr address;       /* ipv4 or ipv6 address */
+    unsigned int prefix; /* number of 1 bits in the net mask */
 } virNetDevIPAddr, *virNetDevIPAddrPtr;
 
 typedef struct {