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

[libvirt] [PATCH 1/3] Revert "qemu domain allow to set ip address, peer address and route"



This reverts commit 6e244c659fb004503fd2a94319dae8fa6fecf045, which
added support to qemu for the "peer" attribute in domain interface <ip>
elements.

It's being removed temporarily for the release of libvirt 1.3.4
because the feature doesn't work, and there are concerns that it may
need to be modified in an externally visible manner which could create
backward compatibility problems.

 Conflicts:
   tests/qemuxml2argvmock.c - a mock of virNetDevSetOnline() was added
   which may be assumed by other tests added since the original commit,
   so it isn't being reverted.
---
 src/qemu/qemu_interface.c | 41 +----------------------------------------
 1 file changed, 1 insertion(+), 40 deletions(-)

diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index a4e9d86..ef789fa 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -411,7 +411,6 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def,
     bool template_ifname = false;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
     const char *tunpath = "/dev/net/tun";
-    size_t i;
 
     if (net->backend.tap) {
         tunpath = net->backend.tap;
@@ -448,45 +447,6 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def,
     if (virNetDevSetMAC(net->ifname, &tapmac) < 0)
         goto cleanup;
 
-    for (i = 0; i < net->nips; i++) {
-        virDomainNetIpDefPtr ip = net->ips[i];
-        unsigned int prefix = (ip->prefix > 0) ? ip->prefix :
-            VIR_SOCKET_ADDR_DEFAULT_PREFIX;
-        char *ipStr = virSocketAddrFormat(&ip->address);
-
-        VIR_DEBUG("Adding IP address '%s/%u' to '%s'",
-                  ipStr, ip->prefix, net->ifname);
-
-        if (virNetDevSetIPAddress(net->ifname, &ip->address, &ip->peer, prefix) < 0) {
-            virReportError(VIR_ERR_SYSTEM_ERROR,
-                           _("Failed to set IP address '%s' on %s"),
-                           ipStr, net->ifname);
-            VIR_FREE(ipStr);
-            goto cleanup;
-        }
-        VIR_FREE(ipStr);
-    }
-
-    if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP ||
-        net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT) {
-        if (virNetDevSetOnline(net->ifname, true) < 0)
-            goto cleanup;
-
-        /* Set the routes */
-        for (i = 0; i < net->nroutes; i++) {
-            virNetworkRouteDefPtr route = net->routes[i];
-
-            if (virNetDevAddRoute(net->ifname,
-                                  virNetworkRouteDefGetAddress(route),
-                                  virNetworkRouteDefGetPrefix(route),
-                                  virNetworkRouteDefGetGateway(route),
-                                  virNetworkRouteDefGetMetric(route)) < 0) {
-                goto cleanup;
-            }
-        }
-    }
-
-
     if (net->script &&
         virNetDevRunEthernetScript(net->ifname, net->script) < 0)
         goto cleanup;
@@ -506,6 +466,7 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def,
 
  cleanup:
     if (ret < 0) {
+        size_t i;
         for (i = 0; i < tapfdSize && tapfd[i] >= 0; i++)
             VIR_FORCE_CLOSE(tapfd[i]);
         if (template_ifname)
-- 
2.5.5


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