RE: [libvirt] invoking interface.script - missing interface name of domain

2009-01-30 Thread Daniel Schwager
Hi Daniel, within the latest CVS checkout, the problem below is not fixed. It there an open bug (to track) in redhat bugzilla for it ? If not, should I create one ? regards Danny On Tue, Jan 20, 2009 at 04:44:22PM +0100, Daniel Schwager wrote: QEMU is responsible for passing arguments to

Re: style question (was Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.)

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 10:48:36PM -0500, Dave Allan wrote: Jim Meyering wrote: Finally, I moved a couple variable declarations down (C99-style) to their points of first use. I take it that the C++/C99 is the recommended style for all libvirt code? I generally haven't coded this way in

[libvirt] Re: style question

2009-01-30 Thread Jim Meyering
Dave Allan dal...@redhat.com wrote: Jim Meyering wrote: Finally, I moved a couple variable declarations down (C99-style) to their points of first use. I take it that the C++/C99 is the recommended style for all libvirt code? I generally haven't coded this way in the past (in fact I usually

Re: [libvirt] kvm, sync guest disk before saving ?

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 12:44:14AM +0100, Daniel Schwager wrote: Hi, is there a way to get a consistent disk image of a domain running qemu-kvm before saving it ? I used xm sysrq id s with xen-hypervisor - but what's the way with kvm ? Or could I install drivers into the guest helping to

Re: [libvirt] bug: libvirt hang while restore a domain

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 01:14:57AM +0100, Daniel Schwager wrote: ** But the second time, the command hang: [r...@xen03 srv]# virsh restore /srv/save And libvirt daemon runs with 100% CPU load .. This is not good .. I know about this problem am working on a fix - the refactored startup

[libvirt] PATCH: Avoid crashing valgrind in LXC driver

2009-01-30 Thread Daniel P. Berrange
The LXC driver makes use of new clone flags for creating containers. It creates a dummy container which immediately exits in order to test for availabilty of this feature in the kernel. Unfortunately valgrind has no knowledge of these new clone flags, gets very very unhappy and then reports bogus

[libvirt] PATCH: Fix leak in storage driver

2009-01-30 Thread Daniel P. Berrange
A recent change to keep the storage pools active upon shutdown, exposed a minor flaw in the code which free's a virStoragePoolObj instance. It never free's the associated volumes, since it presumed you'd never free a pool, which was still active. A bogus assumption, causing us to leak memory upon

[libvirt] PATCH: Fix leak in libvirtd daemon when reporting errors

2009-01-30 Thread Daniel P. Berrange
When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error reported would leak some memory. This patch free's the memory Daniel diff -r 1bd5f9fd5393 qemud/remote.c ---

Re: [libvirt] libvirt for rhel-5?

2009-01-30 Thread Alan Pevec
On Wed, Jan 28, 2009 at 12:32 PM, Daniel P. Berrange berra...@redhat.com wrote: NB, if you're re-packaging libvirt for EPEL-5, be warned that none of http://fedoraproject.org/wiki/EPEL/FAQ#Does_EPEL_replace_packages_provided_within_Red_Hat_Enterprise_Linux_or_layered_products.3F libvirt cannot

Re: [libvirt] libvirt for rhel-5?

2009-01-30 Thread Farkas Levente
Alan Pevec wrote: On Wed, Jan 28, 2009 at 12:32 PM, Daniel P. Berrange berra...@redhat.com wrote: NB, if you're re-packaging libvirt for EPEL-5, be warned that none of

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 12:07:31AM +0100, Jim Meyering wrote: Here's your rebased and adjusted patch: From ce4f15853e119d6d976a5d29917f62f577e8ec9e Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Thu, 29 Jan 2009 22:50:36 +0100 Subject: [PATCH] allow disk cache mode

Re: [libvirt] libvirt for rhel-5?

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 01:00:25PM +0100, Farkas Levente wrote: Alan Pevec wrote: On Wed, Jan 28, 2009 at 12:32 PM, Daniel P. Berrange berra...@redhat.com wrote: NB, if you're re-packaging libvirt for EPEL-5, be warned that none of

[libvirt] (resend) Problems with virt-manager checking access on virtual images.

2009-01-30 Thread Daniel J Walsh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Met with Cole this morning and we talked about how SELinux can cause people headaches when installing virtual images from random locations. User downloads a iso image to his home directory and then uses virt-manager to install it. Problem is when

Re: [libvirt] (resend) Problems with virt-manager checking access on virtual images.

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 07:38:40AM -0500, Daniel J Walsh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Met with Cole this morning and we talked about how SELinux can cause people headaches when installing virtual images from random locations. User downloads a iso image to his home

[libvirt] PATCH: Fix passing of ifname to QEMU

2009-01-30 Thread Daniel P. Berrange
When using the type='ethernet' network device configuration for a guest we pass a script, and optional interface name to QEMU. If ifname is omitted, then QEMU allocates one itself. The problem was we were passing an ifname of '(null)' by mistake. This patch corrects that problem and adds a test

[libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Jim Meyering
Hi David, I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: $ LIBVIRT_DEBUG=1 libvirtd 2 log pid=$! $ ./hellolibvirt Attempting to connect to hypervisor Connected to hypervisor at qemu:///session ? - Failed to get

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Jim Meyering
Jim Meyering j...@meyering.net wrote: I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: ... $ kill $pid $ LIBVIRT_DEBUG=1 ../../qemud/libvirtd 2 log $ ./hellolibvirt Attempting to connect to hypervisor

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 02:32:00PM +0100, Jim Meyering wrote: Jim Meyering j...@meyering.net wrote: I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: ... $ kill $pid $ LIBVIRT_DEBUG=1 ../../qemud/libvirtd 2 log $

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 02:10:58PM +0100, Jim Meyering wrote: Hi David, I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: $ LIBVIRT_DEBUG=1 libvirtd 2 log pid=$! $ ./hellolibvirt Attempting to connect to hypervisor

Re: [libvirt] (resend) Problems with virt-manager checking access on virtual images.

2009-01-30 Thread Daniel J Walsh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel P. Berrange wrote: On Fri, Jan 30, 2009 at 07:38:40AM -0500, Daniel J Walsh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Met with Cole this morning and we talked about how SELinux can cause people headaches when installing virtual

Re: [libvirt] PATCH: Fix infinite loop when QEMU quits at startup

2009-01-30 Thread Daniel Veillard
On Fri, Jan 30, 2009 at 11:37:35AM +, Daniel P. Berrange wrote: The recent refactoring of the QEMU startup process now reads the monitor TTY from the logfile. Unfortunately in this refactoring we lost the check for the 'ret == 0' scenario in the read() return value. So if QEMU quits at

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: ... Further up in this code its already adding cache=off for shared disks. Probably introduced by me in the merge. There's also quite a few code style issues, not following conventions of the surrounding code. Here's a patch which addresses all

Re: [libvirt] (resend) Problems with virt-manager checking access on virtual images.

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 09:06:38AM -0500, Daniel J Walsh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel P. Berrange wrote: I don't particularly like the idea of running another program to check this because SELinux context isn't the only thing which will potentially

Re: [libvirt] PATCH: Avoid crashing valgrind in LXC driver

2009-01-30 Thread Daniel Veillard
On Fri, Jan 30, 2009 at 11:41:16AM +, Daniel P. Berrange wrote: The LXC driver makes use of new clone flags for creating containers. It creates a dummy container which immediately exits in order to test for availabilty of this feature in the kernel. Unfortunately valgrind has no knowledge

Re: [libvirt] PATCH: Fix leak in libvirtd daemon when reporting errors

2009-01-30 Thread Daniel Veillard
On Fri, Jan 30, 2009 at 11:44:35AM +, Daniel P. Berrange wrote: When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error reported would leak some memory. This patch free's

Re: [libvirt] PATCH: Fix passing of ifname to QEMU

2009-01-30 Thread Daniel Veillard
On Fri, Jan 30, 2009 at 01:08:54PM +, Daniel P. Berrange wrote: When using the type='ethernet' network device configuration for a guest we pass a script, and optional interface name to QEMU. If ifname is omitted, then QEMU allocates one itself. The problem was we were passing an ifname

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 03:27:55PM +0100, Jim Meyering wrote: Daniel P. Berrange berra...@redhat.com wrote: ... Further up in this code its already adding cache=off for shared disks. Probably introduced by me in the merge. There's also quite a few code style issues, not following

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 02:41:18PM +, Daniel P. Berrange wrote: On Fri, Jan 30, 2009 at 03:27:55PM +0100, Jim Meyering wrote: Daniel P. Berrange berra...@redhat.com wrote: ... Further up in this code its already adding cache=off for shared disks. Probably introduced by me in the

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: On Fri, Jan 30, 2009 at 02:32:00PM +0100, Jim Meyering wrote: Jim Meyering j...@meyering.net wrote: I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: ... $ kill $pid $

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: Here's the patch including RNG schema update Daniel diff -r 2ff2ff7734c2 docs/schemas/domain.rng --- a/docs/schemas/domain.rng Fri Jan 30 11:01:52 2009 + +++ b/docs/schemas/domain.rng Fri Jan 30 14:47:11 2009 + @@ -426,16 +426,43 @@

Re: [libvirt] [PATCH] eliminate strerror from qemu_driver.c: use virReportSystemError instead

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 09:54:59PM +0100, Jim Meyering wrote: diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 36e12b2..8fd789d 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -89,31 +89,19 @@ static void qemuDriverUnlock(struct qemud_driver *driver) static int

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 03:54:17PM +0100, Jim Meyering wrote: Daniel P. Berrange berra...@redhat.com wrote: Hmm, it should use the native arch - virExtractVersionInfo needs fixing to call uname, and extract the native arch. Hardcoding i386 was sufficient, when we mandated that 'qemu' was

Re: [libvirt] patch: allow disk cache mode to be specified in a domain's xml definition.

2009-01-30 Thread john cooper
Jim Meyering wrote: Hi John, I tried to apply that, but failed miserably, since all of the following was recently redone to use virBufferVSprintf rather than snprintf. Yea I suspected the code was likely seeing some motion. Thanks for bringing it forward. And it's a good thing, because with

Re: [libvirt] PATCH: Fix infinite loop when QEMU quits at startup

2009-01-30 Thread Guido Günther
On Fri, Jan 30, 2009 at 11:37:35AM +, Daniel P. Berrange wrote: diff -r 826e6ed70ee0 src/qemu_driver.c --- a/src/qemu_driver.c Fri Jan 30 10:58:34 2009 + +++ b/src/qemu_driver.c Fri Jan 30 11:00:43 2009 + @@ -355,10 +355,9 @@ qemudReconnectVMs(struct qemud_driver *d

Re: [libvirt] (resend) Problems with virt-manager checking access on virtual images.

2009-01-30 Thread Daniel J Walsh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel P. Berrange wrote: On Fri, Jan 30, 2009 at 09:06:38AM -0500, Daniel J Walsh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel P. Berrange wrote: I don't particularly like the idea of running another program to check this

Re: [libvirt] [PATCH] Fix getpwuid_r() usage

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 06:06:10PM -0800, john.le...@sun.com wrote: @@ -1485,7 +1485,14 @@ char *virGetUserDirectory(virConnectPtr return NULL; } -if (getpwuid_r(uid, pwbuf, strbuf, strbuflen, pw) != 0) { +/* + * From the manpage (terrifying but true): + *

Re: [libvirt] [PATCH] Fix yet another printf(%s, NULL) case

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 06:34:51PM -0800, john.le...@sun.com wrote: # HG changeset patch # User john.le...@sun.com # Date 1233282885 28800 # Node ID 6ee939f57a02bf9d332f094e07180e0149e85924 # Parent c60439e564f90b579c07f6349f8f0810a5da1032 Fix yet another printf(%s, NULL) case

Re: [libvirt] [PATCH] Fix virsh migrateuri handling

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 07:37:25PM -0800, john.le...@sun.com wrote: # HG changeset patch # User john.le...@sun.com # Date 1233286638 28800 # Node ID 0934f4c2e1d446b1902d9ffcf14febf964af1e6a # Parent 6ee939f57a02bf9d332f094e07180e0149e85924 Fix virsh migrateuri handling Signed-off-by:

Re: [libvirt] [PATCH] Fix virsh migrateuri handling

2009-01-30 Thread John Levon
On Fri, Jan 30, 2009 at 03:25:36PM +, Daniel P. Berrange wrote: Urgh, took me a while to understand what was going wrong there - a little bizzarre contract for vshCommandOptString! Yes, I'm completely lost as to the purpose of found to be honest. regards john -- Libvir-list mailing list

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread Daniel P. Berrange
On Thu, Jan 29, 2009 at 10:50:18PM -0500, John Levon wrote: 2675 * Returns the new domain object if the migration was successful, 2676 * or NULL in case of error. Note that the new domain object 2677 * exists in the scope of the destination connection (dconn). This is obviously

Re: [libvirt] PATCH: Fix leak in libvirtd daemon when reporting errors

2009-01-30 Thread Jim Meyering
Daniel Veillard veill...@redhat.com wrote: On Fri, Jan 30, 2009 at 11:44:35AM +, Daniel P. Berrange wrote: When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error

Re: [libvirt] PATCH: Fix leak in storage driver

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 04:55:40PM +0100, Jim Meyering wrote: Daniel P. Berrange berra...@redhat.com wrote: A recent change to keep the storage pools active upon shutdown, exposed a minor flaw in the code which free's a virStoragePoolObj instance. It never free's the associated volumes,

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread John Levon
On Fri, Jan 30, 2009 at 03:41:04PM +, Daniel P. Berrange wrote: This is obviously impossible for xenmigr:///. As a result, virsh migrate always returns an error code: I'm not sure I understand why this is impossible ? I thought the purpose of xenmigr:/// was to allow live migration

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 11:04:12AM -0500, John Levon wrote: On Fri, Jan 30, 2009 at 03:41:04PM +, Daniel P. Berrange wrote: This is obviously impossible for xenmigr:///. As a result, virsh migrate always returns an error code: I'm not sure I understand why this is impossible ?

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Dave Allan
Daniel P. Berrange wrote: On Fri, Jan 30, 2009 at 02:10:58PM +0100, Jim Meyering wrote: Hi David, I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: $ LIBVIRT_DEBUG=1 libvirtd 2 log pid=$! $ ./hellolibvirt Attempting to

Re: [libvirt] Re: [PATCH 0/3] A small example program

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 11:23:29AM -0500, Dave Allan wrote: Daniel P. Berrange wrote: On Fri, Jan 30, 2009 at 02:10:58PM +0100, Jim Meyering wrote: Hi David, I've just applied your 3 patches and built the example. That went fine. Then I tried to run it like this: $ LIBVIRT_DEBUG=1

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread John Levon
On Fri, Jan 30, 2009 at 04:19:06PM +, Daniel P. Berrange wrote: I'm not sure I understand why this is impossible ? I thought the purpose of xenmigr:/// was to allow live migration the traditional way without needing a remotely accessible libvirtd. At least, that's how we're using

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 11:36:16AM -0500, John Levon wrote: On Fri, Jan 30, 2009 at 04:19:06PM +, Daniel P. Berrange wrote: I'm not sure I understand why this is impossible ? I thought the purpose of xenmigr:/// was to allow live migration the traditional way without needing a

Re: [libvirt] Migration API broken for xenmigr://

2009-01-30 Thread John Levon
On Fri, Jan 30, 2009 at 04:42:04PM +, Daniel P. Berrange wrote: We're not going to *require* libvirtd to listen across the network when there's an existing mechanism, so it sounds like we'll have to fork this part. You can use the xen+ssh://hostname/ URI for the destination if you

Re: [libvirt] PATCH: Fix infinite loop when QEMU quits at startup

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: The recent refactoring of the QEMU startup process now reads the monitor TTY from the logfile. Unfortunately in this refactoring we lost the check for the 'ret == 0' scenario in the read() return value. So if QEMU quits at startup, eg due to

[libvirt] failed test on Fedora 8

2009-01-30 Thread John Levon
17) QEMU XML-2-ARGV disk-drive-shared ... FAILED I have VIR_TEST_DEBUG set, but this is all I get. It's new regards john -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] RFC: configuring host interfaces with libvirt

2009-01-30 Thread David Lutterkort
On Thu, 2009-01-29 at 13:34 -0800, Kaitlin Rupert wrote: Mark McLoughlin wrote: I don't think we want to define a bridge here, but more that an interface is shared - i.e. this is a property of eth2. Note this line. The main concern is that this is the way I'd expect NetworkManager

[libvirt] [PATCH] Fix empty declaration compiler error

2009-01-30 Thread john . levon
# HG changeset patch # User John Levon john.le...@sun.com # Date 129660 28800 # Node ID 69992f43b6f634fa46c7ae2039666378ce378eea # Parent 1b00b26880ad7feae71bb8df9ae86cfcaa428458 Fix empty declaration compiler error Signed-off-by: John Levon john.le...@sun.com diff --git a/src/domain_conf.c

[libvirt] autostart with xend

2009-01-30 Thread John Levon
It doesn't work quite right with a running domain. The 'new' will correctly set the config, but the temporary config doesn't include the new setting. So tests of the form set autostart; is it set? will fail. Suggestions? Also, why isn't this represented in the XML? thanks, john -- Libvir-list

Re: [libvirt] failed test on Fedora 8

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: From 560e27e1576a4c0ebe7db3e697ed9b6d8aa88fbc Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Fri, 30 Jan 2009 20:06:48 +0100 Subject: [PATCH] tests: diagnose open failure * tests/qemuxml2argvtest.c

Re: [libvirt] failed test on Fedora 8

2009-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2009 at 11:06:48PM +0100, Jim Meyering wrote: But as John Levon pointed out, there are many more tests/*test.c programs that use virtTestLoadFile in exactly the same way: $ git grep -h 'if (virtTestLoadFile' if (virtTestLoadFile(outputfile, expect, MAX_FILE) 0)

Re: [libvirt] [PATCH] eliminate strerror from qemu_driver.c: use virReportSystemError instead

2009-01-30 Thread Jim Meyering
Daniel P. Berrange berra...@redhat.com wrote: On Thu, Jan 29, 2009 at 09:54:59PM +0100, Jim Meyering wrote: diff --git a/src/qemu_driver.c b/src/qemu_driver.c You can actually just kill off the SetNonBlock method, since we added one to util.h. We should probably do same for SetCloseExec since

[libvirt] [PATCH 0/1] Add error reporting to example

2009-01-30 Thread David Allan
The following patch adds error reporting to the example code. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] Add showError function to display error data generated by libvirt.

2009-01-30 Thread David Allan
--- examples/hellolibvirt/hellolibvirt.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/examples/hellolibvirt/hellolibvirt.c b/examples/hellolibvirt/hellolibvirt.c index cc1af0f..234637e 100644 --- a/examples/hellolibvirt/hellolibvirt.c

Re: [libvirt] RFC: configuring host interfaces with libvirt

2009-01-30 Thread Kaitlin Rupert
David Lutterkort wrote: On Thu, 2009-01-29 at 13:34 -0800, Kaitlin Rupert wrote: Mark McLoughlin wrote: I don't think we want to define a bridge here, but more that an interface is shared - i.e. this is a property of eth2. Note this line. The main concern is that this is the way I'd expect