Re: [Libvir] Release of libvirt-0.4.1

2008-03-12 Thread Daniel P. Berrange
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.c28 Feb 2008 01:23:14 -  1.9
+++ src/bridge.c12 Mar 2008 18:39:28 -
@@ -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.h28 Feb 2008 01:23:14 -  1.5
+++ src/bridge.h12 Mar 2008 18:39:28 -
@@ -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 -   1.41
+++ src/qemu_conf.c 12 Mar 2008 18:39:29 -
@@ -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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] Release of libvirt-0.4.1

2008-03-12 Thread Guido Günther
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:

diff --git a/src/bridge.c b/src/bridge.c
index 6626156..caa6ebf 100644
--- a/src/bridge.c
+++ b/src/bridge.c
@@ -357,18 +355,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)))

 -- Guido

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


Re: [Libvir] Release of libvirt-0.4.1

2008-03-07 Thread Guido Günther
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.
Cheers,
 -- Guido

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


[Libvir] Release of libvirt-0.4.1

2008-03-03 Thread Daniel Veillard
  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

* New features:
 - build on MacOSX (Richard Jones)
 - storage management (Daniel Berrange)
 - Xenner - Xen on KVM - support (Daniel Berrange)
* Documentation:
 - Fix of various typos (Atsushi SAKAI)
 - memory and vcpu settings details (Richard Jones)
 - ethernet bridging typo (Maxwell Bottiger)
 - add storage APIs documentation (Daniel Berrange)
* Bug fixes:
 - OpenVZ code compilation (Mikhail Pokidko)
 - crash in policykit auth handling (Daniel Berrange)
 - large config files (Daniel Berrange)
 - cpumap hypercall size (Saori Fukuta)
 - crash in remote auth (Daniel Berrange)
 - ssh args error (Daniel Berrange)
 - preserve vif order from config files (Hiroyuki Kaguchi)
 - invalid pointer access (Jim Meyering)
 - virDomainGetXMLDesc flag handling
 - device name conversion on stats (Daniel Berrange)
 - double mutex lock (Daniel Berrange)
 - config file reading crashes (Guido Guenther)
 - xenUnifiedDomainSuspend bug (Marcus Meissner)
 - do not crash if /sys/hypervisor/capabilities is missing (Mark McLoughlin)
 - virHashRemoveSet bug (Hiroyuki Kaguchi)
 - close-on-exec flag for qemud signal pipe (Daniel Berrange)
 - double free in OpenVZ (Anton Protopopov)
 - handle mac without addresses (Shigeki Sakamoto)
 - MAC addresses checks (Shigeki Sakamoto and Richard Jones)
* Improvements:
 - Windows build (Richard Jones)
 - KVM/QEmu shutdown (Guido Guenther)
 - catch virExec output on debug (Mark McLoughlin)
 - integration of iptables and lokkit (Mark McLoughlin)
 - keymap parameter for VNC servers (Daniel Hokka Zakrisson)
 - enable debug by default using VIR_DEBUG (Daniel Berrange)
 - xen 3.2 fixes (Daniel Berrange)
 - Python bindings for VCPU and scheduling (Daniel Berrange)
 - framework for automatic code syntax checks (Jim Meyering)
 - allow kernel+initrd setup in Xen PV (Daniel Berrange)
 - allow change of Disk/NIC of an inactive domains (Shigeki Sakamoto)
 - virsh commands to manipulate and create storage(Daniel Berrange)
 - update use of PolicyKit APIs
 - better detection of fedault hypervisor
 - block device statistics for QEmu/KVM (Richard Jones)
 - various improvements for Xenner (Daniel Berrange)
* Code cleanups:
 - avoid warnings (Daniel Berrange)
 - virRun helper function (Dan Berrange)
 - iptable code fixes (Mark McLoughlin)
 - static and const cleanups (Jim Meyering)
 - malloc and python cleanups (Jim Meyering)
 - xstrtol_ull and xstrtol_ll functions (Daniel Berrange)
 - remove no-op networking from OpenVZ (Daniel Berrange)
 - python generator cleanups (Daniel Berrange)
 - cleanup ref counting (Daniel Berrange)
 - remove uninitialized warnings (Jim Meyering)
 - cleanup configure for RHEL4 (Daniel Berrange)
 - CR/LF cleanups (Richard Jones)
 - various automatic code check and associated cleanups (Jim Meyering)
 - various memory leaks (Jim Meyering)
 - fix compilation when building without Xen (Guido Guenther)
 - mark translatables strings (Jim Meyering)
 - use virBufferAddLit for constant strings (Jim Meyering)
 - fix make distcheck (Jim Meyering)
 - return values for python bindings (Cole Robinson)
 - trailing blanks fixes (Jim Meyering)
 - gcc-4.3.0 fixes (Mark McLoughlin)
 - use safe read and write routines (Jim Meyering)
 - refactoring of code dealing with hypervisor capabilities (Daniel Berrange)
 - qemudReportError to use virErrorMsg (Cole Robinson)
 - intemediate library and Makefiles for compiling static and coverage rule 
support (Jim Meyering)
 - cleanup of various leaks (Jim Meyering)

  Thanks to everybody who helped by providing code, patches or reporting
 problems !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

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