]> xenbits.xensource.com Git - libvirt.git/commitdiff
Make umlConnectTapDevice ask brAddTap for a persistent tap device.
authorSoren Hansen <soren@linux2go.dk>
Thu, 12 Aug 2010 13:06:34 +0000 (15:06 +0200)
committerEric Blake <eblake@redhat.com>
Sat, 14 Aug 2010 16:53:25 +0000 (10:53 -0600)
This patch does two things:

 * It makes umlConnectTapDevice ask brAddTap for a persistent tap by
   passing it a NULL tapfd argument.
 * Stops umlConnectTapDevice from immediately dismantling the bridge
   it just set up.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
src/uml/uml_conf.c

index 0cb5ba08fbd330f04c9184ffe2e8e9c097bf051f..42193e4e25033eb5a8592b95fcbd7cd7dacaf61c 100644 (file)
@@ -112,7 +112,6 @@ umlConnectTapDevice(virDomainNetDefPtr net,
                     const char *bridge)
 {
     brControl *brctl = NULL;
-    int tapfd = -1;
     int template_ifname = 0;
     int err;
     unsigned char tapmac[VIR_MAC_BUFLEN];
@@ -140,7 +139,7 @@ umlConnectTapDevice(virDomainNetDefPtr net,
                         &net->ifname,
                         tapmac,
                         0,
-                        &tapfd))) {
+                        NULL))) {
         if (err == ENOTSUP) {
             /* In this particular case, give a better diagnostic. */
             umlReportError(VIR_ERR_INTERNAL_ERROR,
@@ -164,7 +163,6 @@ umlConnectTapDevice(virDomainNetDefPtr net,
             VIR_FREE(net->ifname);
         goto error;
     }
-    close(tapfd);
 
     brShutdown(brctl);