]> xenbits.xensource.com Git - libvirt.git/commitdiff
Revert "vhost-user: add support reconnect for vhost-user ports"
authorPavel Hrdina <phrdina@redhat.com>
Wed, 20 Sep 2017 13:59:18 +0000 (15:59 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 27 Sep 2017 10:20:24 +0000 (12:20 +0200)
This reverts commit edaf4ebe95a5995585c8ab7bc5b92887286d4431.

This uses "reconnect" as attribute for <source> element, but we already
have a <reconnect> element for <source> element for chardev devices.

Since this is the same feature for different device it should be
presented in XML the same way.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.xml

index 1602ed3e957aba3fa8dfd619b205ec3608d464a4..9ce4620c65fff719a43730448ee14676a79458ca 100644 (file)
@@ -5673,7 +5673,7 @@ qemu-kvm -net nic,model=? /dev/null
   &lt;/interface&gt;
   &lt;interface type='vhostuser'&gt;
     &lt;mac address='52:54:00:3b:83:1b'/&gt;
-    &lt;source type='unix' path='/tmp/vhost2.sock' mode='client' reconnect='10'/&gt;
+    &lt;source type='unix' path='/tmp/vhost2.sock' mode='client'/&gt;
     &lt;model type='virtio'/&gt;
     &lt;driver queues='5'/&gt;
   &lt;/interface&gt;
@@ -5689,9 +5689,6 @@ qemu-kvm -net nic,model=? /dev/null
       are supported.
       vhost-user requires the virtio model type, thus the
       <code>&lt;model&gt;</code> element is mandatory.
-      <span class="since">Since 3.7.0</span> the element has an optional
-      attribute <code>reconnect</code> which configures reconnect timeout
-      (in seconds) if the connection is lost.
     </p>
 
     <h5><a id="elementNwfilter">Traffic filtering with NWFilter</a></h5>
index 36e2966f21f31b326017900770fee37c2fa430e3..76852abb3c6dd75c57040293b37c0f292e13e9ed 100644 (file)
                   <value>client</value>
                 </choice>
               </attribute>
-              <optional>
-                <attribute name="reconnect">
-                  <ref name='positiveInteger'/>
-                </attribute>
-              </optional>
               <empty/>
             </element>
             <ref name="interface-options"/>
index 3c3db7291387587f68cffabea2d6a2c6a142350a..fd6d3120fc4be47cdc30e3ee43c5e1c74052534f 100644 (file)
@@ -10240,7 +10240,6 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
     char *vhostuser_mode = NULL;
     char *vhostuser_path = NULL;
     char *vhostuser_type = NULL;
-    char *vhostuser_reconnect = NULL;
     char *trustGuestRxFilters = NULL;
     char *vhost_path = NULL;
     virNWFilterHashTablePtr filterparams = NULL;
@@ -10327,12 +10326,11 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                     goto error;
                 }
             } else if (!vhostuser_path && !vhostuser_mode && !vhostuser_type
-                       && !vhostuser_reconnect && def->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER
-                       && virXMLNodeNameEqual(cur, "source")) {
+                       && def->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
+                       virXMLNodeNameEqual(cur, "source")) {
                 vhostuser_type = virXMLPropString(cur, "type");
                 vhostuser_path = virXMLPropString(cur, "path");
                 vhostuser_mode = virXMLPropString(cur, "mode");
-                vhostuser_reconnect = virXMLPropString(cur, "reconnect");
             } else if (!def->virtPortProfile
                        && virXMLNodeNameEqual(cur, "virtualport")) {
                 if (def->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
@@ -10554,24 +10552,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
 
         if (STREQ(vhostuser_mode, "server")) {
             def->data.vhostuser->data.nix.listen = true;
-            if (vhostuser_reconnect) {
-                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                               _("'reconnect' attribute  unsupported "
-                                 "'server' mode for <interface type='vhostuser'>"));
-                goto error;
-            }
         } else if (STREQ(vhostuser_mode, "client")) {
             def->data.vhostuser->data.nix.listen = false;
-            if (vhostuser_reconnect) {
-                def->data.vhostuser->data.nix.reconnect.enabled = true;
-                if (virStrToLong_ui(vhostuser_reconnect, NULL, 10,
-                                    &def->data.vhostuser->data.nix.reconnect.timeout) < 0) {
-                    virReportError(VIR_ERR_INTERNAL_ERROR,
-                                   _("invalid vhostuser reconnect value %s"),
-                                   vhostuser_reconnect);
-                    goto error;
-                }
-            }
         } else {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("Wrong <source> 'mode' attribute "
@@ -11016,7 +10998,6 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
     VIR_FREE(portgroup);
     VIR_FREE(address);
     VIR_FREE(port);
-    VIR_FREE(vhostuser_reconnect);
     VIR_FREE(vhostuser_type);
     VIR_FREE(vhostuser_path);
     VIR_FREE(vhostuser_mode);
@@ -23002,11 +22983,6 @@ virDomainNetDefFormat(virBufferPtr buf,
                 virBufferAsprintf(buf, " mode='%s'",
                                   def->data.vhostuser->data.nix.listen ?
                                   "server"  : "client");
-                if (def->data.vhostuser->data.nix.reconnect.enabled == true) {
-                    virBufferAsprintf(buf, " reconnect='%u'",
-                                      def->data.vhostuser->data.nix.reconnect.timeout);
-                }
-
                 sourceLines++;
             }
             break;
index 996828f7d82b481e0ed0a4720120e6e8cf2f6aad..b69ebd8bad76e16632bdf0931828a162e481d52a 100644 (file)
@@ -32,7 +32,7 @@ addr=0x4 \
 -netdev socket,listen=:2015,id=hostnet2 \
 -device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,\
 addr=0x5 \
--chardev socket,id=charnet3,path=/tmp/vhost2.sock,reconnect=10 \
+-chardev socket,id=charnet3,path=/tmp/vhost2.sock \
 -netdev vhost-user,chardev=charnet3,queues=4,id=hostnet3 \
 -device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,\
 mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6
index 7eb6fa0bbf1aa963bf6ba02e965a7afa41c28722..d5c42fe62cabc914e47ef9d7fad389ead1ad1ca7 100644 (file)
@@ -40,7 +40,7 @@
     </interface>
     <interface type='vhostuser'>
       <mac address='52:54:00:ee:96:6d'/>
-      <source type='unix' path='/tmp/vhost2.sock' mode='client' reconnect='10'/>
+      <source type='unix' path='/tmp/vhost2.sock' mode='client'/>
       <model type='virtio'/>
       <driver queues='4'/>
     </interface>