Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Hugh O. Brock
On Mon, Feb 25, 2008 at 05:28:05PM +, Richard W.M. Jones wrote: On Mon, Feb 25, 2008 at 04:49:00PM +, Richard W.M. Jones wrote: [...] Thanks to Jim for pointing me in the right direction here. If you try this patch you'll need to insert memset() calls at the two places indicated

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Richard W.M. Jones
Here's the final version of the 3 arrays version of the patch, with the memory corruptor fixed. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote: Here's the final version of the 3 arrays version of the patch, with the memory corruptor fixed. ... Index: src/qemu_driver.c === RCS file: /data/cvs/libvirt/src/qemu_driver.c,v

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-27 Thread Richard W.M. Jones
On Wed, Feb 27, 2008 at 05:27:33PM +0100, Jim Meyering wrote: Whoops. You'll want to close that file descriptor. E.g., put this right before argv = NULL;: if (close (ret)) return -1; It'd be nice to declare a new variable, say fd, for that bit. Oh yes, that would be a good

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-26 Thread Jim Meyering
Richard W.M. Jones [EMAIL PROTECTED] wrote: This patch is an evolution of the previous patch for implementing DHCP ... +if (maxmappings == 0) return 0; ... +if (col == 0) hwaddr = token; ... +if (!(*hwaddrs)[lines]) goto mem_error; Hi Rich, Is there a

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-26 Thread Richard W.M. Jones
On Tue, Feb 26, 2008 at 11:43:59AM +0100, Jim Meyering wrote: Richard W.M. Jones [EMAIL PROTECTED] wrote: This patch is an evolution of the previous patch for implementing DHCP ... +if (maxmappings == 0) return 0; ... +if (col == 0) hwaddr = token; ... +

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-26 Thread Daniel Veillard
On Tue, Feb 26, 2008 at 12:01:04PM +, Richard W.M. Jones wrote: On Tue, Feb 26, 2008 at 11:43:59AM +0100, Jim Meyering wrote: Richard W.M. Jones [EMAIL PROTECTED] wrote: This patch is an evolution of the previous patch for implementing DHCP ... +if (maxmappings == 0) return 0;

[Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-25 Thread Richard W.M. Jones
This patch is an evolution of the previous patch for implementing DHCP host mappings. The virNetworkListDHCPHostMappings calls has been changed to take three arrays of strings: int virNetworkListDHCPHostMappings (virNetworkPtr network, char **const hwaddrs,

Re: [Libvir] [PATCH] (for discussion) DHCP host mappings using 3 arrays API

2008-02-25 Thread Richard W.M. Jones
On Mon, Feb 25, 2008 at 04:49:00PM +, Richard W.M. Jones wrote: [...] Thanks to Jim for pointing me in the right direction here. If you try this patch you'll need to insert memset() calls at the two places indicated below. That fixes all the problems I can see and it appears to all work