[libvirt] command line chroot in a VM

2010-09-01 Thread Mihamina Rakotomandimby
Manao ahoana, Hello, Bonjour, From the host, I would like to perform a batch operation on the guests. For example: # virsh list 1 001 2 002 3 003 All guests are KVM, Debian Lenny I want to for GUEST in $(virsh list | awk '{blah blah}') do ? ${GUEST} apt-get update ?

Re: [libvirt] [virt-tools-list] command line chroot in a VM

2010-09-01 Thread Daniel P. Berrange
On Wed, Sep 01, 2010 at 12:08:27PM +0300, Mihamina Rakotomandimby wrote: Manao ahoana, Hello, Bonjour, From the host, I would like to perform a batch operation on the guests. For example: # virsh list 1 001 2 002 3 003 All guests are KVM, Debian Lenny I want to for GUEST

Re: [libvirt] [PATCH] esx: Fix generator for string return values

2010-09-01 Thread Matthias Bolte
2010/8/30 Eric Blake ebl...@redhat.com: On 08/29/2010 05:00 PM, Matthias Bolte wrote: Distinguish between strings as parameters (const char *) and strings as return values (char **). Here, you mention char**,          if self.type == String and \             self.occurrence not in

[libvirt] Next release 0.8.4 proposed schedule

2010-09-01 Thread Daniel Veillard
So it's already September and while back from vacations I didn't yet fully scan all the list for potential patches. Still I'm tempted to try to get a release by the 10 which mean we would enter the freeze this week-end. I guess it would be 0.8.4 since there is no huge feature or change commited

Re: [libvirt] [PATCH] esx: Rework datastore path parsing and handling

2010-09-01 Thread Eric Blake
On 08/26/2010 04:37 PM, Matthias Bolte wrote: Instead of splitting the path part of a datastore path into directory and file name, keep this in one piece. An example: [datastore] directory/file was split into this before: datastoreName = datastore directoryName = directory

Re: [libvirt] [PATCH] esx: Fix generator for string return values

2010-09-01 Thread Eric Blake
On 09/01/2010 09:32 AM, Matthias Bolte wrote: That's a bit tricky. In case Parameter.get_type_string() is called from Parameter.generate_return() then string += %s*%s)%s % (self.get_type_string(), self.name, end_of_line) in line 104 adds the second *. I attached v2 where this is

[libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Cole Robinson
The current code will go into an infinite loop if the printf generated string is = 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually change, because count == (buf-size - buf-use - 1),

[libvirt] [PATCH 0/7] round 2 of sprintf cleanups

2010-09-01 Thread Eric Blake
I don't think all snprintf uses are bad - those that format a number into an appropriately-sized maximum-possible array should be fine. For example, there are some fixed-size buffers whose size is determined by the kernel, where snprintf was the appropriate course of action in

[libvirt] [PATCH 1/7] build: add some modules

2010-09-01 Thread Eric Blake
snprintf is currently implicitly picked up by getaddrinfo, but we might as well make it explicit so that mingw doesn't break if getaddrinfo changes to drop the dependency. func doesn't matter for gcc compilation, but may help other compilers cope with our use of __func__. * bootstrap.conf

[libvirt] [PATCH 6/7] openvz: formatting cleanups

2010-09-01 Thread Eric Blake
* src/openvz/openvz_conf.c: Whitespace fixes. * src/openvz/openvz_driver.c: Likewise. --- Should just be formatting, no content change. openvz has other problems, like its use of popen (totally unsafe); so I'll be fixing it some more when I get to the virCommand patch series.

[libvirt] [PATCH 3/7] vbox: avoid problematic uses of sprintf

2010-09-01 Thread Eric Blake
* src/vbox/vbox_tmpl.c (vboxStartMachine, vboxAttachUSB): Use virAsprintf instead. --- This removes all use of sprintf in vbox. The first 3 use virAsprintf (DISPLAY may be arbitrarily long, and while we are unlikely to hit devices, it's better to be safe than to risk silent buffer

[libvirt] [PATCH 5/7] lxc: avoid large stacks with veth creation

2010-09-01 Thread Eric Blake
* src/lxc/veth.h (vethCreate): Change prototype. * src/lxc/veth.c (vethCreate): Always malloc veth2, and allocate veth1 if needed. (getFreeVethName): Adjust signature, and use virAsprintf. * src/lxc/lxc_driver.c (lxcSetupInterfaces): Adjust caller. --- This issue crossed file boundaries. It was

[libvirt] [PATCH 4/7] network: use virAsprintf when appropriate

2010-09-01 Thread Eric Blake
* src/conf/network_conf.c (virNetworkAllocateBridge): Avoid limited buffer from snprintf. --- Why print to a fixed-width buffer to then just strdup it later, when we can print to a malloc'd buffer in the first place. Besides, I couldn't easily guarantee if the buffer was large enough or if it

[libvirt] [PATCH 7/7] openvz: use virAsprintf to avoid large stacks

2010-09-01 Thread Eric Blake
* src/openvz/openvz_conf.c (openvzLocateConfFile): Alter signature. (openvzGetVPSUUID, openvzSetDefinedUUID) (openvzWriteVPSConfigParam, openvzReadVPSConfigParam) (openvzCopyDefaultConfig): Adjust callers. --- Nuke a few more PATH_MAX stack allocations. src/openvz/openvz_conf.c | 78

Re: [libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Eric Blake
On 09/01/2010 01:43 PM, Cole Robinson wrote: The current code will go into an infinite loop if the printf generated string is= 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually

Re: [libvirt] [PATCH 1/7] build: add some modules

2010-09-01 Thread Matthias Bolte
2010/9/1 Eric Blake ebl...@redhat.com: snprintf is currently implicitly picked up by getaddrinfo, but we might as well make it explicit so that mingw doesn't break if getaddrinfo changes to drop the dependency. func doesn't matter for gcc compilation, but may help other compilers cope with

Re: [libvirt] [PATCH 4/7] network: use virAsprintf when appropriate

2010-09-01 Thread Matthias Bolte
2010/9/1 Eric Blake ebl...@redhat.com: * src/conf/network_conf.c (virNetworkAllocateBridge): Avoid limited buffer from snprintf. --- Why print to a fixed-width buffer to then just strdup it later, when we can print to a malloc'd buffer in the first place.  Besides, I couldn't easily

Re: [libvirt] [PATCH 6/7] openvz: formatting cleanups

2010-09-01 Thread Matthias Bolte
2010/9/1 Eric Blake ebl...@redhat.com: * src/openvz/openvz_conf.c: Whitespace fixes. * src/openvz/openvz_driver.c: Likewise. --- Should just be formatting, no content change. ACK. Matthias -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH] OpenVZ: add ethernet interface type support

2010-09-01 Thread Jean-Baptiste Rouault
Hi, Raising this patch to get a review for a potential inclusion in 0.8.4. Regards, Jean-Baptiste Hi all, This patch adds support for ethernet interface type to OpenVZ domains as stated in this previous message: http://www.redhat.com/archives/libvir- list/2010-July/msg00658.html

Re: [libvirt] [PATCH 7/7] openvz: use virAsprintf to avoid large stacks

2010-09-01 Thread Matthias Bolte
2010/9/1 Eric Blake ebl...@redhat.com: * src/openvz/openvz_conf.c (openvzLocateConfFile): Alter signature. (openvzGetVPSUUID, openvzSetDefinedUUID) (openvzWriteVPSConfigParam, openvzReadVPSConfigParam) (openvzCopyDefaultConfig): Adjust callers. --- Nuke a few more PATH_MAX stack

[libvirt] [PATCH v2] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Cole Robinson
The current code will go into an infinite loop if the printf generated string is = 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually change, because count == (buf-size - buf-use - 1),

Re: [libvirt] [PATCH] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Cole Robinson
On 09/01/2010 04:38 PM, Eric Blake wrote: On 09/01/2010 01:43 PM, Cole Robinson wrote: The current code will go into an infinite loop if the printf generated string is= 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the

Re: [libvirt] [PATCH v2] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Eric Blake
On 09/01/2010 03:41 PM, Cole Robinson wrote: The current code will go into an infinite loop if the printf generated string is= 1000, AND exactly 1 character smaller than the amount of free space in the buffer. When this happens, we are dropped into the loop body, but nothing will actually

Re: [libvirt] [PATCH v2] buf: Fix possible infinite loop in EscapeString, VSnprintf

2010-09-01 Thread Eric Blake
On 09/01/2010 03:41 PM, Cole Robinson wrote: +size = buf-size - buf-use; +if ((count = vsnprintf(buf-content[buf-use], + size, format, argptr)) 0) { +buf-error = 1; +goto err; +} Hmm, thinking about this a bit more, most callers blindly

Re: [libvirt] [PATCH 1/7] build: add some modules

2010-09-01 Thread Eric Blake
On 09/01/2010 03:04 PM, Matthias Bolte wrote: 2010/9/1 Eric Blakeebl...@redhat.com: snprintf is currently implicitly picked up by getaddrinfo, but we might as well make it explicit so that mingw doesn't break if getaddrinfo changes to drop the dependency. func doesn't matter for gcc

Re: [libvirt] [PATCH 7/7] openvz: use virAsprintf to avoid large stacks

2010-09-01 Thread Eric Blake
On 09/01/2010 03:41 PM, Matthias Bolte wrote: 2010/9/1 Eric Blakeebl...@redhat.com: * src/openvz/openvz_conf.c (openvzLocateConfFile): Alter signature. (openvzGetVPSUUID, openvzSetDefinedUUID) (openvzWriteVPSConfigParam, openvzReadVPSConfigParam) (openvzCopyDefaultConfig): Adjust callers. ---

Re: [libvirt] [PATCH 4/7] network: use virAsprintf when appropriate

2010-09-01 Thread Eric Blake
On 09/01/2010 03:20 PM, Matthias Bolte wrote: 2010/9/1 Eric Blakeebl...@redhat.com: * src/conf/network_conf.c (virNetworkAllocateBridge): Avoid limited buffer from snprintf. --- Why print to a fixed-width buffer to then just strdup it later, when we can print to a malloc'd buffer in the first

Re: [libvirt] [PATCH 6/7] openvz: formatting cleanups

2010-09-01 Thread Eric Blake
On 09/01/2010 03:24 PM, Matthias Bolte wrote: 2010/9/1 Eric Blakeebl...@redhat.com: * src/openvz/openvz_conf.c: Whitespace fixes. * src/openvz/openvz_driver.c: Likewise. --- Should just be formatting, no content change. ACK. Thanks; pushed. -- Eric Blake ebl...@redhat.com