[libvirt] [PATCH] daemon: plug a memory leak

2010-12-10 Thread Eric Blake
* daemon/libvirtd.c (qemudFreeClient): Avoid a leak. (qemudDispatchServer): Avoid null dereference. --- I keep finding more of these. daemon/libvirtd.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 791b3dc..2914f2f 100644

[libvirt] [PATCHv2 3/3] build: allow mingw compilation with virCommand

2010-12-10 Thread Eric Blake
Allows compilation, but no creation of child processes yet. Take it one step at a time. * src/util/util.c (virExecWithHook) [WIN32]: New dummy function. * src/libvirt_private.syms: Export it. --- src/libvirt_private.syms |1 + src/util/util.c | 22 ++ 2 files c

[libvirt] [PATCHv2 2/3] util: introduce virWaitPid

2010-12-10 Thread Eric Blake
* src/util/util.h (virWaitPid): New prototype. * src/util/util.c (virWaitPid): Implement it. * src/util/command.c (virCommandWait): Use it. * src/libvirt_private.syms: Export it. --- Should I convert over most remaining instances of waitpid() and add a 'make syntax-check' entry? The only place th

Re: [libvirt] [PATCH] Convert dhcpStartDhcpDaemon from virRun to virCommand

2010-12-10 Thread Daniel P. Berrange
On Fri, Dec 10, 2010 at 01:34:15PM -0700, Eric Blake wrote: > On 12/10/2010 12:02 PM, Laine Stump wrote: > > This is pretty straightforward - even though dnsmasq gets daemonized > > and uses a pid file, those things are both handled by the dnsmasq > > binary itself. And libvirt doesn't need any of

[libvirt] [PATCHv2 1/3] build: update gnulib for pipe on mingw

2010-12-10 Thread Eric Blake
* .gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Import pipe-posix for mingw. * src/remote/remote_driver.c (pipe) [WIN32]: Drop dead macro. * daemon/event.c (pipe) [WIN32]: Drop dead function. --- v2: also fix daemon, and add two more patches that allow ./autobuild.sh to once again

Re: [libvirt] [PATCH] build: update gnulib for pipe on mingw

2010-12-10 Thread Eric Blake
On 12/10/2010 03:55 PM, Eric Blake wrote: > I've fixed pipe() in gnulib. waitpid() will need a bit more > invasive fix; I'm thinking of creating: > > struct virPid { > #ifdef WIN32 > HANDLE pid; > #else > pid_t pid; > #endif > }; Not quite necessary; _spawn() in mingw returns a pid_t, an

[libvirt] [PATCH] build: update gnulib for pipe on mingw

2010-12-10 Thread Eric Blake
* .gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Import pipe-posix for mingw. * src/remote/remote_driver.c (pipe): Drop dead macro. --- Matthias complianed on IRC that mingw builds are broken since they unconditionally build virCommand, which unconditionally uses pipe() and waitpid(

[libvirt] [PATCH] test: fix commantest under autobuild.sh

2010-12-10 Thread Eric Blake
* tests/commandtest.c (mymain): Kill off any leaked-in fds. * autobuild.sh: Don't leak fds. Signed-off-by: Eric Blake --- Autobuild failed because it triggered a commandtest failure where commandtest was too sensitive to the environment. Fix the problem at both ends - autobuild shouldn't leak,

Re: [libvirt] [PATCH 4/4] command: ease use with virBuffer

2010-12-10 Thread Eric Blake
On 12/10/2010 12:58 PM, Laine Stump wrote: > On 12/10/2010 02:18 PM, Eric Blake wrote: >> * src/util/command.h (virCommandAddArgBuffer) >> (virCommandAddEnvBuffer): New prototypes. >> * src/util/command.c (virCommandAddArgBuffer) >> (virCommandAddEnvBuffer): Implement them. >> * src/libvirt_private

Re: [libvirt] [PATCH] Convert dhcpStartDhcpDaemon from virRun to virCommand

2010-12-10 Thread Laine Stump
On 12/10/2010 03:34 PM, Eric Blake wrote: On 12/10/2010 12:02 PM, Laine Stump wrote: This is pretty straightforward - even though dnsmasq gets daemonized and uses a pid file, those things are both handled by the dnsmasq binary itself. And libvirt doesn't need any of the output of the dnsmasq com

Re: [libvirt] [PATCH 2/4] conf: plug memory leaks

2010-12-10 Thread Eric Blake
On 12/10/2010 12:45 PM, Laine Stump wrote: > On 12/10/2010 02:17 PM, Eric Blake wrote: >> * src/conf/domain_conf.c (virDomainGraphicsDefParseXML) >> (virDomainDeviceVirtioSerialAddressParseXML) >> (virDomainDiskDefFree): Free various leaks. > > ACK. Thanks; pushed. -- Eric Blake ebl...@redhat

[libvirt] [libvirt PATCH] 802.1Qbh: Add support for IFLA_VF_MAC

2010-12-10 Thread Roopa Prabhu
From: Roopa Prabhu Current code does not pass VM mac address to a 802.1Qbh direct attach interface using IFLA_VF_MAC. This patch adds support in macvtap code to send IFLA_VF_MAC netlink request during port profile association on a 802.1Qbh interface. Stefan Cc'ed for comments because this patch

Re: [libvirt] [PATCH 1/4] tests: plug memory leaks

2010-12-10 Thread Eric Blake
On 12/10/2010 01:07 PM, Laine Stump wrote: >> +++ b/tests/qemuxml2argvtest.c >> @@ -86,8 +86,7 @@ static int testCompareXMLToArgvFiles(const char *xml, >> monitor_chr.type = VIR_DOMAIN_CHR_TYPE_UNIX; >> monitor_chr.data.nix.path = (char *)"/tmp/test-monitor"; >> monitor_chr.data.n

Re: [libvirt] [PATCH] virExec: avoid undefined behavior

2010-12-10 Thread Eric Blake
On 12/10/2010 12:36 PM, Laine Stump wrote: > On 12/03/2010 05:03 PM, Eric Blake wrote: >> * src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd. >> --- >> >> Noticed this one by inspection, while investigating >> https://bugzilla.redhat.com/show_bug.cgi?id=659855 >> >> Don't know if

Re: [libvirt] [PATCH] Convert dhcpStartDhcpDaemon from virRun to virCommand

2010-12-10 Thread Eric Blake
On 12/10/2010 01:34 PM, Eric Blake wrote: > On 12/10/2010 12:02 PM, Laine Stump wrote: >> This is pretty straightforward - even though dnsmasq gets daemonized >> and uses a pid file, those things are both handled by the dnsmasq >> binary itself. And libvirt doesn't need any of the output of the >>

Re: [libvirt] [PATCH] esx: Refactor storage pool type lookup into a function

2010-12-10 Thread Matthias Bolte
2010/12/10 Eric Blake : > On 12/06/2010 01:10 PM, Matthias Bolte wrote: >> --- >>  src/esx/esx_storage_driver.c |  130 >> ++ >>  1 files changed, 56 insertions(+), 74 deletions(-) >> >> diff --git a/src/esx/esx_storage_driver.c b/src/esx/esx_storage_driver.c

Re: [libvirt] [PATCH] esx: Improve error reporting for failed tasks

2010-12-10 Thread Matthias Bolte
2010/12/10 Eric Blake : > On 12/06/2010 06:45 AM, Matthias Bolte wrote: >> Instead of just reporting that a task failed get the >> localized message from the TaskInfo error and include >> it in the reported error message. >> >> Implement minimal deserialization support for the >> MethodFault type i

Re: [libvirt] [PATCH] Convert dhcpStartDhcpDaemon from virRun to virCommand

2010-12-10 Thread Eric Blake
On 12/10/2010 12:02 PM, Laine Stump wrote: > This is pretty straightforward - even though dnsmasq gets daemonized > and uses a pid file, those things are both handled by the dnsmasq > binary itself. And libvirt doesn't need any of the output of the > dnsmasq command either, so we just setup the arg

Re: [libvirt] [PATCH 1/4] tests: plug memory leaks

2010-12-10 Thread Laine Stump
On 12/10/2010 02:17 PM, Eric Blake wrote: * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Don't allocate, since we don't use virDomainChrDefFree. --- Makes it easier to run valgrind on qemuxml2argv to spot the leaks in libvirt proper. tests/qemuxml2argvtest.c |3 +-- 1 files chan

Re: [libvirt] [PATCH 4/4] command: ease use with virBuffer

2010-12-10 Thread Laine Stump
On 12/10/2010 02:18 PM, Eric Blake wrote: * src/util/command.h (virCommandAddArgBuffer) (virCommandAddEnvBuffer): New prototypes. * src/util/command.c (virCommandAddArgBuffer) (virCommandAddEnvBuffer): Implement them. * src/libvirt_private.syms (command.h): Export them. * src/qemu/qemu_conf.c (qe

Re: [libvirt] [PATCH 2/4] conf: plug memory leaks

2010-12-10 Thread Laine Stump
On 12/10/2010 02:17 PM, Eric Blake wrote: * src/conf/domain_conf.c (virDomainGraphicsDefParseXML) (virDomainDeviceVirtioSerialAddressParseXML) (virDomainDiskDefFree): Free various leaks. --- All real leaks in libvirt, and all present in 0.8.6 (if not earlier). src/conf/domain_conf.c | 10 ++

Re: [libvirt] [PATCH 3/4] qemu: plug memory leak

2010-12-10 Thread Laine Stump
On 12/10/2010 02:18 PM, Eric Blake wrote: * src/qemu/qemu_conf.c (qemudBuildCommandLine): Don't leak rbd_hosts. --- Leak introduced post-0.8.6. src/qemu/qemu_conf.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c ind

Re: [libvirt] [PATCH] virExec: avoid undefined behavior

2010-12-10 Thread Laine Stump
On 12/03/2010 05:03 PM, Eric Blake wrote: * src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd. --- Noticed this one by inspection, while investigating https://bugzilla.redhat.com/show_bug.cgi?id=659855 Don't know if it's the root cause of the crash in that bug, though. src/

Re: [libvirt] [PATCH] command: plug memory leak

2010-12-10 Thread Laine Stump
On 12/10/2010 10:56 AM, Eric Blake wrote: * src/util/command.c (virCommandFree): Free data from virCommandSetInputBuffer. --- src/util/command.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/util/command.c b/src/util/command.c index 089e0bd..5e2b19a 100644 --- a/

Re: [libvirt] [Patch v3] Add VMware Workstation and Player driver

2010-12-10 Thread Matthias Bolte
2010/12/8 Jean-Baptiste Rouault : > --- >  cfg.mk                      |    1 + >  configure.ac                |    7 + >  include/libvirt/virterror.h |    1 + >  po/POTFILES.in              |    2 + >  src/Makefile.am             |   24 +- >  src/driver.h                |    3 +- >  src/libvirt.c

[libvirt] [PATCH 4/4] command: ease use with virBuffer

2010-12-10 Thread Eric Blake
* src/util/command.h (virCommandAddArgBuffer) (virCommandAddEnvBuffer): New prototypes. * src/util/command.c (virCommandAddArgBuffer) (virCommandAddEnvBuffer): Implement them. * src/libvirt_private.syms (command.h): Export them. * src/qemu/qemu_conf.c (qemudBuildCommandLine): Use them, plugging a m

[libvirt] [PATCH 3/4] qemu: plug memory leak

2010-12-10 Thread Eric Blake
* src/qemu/qemu_conf.c (qemudBuildCommandLine): Don't leak rbd_hosts. --- Leak introduced post-0.8.6. src/qemu/qemu_conf.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index fb0b29a..4f19037 100644 --- a/src/qemu/qemu

[libvirt] [PATCH 0/4] more memory leak patches

2010-12-10 Thread Eric Blake
More in the ongoing battle to make libvirtd not so leaky. Also related, and still waiting on a review for: virExec (and thus virCommand) have undefined behavior https://www.redhat.com/archives/libvir-list/2010-December/msg00242.html avoid matchpathcon memory leak (although libselinux 2.0.97 fina

[libvirt] [PATCH 1/4] tests: plug memory leaks

2010-12-10 Thread Eric Blake
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Don't allocate, since we don't use virDomainChrDefFree. --- Makes it easier to run valgrind on qemuxml2argv to spot the leaks in libvirt proper. tests/qemuxml2argvtest.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --g

[libvirt] [PATCH 2/4] conf: plug memory leaks

2010-12-10 Thread Eric Blake
* src/conf/domain_conf.c (virDomainGraphicsDefParseXML) (virDomainDeviceVirtioSerialAddressParseXML) (virDomainDiskDefFree): Free various leaks. --- All real leaks in libvirt, and all present in 0.8.6 (if not earlier). src/conf/domain_conf.c | 10 ++ 1 files changed, 10 insertions(+),

[libvirt] [PATCH] Convert dhcpStartDhcpDaemon from virRun to virCommand

2010-12-10 Thread Laine Stump
This is pretty straightforward - even though dnsmasq gets daemonized and uses a pid file, those things are both handled by the dnsmasq binary itself. And libvirt doesn't need any of the output of the dnsmasq command either, so we just setup the args and call virRun(). Mainly it was just a (mostly)

Re: [libvirt] [PATCH] command: plug memory leak

2010-12-10 Thread Eric Blake
On 12/10/2010 10:26 AM, Matthias Bolte wrote: > 2010/12/10 Eric Blake : >> * src/util/command.c (virCommandFree): Free data from >> virCommandSetInputBuffer. > At first I wanted to complain that virCommandSetInputBuffer isn't > documented to take ownership of the inbuf, then I saw that it's > strd

Re: [libvirt] [PATCH] command: plug memory leak

2010-12-10 Thread Matthias Bolte
2010/12/10 Eric Blake : > * src/util/command.c (virCommandFree): Free data from > virCommandSetInputBuffer. > --- >  src/util/command.c |    1 + >  1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/src/util/command.c b/src/util/command.c > index 089e0bd..5e2b19a 100644 > --- a/src/u

Re: [libvirt] [PATCH] qemu: Introduce two new job types

2010-12-10 Thread Eric Blake
On 12/10/2010 09:40 AM, Osier Yang wrote: >> >> case QEMU_JOB_MIGRATION_OUT: >> job = _("guest unexpectedly quit during migration"); >> break; >> case QEMU_JOB_SAVE: >> job = _("guest unexpectedly quit during domain saving"); >> break; >> > > I realized this problem, but "job"

Re: [libvirt] [PATCH] qemu: Introduce two new job types

2010-12-10 Thread Osier Yang
于 2010年12月11日 00:12, Eric Blake 写道: On 12/10/2010 01:43 AM, Osier Yang wrote: Currently, all of domain "save/dump/managed save/migration" use the same function "qemudDomainWaitForMigrationComplete" to wait the job finished, but the error messages are all about "migration", e.g. when a domain sav

Re: [libvirt] [v2] qemu: Set domain def as updated and transient if changes

2010-12-10 Thread Osier Yang
于 2010年12月10日 22:42, Cole Robinson 写道: On 12/10/2010 12:06 AM, Osier Yang wrote: As qemu driver doesn't allow to make changes on persistent domain configuration via "attach/detach/update device", and all the changes made on the running domain configuration should not be persistent across next bo

Re: [libvirt] [v2] qemu: Set domain def as updated and transient if changes

2010-12-10 Thread Osier Yang
于 2010年12月10日 18:58, Daniel P. Berrange 写道: On Fri, Dec 10, 2010 at 01:06:55PM +0800, Osier Yang wrote: As qemu driver doesn't allow to make changes on persistent domain configuration via "attach/detach/update device", and all the changes made on the running domain configuration should not be pe

Re: [libvirt] [PATCH] qemu: Introduce two new job types

2010-12-10 Thread Eric Blake
On 12/10/2010 01:43 AM, Osier Yang wrote: > Currently, all of domain "save/dump/managed save/migration" > use the same function "qemudDomainWaitForMigrationComplete" > to wait the job finished, but the error messages are all > about "migration", e.g. when a domain saving job is canceled > by user,

[libvirt] [PATCH] command: plug memory leak

2010-12-10 Thread Eric Blake
* src/util/command.c (virCommandFree): Free data from virCommandSetInputBuffer. --- src/util/command.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/util/command.c b/src/util/command.c index 089e0bd..5e2b19a 100644 --- a/src/util/command.c +++ b/src/util/command.c @@

Re: [libvirt] [PATCH] build: distribute commandtest files

2010-12-10 Thread Eric Blake
On 12/10/2010 08:10 AM, Eric Blake wrote: > * tests/Makefile.am (SUBDIRS): Add commanddata. > * tests/commanddata/Makefile.am: New file. > * configure.ac (AC_OUTPUT): Build new makefile. > Reported by Dominik Klein. > --- > > This should do the trick. I'll push it under the build-breaker > rule i

[libvirt] [PATCH] build: distribute commandtest files

2010-12-10 Thread Eric Blake
* tests/Makefile.am (SUBDIRS): Add commanddata. * tests/commanddata/Makefile.am: New file. * configure.ac (AC_OUTPUT): Build new makefile. Reported by Dominik Klein. --- This should do the trick. I'll push it under the build-breaker rule if it passes 'make distcheck' (still in progress as I type

Re: [libvirt] [PATCH] Update documentation of watchdog dump option and add test data for it

2010-12-10 Thread Eric Blake
On 12/09/2010 10:52 PM, Hu Tao wrote: > The xml watchdog dump option is converted to qemu watchdog pause arg > but it is not reasonable to convert it back from qemu watchdog pause > arg since there already is a xml watchdog pause option, so a test for > the dump option to convert it from arg to xml

Re: [libvirt] [v2] qemu: Set domain def as updated and transient if changes

2010-12-10 Thread Cole Robinson
On 12/10/2010 12:06 AM, Osier Yang wrote: > As qemu driver doesn't allow to make changes on persistent > domain configuration via "attach/detach/update device", > and all the changes made on the running domain configuration > should not be persistent across next boot (without the need > of restarti

Re: [libvirt] building fails with 0.8.6 and snapshot

2010-12-10 Thread Dominik Klein
> Maybe I can fix this myself. Turns out I can't ... -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [v2] qemu: Set domain def as updated and transient if changes

2010-12-10 Thread Daniel P. Berrange
On Fri, Dec 10, 2010 at 01:06:55PM +0800, Osier Yang wrote: > As qemu driver doesn't allow to make changes on persistent > domain configuration via "attach/detach/update device", > and all the changes made on the running domain configuration > should not be persistent across next boot (without the

[libvirt] [PATCH] qemu: Introduce two new job types

2010-12-10 Thread Osier Yang
Currently, all of domain "save/dump/managed save/migration" use the same function "qemudDomainWaitForMigrationComplete" to wait the job finished, but the error messages are all about "migration", e.g. when a domain saving job is canceled by user, "migration was cancled by client" will be throwed as

Re: [libvirt] building fails with 0.8.6 and snapshot

2010-12-10 Thread Dominik Klein
> Yes, and it's fixed in git. That's why I tried to build the snapshot. > > make rpm builds from a tarball generated by make dist. > > > > /usr/src/packages/BUILD/libvirt-0.8.6/tests/commanddata/test16.log > > > > is missing in the tarball because the whole commanddata directory is > > not ma

Re: [libvirt] building fails with 0.8.6 and snapshot

2010-12-10 Thread Matthias Bolte
2010/12/10 Dominik Klein : > hi. > > i am trying to build 0.8.6 but this fails due to the lack of macvtap > enabled in my kernel. i won't use it, so i don't care, but even if i > disable it, build won't work. apparently, thats a known bug, according > to https://www.redhat.com/archives/libvir-list/