Re: [libvirt] PATCH: Improve python exception messages

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 12:00:46PM +0100, Daniel P. Berrange wrote: This patch was flawed - it missed out the error message info when passed in a domain/network/volume/pool instead of a connection object. Here is an updated patch which addresses that +1. I added the original '.. failed'

Re: [libvirt] PATCH: Allow specific FDs to be kept open in virExec()

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE() (sysconf(_SC_OPEN_MAX)/8) +#define VIR_EXEC_FDSET_CLEAR(set) memset((set), 0, VIR_EXEC_FDSET_SIZE()) +#define VIR_EXEC_FDSET_ON(set, fd) (set[(fd)/8] |= (1 ((fd)%8))) +#define

Re: [libvirt] [PATCH] autobuild.sh: Fix minor shell-quoting bugs.

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 05:57:37PM +0200, Jim Meyering wrote: I noticed some minor quoting problems in ovirt's autobuild.sh, and since part of that code came from here, ... +1 Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual

Re: [libvirt] PATCH: Allow specific FDs to be kept open in virExec()

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 09:22:06AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE() (sysconf(_SC_OPEN_MAX)/8) +#define VIR_EXEC_FDSET_CLEAR(set) memset((set), 0, VIR_EXEC_FDSET_SIZE()) +#define

Re: [libvirt] [PATCH] Check disk target collision when parsing domain xml

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 11:20:13PM -0400, Cole Robinson wrote: The current domain xml parsing doesn't check if disks are specified with duplicate targets (hda etc.). The attached patch adds a check for this. +1. Rich. -- Richard Jones, Emerging Technologies, Red Hat

Re: [libvirt] [PATCH] Add success output to virsh attach/detach commands

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 09:26:13AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 11:19:29PM -0400, Cole Robinson wrote: The virsh attach-* and detach-* commands don't say anything if the operation succeeds, which doesn't seem very polite. The attached adds some simple feedback.

Re: [libvirt] [PATCH] Set correct device type when parsing input devices

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 11:19:47PM -0400, Cole Robinson wrote: In virDomainDeviceDefParse, parsing an input device was actually setting it's type as DEVICE_DISK. The attached patch fixes this. ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |:

Re: [libvirt] [PATCH] Check disk target collision when parsing domain xml

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 11:20:13PM -0400, Cole Robinson wrote: The current domain xml parsing doesn't check if disks are specified with duplicate targets (hda etc.). The attached patch adds a check for this. Thanks, Cole commit 27df1653474738a2ce83c89e7bdb2c4f7327f9b6 Author: Cole

Re: [libvirt] [PATCH] Fix cd eject segfault

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 11:20:28PM -0400, Cole Robinson wrote: The cdrom eject code was trying to dereference the NULL source of an empty cdrom. Attached patch fixes this. Good catch, +1 Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top'

[libvirt] [PATCH] enable parallel builds

2008-08-22 Thread James Morris
I'm not sure if this is the best way to do this, but it seems to work. Enable parallel compilation of the repository when running the autobuild script and/or via rpmbuild. --- autobuild.sh| 15 ++- libvirt.spec.in |2 +- 2 files changed, 15 insertions(+), 2

Re: [libvirt] [PATCH] Fix cd eject segfault

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 11:20:28PM -0400, Cole Robinson wrote: The cdrom eject code was trying to dereference the NULL source of an empty cdrom. Attached patch fixes this. @@ -2972,6 +2973,13 @@ static int qemudDomainChangeCDROM(virDomainPtr dom, } VIR_FREE(safe_path);

Re: [libvirt] [PATCH] Fix disk device ordering

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 11:21:15PM -0400, Cole Robinson wrote: When parsing the domain xml, disks are supposed to be rearranged in an alphabetic order based on bus type and target. The reordering code had a flaw though, in that it would always put the first disk it encountered at the head of

Re: [libvirt] [PATCH] Fix disk device ordering

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 11:21:15PM -0400, Cole Robinson wrote: When parsing the domain xml, disks are supposed to be rearranged in an alphabetic order based on bus type and target. The reordering code had a flaw though, in that it would always put the first disk it encountered at the head of

Re: [libvirt] [PATCH] Update domain xml after usb hotplug

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 11:21:33PM -0400, Cole Robinson wrote: The recently added usb hostdev and mass storage device hotplug code doesn't append the devices to the running guests xml if the hotplug succeeds. The attached patch fixes this. Yes, completely forgot about this when reviewing it

Re: [libvirt] [PATCH] enable parallel builds

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 06:36:23PM +1000, James Morris wrote: I'm not sure if this is the best way to do this, but it seems to work. Sure, gets my vote. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org

Re: [libvirt] anyone implementing host device enumeration?

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 03:18:57PM -0400, David Lively wrote: Hi - I'm about to start working on host device enumeration, along the (HAL-ish) lines of what was discussed back in April: https://www.redhat.com/archives/libvir-list/2008-April/msg5.html I know the xml details

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 10:29:43AM -0400, David Lively wrote: Hi Folks - Here's my second pass at storage pool discovery. I've taken Daniel's suggestion and made it return a single XML doc containing source elements rather than an array of pool docs (and also incorporated suggestions from

Re: [libvirt] [PATCH] introducing source name (for logical storage pools)

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 10:17:49AM -0400, David Lively wrote: Oops - that was against an old base. Sorry. Here's the new one. Also fixed a few other issues ... Ok, this gets my vote to commit. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |:

Re: [libvirt] [PATCH] Update domain xml after usb hotplug

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 11:21:33PM -0400, Cole Robinson wrote: The recently added usb hostdev and mass storage device hotplug code doesn't append the devices to the running guests xml if the hotplug succeeds. The attached patch fixes this. IIRC there was some question about whether it should

Re: [libvirt] PATCH: Allow specific FDs to be kept open in virExec()

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 10:51:54AM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: On Fri, Aug 22, 2008 at 09:22:06AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE()

Re: [libvirt] [PATCH] configure.in: Prepend -lpthread to LIBS if required.

2008-08-22 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 08:23:21PM +0200, Jim Meyering wrote: Jun Koi [EMAIL PROTECTED] wrote: The latest cvs version has an error when compiling: make[3]: Entering directory `/home/jun/projects/libvirt-0821/src' /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall ...

Re: [libvirt] [PATCH] enable parallel builds

2008-08-22 Thread Jim Meyering
James Morris [EMAIL PROTECTED] wrote: I'm not sure if this is the best way to do this, but it seems to work. Enable parallel compilation of the repository when running the autobuild script and/or via rpmbuild. --- autobuild.sh| 15 ++- libvirt.spec.in |2 +-

RE: [libvirt] Using Xen config files

2008-08-22 Thread Matthew Donovan
Xen and Xen-devel are 3.1.2. I'm using version 0.4.4 of libvirt. -matthew -Original Message- From: Richard W.M. Jones [mailto:[EMAIL PROTECTED] Sent: Friday, August 22, 2008 4:19 AM To: Matthew Donovan Cc: Daniel P. Berrange; libvir-list@redhat.com Subject: Re: [libvirt] Using

Re: [libvirt] [PATCH] Add success output to virsh attach/detach commands

2008-08-22 Thread Cole Robinson
Daniel P. Berrange wrote: On Fri, Aug 22, 2008 at 09:26:13AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 11:19:29PM -0400, Cole Robinson wrote: The virsh attach-* and detach-* commands don't say anything if the operation succeeds, which doesn't seem very polite. The

Re: [libvirt] PATCH: REmove bogus call to virStateInit in openvz driver

2008-08-22 Thread Daniel Veillard
On Tue, Aug 19, 2008 at 02:12:39PM +0100, Daniel P. Berrange wrote: For some unknown reason there is a call to virStateInitialize() in the openvz driver's open method. This is absolutely forbidden - this API is only intended for use by the daemon. This patch removes this bogus call and makes

Re: [libvirt] PATCH: Improve python exception messages

2008-08-22 Thread Daniel Veillard
On Tue, Aug 19, 2008 at 10:31:34AM +0100, Daniel P. Berrange wrote: Most of the libvirt python API bindings use code snippet like this when raising an exception: if ret is None:raise libvirtError('virConnectOpen() failed') THis sets the message associated with the exception to

Re: [libvirt] PATCH: Ensure errors are guarenteed reported in virConnectOpen

2008-08-22 Thread Daniel Veillard
On Tue, Aug 19, 2008 at 11:35:18AM +0100, Daniel P. Berrange wrote: The virConnectOpen method is unfortuantely rather special. While there is a virConnect object available, the current rule is that drivers must report errors against the global error object, because upon failure no virConnect

Re: [libvirt] [PATCH] static ip address

2008-08-22 Thread Daniel Veillard
On Fri, Aug 15, 2008 at 10:43:15AM +0100, Daniel P. Berrange wrote: On Tue, Aug 12, 2008 at 05:24:01PM -0400, Daniel Veillard wrote: New patch with just a pair of minor fixes which seems to work just fine for me. The syntax is nearly the old one, just use host instead of statichost:

Re: [libvirt] anyone implementing host device enumeration?

2008-08-22 Thread Daniel Veillard
On Fri, Aug 22, 2008 at 09:44:47AM +0100, Daniel P. Berrange wrote: On Thu, Aug 21, 2008 at 03:18:57PM -0400, David Lively wrote: Hi - I'm about to start working on host device enumeration, along the (HAL-ish) lines of what was discussed back in April:

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread David Lively
On Fri, 2008-08-22 at 09:50 +0100, Daniel P. Berrange wrote: +const char *start_tag = SourceList\n; +const char *end_tag = /SourceList\n; I'd prefer that to be sources - we avoid capitals in the XML element names everywhere else, and in the few cases of joining words use an

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread David Lively
Here's the patch with those issues addressed (also merged with latest upstream - avoids internal.h merge conflict) ... Dave On Fri, 2008-08-22 at 09:50 +0100, Daniel P. Berrange wrote: On Thu, Aug 21, 2008 at 10:29:43AM -0400, David Lively wrote: Hi Folks - Here's my second pass at

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 10:58:54AM -0400, David Lively wrote: On Fri, 2008-08-22 at 09:50 +0100, Daniel P. Berrange wrote: +const char *start_tag = SourceList\n; +const char *end_tag = /SourceList\n; I'd prefer that to be sources - we avoid capitals in the XML element names

Re: [libvirt] [PATCH] Delete veth devices during lxcVMCleanup

2008-08-22 Thread Dan Smith
DB All my patches for LXC with exception of the pivot_root stuff are DB now commited, so this is good to commit. Done. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [EMAIL PROTECTED] pgpg7jtngAkLp.pgp Description: PGP signature -- Libvir-list mailing list

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Jim Meyering
David Lively [EMAIL PROTECTED] wrote: Here's the patch with those issues addressed (also merged with latest upstream - avoids internal.h merge conflict) ... Hi David, Looks good. A couple of minor suggestions and questions. ... diff --git a/configure.in b/configure.in index 9479f1c..430a097

Re: [libvirt] [PATCH] kvm: maxVCPU runtime detection

2008-08-22 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote: On Fri, Aug 22, 2008 at 03:16:42PM +0200, Guido G?nther wrote: Hi, with recent linux kernels we can detect the maximum number of virtual cpus at runtime via an ioctl. Possible patch attached. It does this on every call to qemudGetMaxVCPUs. Would you

Re: [libvirt] PATCH: Allow specific FDs to be kept open in virExec()

2008-08-22 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote: With my recent patches to virExec(), all FDs except stdin/out/err are closed before the child is exec'd to prevent accidental leaks. Of course I forgot the one key place where we need to propagate FDs... The TAP devices passed to QEMU. This patch

Re: [libvirt] [PATCH] kvm: maxVCPU runtime detection

2008-08-22 Thread Guido Günther
On Fri, Aug 22, 2008 at 07:26:12PM +0200, Jim Meyering wrote: [..snip..] I've just checked up to date rawhide and debian unstable systems. Both had this: $ grep KVM_CHECK_EXTENSION /usr/include/linux/kvm.h #define KVM_CHECK_EXTENSION _IO(KVMIO, 0x03) But rawhide lacks

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread David Lively
Hi Jim - Thanks for your comments. I really appreciate the detailed look. I'll implement your suggestions (including the refactoring of the code to turn a virStringList into a single XML string), though I have a question about one of them: On Fri, 2008-08-22 at 19:16 +0200, Jim Meyering wrote:

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread David Lively
On Fri, 2008-08-22 at 19:16 +0200, Jim Meyering wrote: +const char *name, *path; path can be const, too. It is, at least according to my gcc (4.3.0-8, x86_64, Fedora9). Compile the following and without FORCE_WARNING to check: void check() { #ifdef FORCE_WARNING const char *foo;

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Jim Meyering
David Lively [EMAIL PROTECTED] wrote: On Fri, 2008-08-22 at 19:16 +0200, Jim Meyering wrote: +const char *name, *path; path can be const, too. It is, at least according to my gcc (4.3.0-8, x86_64, Fedora9). Compile the following and without FORCE_WARNING to check: void check() {

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Jim Meyering
David Lively [EMAIL PROTECTED] wrote: ... AM_CONDITIONAL([WITH_STORAGE_FS], [test $with_storage_fs = yes]) +if test $with_storage_fs = yes; then + AC_PATH_PROG([SHOWMOUNT], [showmount], [], [$PATH:/sbin:/usr/sbin]) + AC_DEFINE_UNQUOTED([SHOWMOUNT], [$SHOWMOUNT], +[Location or name

Re: [libvirt] [PATCH] storage pool discovery

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 11:06:38PM +0200, Jim Meyering wrote: David Lively [EMAIL PROTECTED] wrote: ... AM_CONDITIONAL([WITH_STORAGE_FS], [test $with_storage_fs = yes]) +if test $with_storage_fs = yes; then + AC_PATH_PROG([SHOWMOUNT], [showmount], [], [$PATH:/sbin:/usr/sbin]) +