Re: Release of libvirt-0.4.1

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

 



On Wed, Mar 12, 2008 at 01:38:05PM +0100, Guido G?nther wrote:
> On Fri, Mar 07, 2008 at 04:23:13PM +0100, Guido Günther wrote:
> > Hi Daniel.
> > On Mon, Mar 03, 2008 at 10:13:12AM -0500, Daniel Veillard wrote:
> > >   It was really time for a new release, quite a lot of patches had accumulated
> > > since the previous one ! Available at 
> > >     ftp://libvirt.org/libvirt
> > Cool thing! Unfortunatley this release breaks kvm/qemu bridged
> > networking for me. Namely this commmit:
> > 
> >  936dd984eed33813aa69b0377dd46a9ad1e9e014
> >  Set MAC address on TUN device for Xenner compatability
> > 
> > With this applied the vm never sees the dhcp offer from the DHCP
> > server.  When I revert the patch, everything is fine again.
> No comments? This is the part of code I've reverted. Didn't find the
> time to track down the problem for real:

The setting of MAC address was done to help Xenner detect correct TAP
interface. This patch instead explicitly passes the interface name to
Xenner. A corresponding patch to Xenner makes it honour the ifname=
parameter.

Dan.

Index: src/bridge.c
===================================================================
RCS file: /data/cvs/libvirt/src/bridge.c,v
retrieving revision 1.9
diff -u -p -r1.9 bridge.c
--- src/bridge.c	28 Feb 2008 01:23:14 -0000	1.9
+++ src/bridge.c	12 Mar 2008 18:39:28 -0000
@@ -313,7 +313,6 @@ brDeleteInterface(brControl *ctl ATTRIBU
 int
 brAddTap(brControl *ctl,
          const char *bridge,
-         unsigned char *macaddr,
          char *ifname,
          int maxlen,
          int *tapfd)
@@ -357,18 +356,6 @@ brAddTap(brControl *ctl,
         }
 
         if (ioctl(fd, TUNSETIFF, &try) == 0) {
-            struct ifreq addr;
-            memset(&addr, 0, sizeof(addr));
-            memcpy(addr.ifr_hwaddr.sa_data, macaddr, 6);
-            addr.ifr_hwaddr.sa_family = ARPHRD_ETHER;
-
-            /* Device actually starts in 'UP' state, but it
-             * needs to be down to set the MAC addr
-             */
-            if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 0)))
-                goto error;
-            if (ioctl(fd, SIOCSIFHWADDR, &addr) != 0)
-                goto error;
             if ((errno = brAddInterface(ctl, bridge, try.ifr_name)))
                 goto error;
             if ((errno = brSetInterfaceUp(ctl, try.ifr_name, 1)))
Index: src/bridge.h
===================================================================
RCS file: /data/cvs/libvirt/src/bridge.h,v
retrieving revision 1.5
diff -u -p -r1.5 bridge.h
--- src/bridge.h	28 Feb 2008 01:23:14 -0000	1.5
+++ src/bridge.h	12 Mar 2008 18:39:28 -0000
@@ -62,7 +62,6 @@ int     brDeleteInterface       (brContr
 
 int     brAddTap                (brControl *ctl,
                                  const char *bridge,
-                                 unsigned char *mac,
                                  char *ifname,
                                  int maxlen,
                                  int *tapfd);
Index: src/qemu_conf.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_conf.c,v
retrieving revision 1.41
diff -u -p -r1.41 qemu_conf.c
--- src/qemu_conf.c	3 Mar 2008 18:11:16 -0000	1.41
+++ src/qemu_conf.c	12 Mar 2008 18:39:29 -0000
@@ -1533,7 +1533,6 @@ qemudNetworkIfaceConnect(virConnectPtr c
     }
 
     if ((err = brAddTap(driver->brctl, brname,
-                        net->mac,
                         ifname, BR_IFNAME_MAXLEN, &tapfd))) {
         qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
                          "Failed to add tap interface '%s' to bridge '%s' : %s",
@@ -1541,7 +1540,9 @@ qemudNetworkIfaceConnect(virConnectPtr c
         goto error;
     }
 
-    snprintf(tapfdstr, sizeof(tapfdstr), "tap,fd=%d,script=,vlan=%d", tapfd, vlan);
+    snprintf(tapfdstr, sizeof(tapfdstr),
+             "tap,fd=%d,script=,vlan=%d,ifname=%s",
+             tapfd, vlan, ifname);
 
     if (!(retval = strdup(tapfdstr)))
         goto no_memory;


-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]