[libvirt] [PATCH] virsh-domain: Free dom before return false in cmdDump

2013-09-25 Thread Hongwei Bi
--- tools/virsh-domain.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 856e888..f6d4edd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4487,8 +4487,10 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)

[libvirt] [PATCH 3/6] docs: define style of code blocks inside descriptions

2013-09-25 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- docs/libvirt.css |7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/libvirt.css b/docs/libvirt.css index ed67b2f..b324ac8 100644 --- a/docs/libvirt.css +++ b/docs/libvirt.css @@ -491,3 +491,10 @@ table.acl tr, table.acl td {

[libvirt] [PATCH 2/6] docs: add class description to div's containing descriptions

2013-09-25 Thread Claudio Bley
Signed-off-by: Claudio Bley cb...@av-test.de --- docs/newapi.xsl |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/newapi.xsl b/docs/newapi.xsl index d62839a..a08b304 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -416,7 +416,7 @@ xsl:variable

[libvirt] [PATCH 0/6] API documentation improvements

2013-09-25 Thread Claudio Bley
Hi. It's been a while since I tackled this, but here it goes... This is version 4 of https://www.redhat.com/archives/libvir-list/2013-January/msg02094.html exclusive of the already applied patches, of course. Changes since v3: * skipped the ECMAScript code highlighting patch[1] in this

[libvirt] [PATCH 6/6] docs: generate links from plain text documentation

2013-09-25 Thread Claudio Bley
There are two forms used throughout libvirt code comments, which are both supported by this patch. * plain links like e.g. http://www.libvirt.org/ * links enclosed in characters, e.g. http://www.libvirt.org/ Signed-off-by: Claudio Bley cb...@av-test.de --- docs/newapi.xsl | 19

[libvirt] [PATCH 1/6] docs: process code blocks similar to Markdown

2013-09-25 Thread Claudio Bley
Wrap pre-formatted example code in code elements. This works similar to Markdown[1] code blocks[2]: Every line indented with at least 2 spaces is considered a code block and gets wrapped in pre and code tags. Look at the documentation for e.g. virStreamSend for before-and-after effects. [1]

[libvirt] [PATCH 5/6] libvirt.c: indent code of virDomainGetMemoryParameters's documentation

2013-09-25 Thread Claudio Bley
By indenting code inside of comments, it gets recognized as a code block when generating the HTML documentation. Signed-off-by: Claudio Bley cb...@av-test.de --- src/libvirt.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c

[libvirt] [PATCH 4/6] libvirt.c: add 2 spaces of indentation to example code of virStreamSend

2013-09-25 Thread Claudio Bley
See libvirt-libvirt.html#virStreamSend for the effect. Signed-off-by: Claudio Bley cb...@av-test.de --- src/libvirt.c | 114 - 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index

Re: [libvirt] [PATCH v3 0/4] don't masquerade local broadcast/multicast packets

2013-09-25 Thread Laine Stump
On 09/24/2013 02:38 PM, Laszlo Ersek wrote: I might as well fix up v2 as requested originally, and submit that as v4. What do you recommend? I think fixing up v2 with the renames is a better approach. I'm fine either way, I'd just like to get this merged and stop wasting the time of y'all.

[libvirt] [PATCH]util: Refresh virHook before checking its existence

2013-09-25 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com We refresh the status of hook scripts only when start/stop libvirt, or reload its configuration. But the status of hooks scripts may be changed. We need to refresh its status before checking its existence. Signed-off-by: Chen Hanxiao

Re: [libvirt] [PATCH v3 0/4] don't masquerade local broadcast/multicast packets

2013-09-25 Thread Laszlo Ersek
On 09/25/13 09:22, Laine Stump wrote: On 09/24/2013 02:38 PM, Laszlo Ersek wrote: I might as well fix up v2 as requested originally, and submit that as v4. What do you recommend? I think fixing up v2 with the renames is a better approach. I'm fine either way, I'd just like to get this merged

Re: [libvirt] [PATCH]util: Refresh virHook before checking its existence

2013-09-25 Thread Daniel P. Berrange
On Wed, Sep 25, 2013 at 03:48:16PM +0800, Chen Hanxiao wrote: From: Chen Hanxiao chenhanx...@cn.fujitsu.com We refresh the status of hook scripts only when start/stop libvirt, or reload its configuration. But the status of hooks scripts may be changed. We need to refresh its status before

Re: [libvirt] [PATCH 11/17] Fix leak in qemuStringToArgvEnv upon OOM

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The 'qemuStringToArgvEnv' method splits up a string of command line env/args to an 'arglist' array. It then copies env vars to a 'progenv' array and args to a 'progargv' array. When copyin the env

Re: [libvirt] [PATCH 12/17] Fix leak in qemuParseCommandLine on OOM

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If the call to virDomainControllerInsert fails in qemuParseCommandLine, the controller struct is leaked. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_command.c | 4

Re: [libvirt] [PATCH 09/17] Fix leak in qemuParseCommandLineDisk on OOM

2013-09-25 Thread Daniel P. Berrange
On Tue, Sep 24, 2013 at 04:24:43PM -0500, Doug Goldstein wrote: On Tue, Sep 24, 2013 at 11:03 AM, Daniel P. Berrange berra...@redhat.com wrote: From: Daniel P. Berrange berra...@redhat.com If OOM occurs in qemuParseCommandLineDisk some intermediate variables will be leaked when parsing

Re: [libvirt] [PATCH v3 1/4] iptablesFormatNetwork(): constify target of netaddr parameter

2013-09-25 Thread Laine Stump
On 09/24/2013 09:03 AM, Laszlo Ersek wrote: On 09/24/13 10:46, Laine Stump wrote: On 09/23/2013 08:03 PM, Laszlo Ersek wrote: ... and adapt functions that would cast away the new const qualifier. Given typedef virSocketAddr *virSocketAddrPtr; Compare the parse trees of the following two

Re: [libvirt] [PATCH 14/17] Fix leak of char device in xenParseXM

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If an OOM occurs in xenParseXM, a virDomainChrDef may be leaked. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/xenxs/xen_xm.c | 4 +++- 1 file changed, 3 insertions(+), 1

Re: [libvirt] [PATCH 13/17] Fix leak of command line args in qemuParseCommandLine

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If qemuParseCommandLine finds an arg it does not understand it adds it to the QEMU passthrough custom arg list. If the qemuParseCommandLine method hits an error for any reason though, it just does

Re: [libvirt] [PATCH 15/17] Fix crash on OOM in xenParseXM handling consoles

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The xenParseXM sets def-nconsoles to 1 before claling VIR_REALLOC_N on def-consoles. So if the alloc fails due to OOM, the cleanup code will crash accessing a console that does not exist.

Re: [libvirt] [PATCH 17/17] Fix leak of serial value in xenFormatXM on OOM

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If an OOM occurs in xenFormatXM when formatting to the serial device value, the value is leaked. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/xenxs/xen_xm.c | 4 +++- 1 file

Re: [libvirt] [PATCH 16/17] Fix broken formatting on OOM in xenFormatXM

2013-09-25 Thread Ján Tomko
On 09/24/2013 06:04 PM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If an OOM occurs when xenFormatXM is setting the 'hpet' variable it is silently ignored. Fix it to propagate to the callers. Signed-off-by: Daniel P. Berrange berra...@redhat.com ---

Re: [libvirt] [Qemu-devel] Attaching PCI devices to the PCIe root complex

2013-09-25 Thread Michael S. Tsirkin
On Wed, Sep 25, 2013 at 11:48:28AM +0300, Marcel Apfelbaum wrote: On Wed, 2013-09-25 at 10:01 +0300, Michael S. Tsirkin wrote: On Tue, Sep 24, 2013 at 06:01:02AM -0400, Laine Stump wrote: When I added support for the Q35-based machinetypes to libvirt, I specifically prohibited attaching

[libvirt] [PATCH]util: Helper function for checking existence of hook files for specific driver

2013-09-25 Thread Chen Hanxiao
From: Chen Hanxiao chenhanx...@cn.fujitsu.com We refresh the status of hook scripts only when start/restart libvirt or reloads its configuration. But hooks scripts may be changed. This function will help to check its existence. And we do not need to start/restart libvirt if we add/remove hook

Re: [libvirt] [PATCH]util: Helper function for checking existence of hook files for specific driver

2013-09-25 Thread Daniel P. Berrange
On Wed, Sep 25, 2013 at 05:50:47PM +0800, Chen Hanxiao wrote: From: Chen Hanxiao chenhanx...@cn.fujitsu.com We refresh the status of hook scripts only when start/restart libvirt or reloads its configuration. But hooks scripts may be changed. This function will help to check its existence.

[libvirt] [PATCH v4 1/2] util/viriptables: add/remove rules that short-circuit masquerading

2013-09-25 Thread Laszlo Ersek
The functions - iptablesAddForwardDontMasquerade(), - iptablesRemoveForwardDontMasquerade handle exceptions in the masquerading implemented in the POSTROUTING chain of the nat table. Such exceptions should be added as chronologically latest, logically top-most rules. The bridge driver will call

[libvirt] [PATCH v4 0/2] don't masquerade local broadcast/multicast packets

2013-09-25 Thread Laszlo Ersek
v2-v4 changes (v3 went in a different direction): - Rename iptables(Add|Remove)ForwardDontMasquerade to iptables(Add|Remove)DontMasquerade [Laine]. Masquerading local broadcast breaks DHCP replies for some clients. There has been a report about broken local multicast too. (See references

[libvirt] [PATCH v4 2/2] bridge driver: don't masquerade local subnet broadcast/multicast packets

2013-09-25 Thread Laszlo Ersek
Packets sent by guests on virbrN, *or* by dnsmasq on the same, to - 255.255.255.255/32 (netmask-independent local network broadcast address), or to - 224.0.0.0/24 (local subnetwork multicast range) are never forwarded, hence it is not necessary to masquerade them. In fact we must not masquerade

Re: [libvirt] [PATCHv2 0/4] Improve passthrough of early errors from qemu log

2013-09-25 Thread Ján Tomko
On 09/24/2013 05:14 PM, Peter Krempa wrote: Version 2 fixed according to review feedback of Jan. Peter Krempa (4): qemu_process: Make qemuProcessReadLog() more versatile and reusable qemu: monitor: Add infrastructure to access VM logs for better err msgs qemu: monitor: Produce

[libvirt] [PATCH] LXC: Detect fs support. Mount only supported fs in containers

2013-09-25 Thread Bogdan Purcareata
Some filesystems - specifically securityfs - are not supported in all systems running libvirt containers. When starting a container, mount only the filesystems that are supported on the host. Detection of filesystem support is done at runtime. Signed-off-by: Bogdan Purcareata

Re: [libvirt] [PATCH v4 1/2] util/viriptables: add/remove rules that short-circuit masquerading

2013-09-25 Thread Laine Stump
On 09/25/2013 06:45 AM, Laszlo Ersek wrote: The functions - iptablesAddForwardDontMasquerade(), - iptablesRemoveForwardDontMasquerade handle exceptions in the masquerading implemented in the POSTROUTING chain of the nat table. Such exceptions should be added as chronologically latest,

Re: [libvirt] [PATCH v4 2/2] bridge driver: don't masquerade local subnet broadcast/multicast packets

2013-09-25 Thread Laine Stump
On 09/25/2013 06:45 AM, Laszlo Ersek wrote: Packets sent by guests on virbrN, *or* by dnsmasq on the same, to - 255.255.255.255/32 (netmask-independent local network broadcast address), or to - 224.0.0.0/24 (local subnetwork multicast range) are never forwarded, hence it is not necessary to

Re: [libvirt] [PATCH] virsh-domain: Free dom before return false in cmdDump

2013-09-25 Thread Ján Tomko
On 09/25/2013 07:49 AM, Hongwei Bi wrote: --- tools/virsh-domain.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 856e888..f6d4edd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4487,8

Re: [libvirt] [PATCH] virsh-domain: Free dom before return false in cmdDump

2013-09-25 Thread Hongwei Bi
Yes, 'goto cleanup' would be better. 2013/9/25 Hongwei Bi hwbi2...@gmail.com Yes, 'goto cleanup' would be better. 2013/9/25 Ján Tomko jto...@redhat.com On 09/25/2013 07:49 AM, Hongwei Bi wrote: --- tools/virsh-domain.c |4 +++- 1 files changed, 3 insertions(+), 1

Re: [libvirt] [PATCH] virsh-domain: Free dom before return false in cmdDump

2013-09-25 Thread Peter Krempa
On 09/25/13 13:23, Ján Tomko wrote: On 09/25/2013 07:49 AM, Hongwei Bi wrote: --- tools/virsh-domain.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 856e888..f6d4edd 100644 --- a/tools/virsh-domain.c +++

Re: [libvirt] [PATCHv2 0/4] Improve passthrough of early errors from qemu log

2013-09-25 Thread Peter Krempa
On 09/25/13 12:45, Ján Tomko wrote: On 09/24/2013 05:14 PM, Peter Krempa wrote: Version 2 fixed according to review feedback of Jan. Peter Krempa (4): qemu_process: Make qemuProcessReadLog() more versatile and reusable qemu: monitor: Add infrastructure to access VM logs for better err

[libvirt] regarding libvirt development.

2013-09-25 Thread cooldharma06
hi, i wish to give my contribution for the libvirt development. Any guide or documentation available for libvirt development. Or Any suggestions you have about the development means, please guide me. Regards cooldharma06 -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH 5/6] qemu: turn if into switch in qemuDomainValidateDevicePCISlotsQ35

2013-09-25 Thread Laine Stump
This will make it simpler to add checks for other types of controllers. This is a prerequisite for patches to resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 --- src/qemu/qemu_command.c | 41 +++-- 1 file changed, 23 insertions(+), 18

[libvirt] [PATCH 1/6] qemu: eliminate redundant if clauses in qemuCollectPCIAddress

2013-09-25 Thread Laine Stump
Replace them with switch cases. This will make it more efficient when we add exceptions more controller types, and other device types. This is a prerequisite for patches to resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 --- src/qemu/qemu_command.c | 57

[libvirt] [PATCH 0/6] Several Q35 related tweaks

2013-09-25 Thread Laine Stump
These patches are all in response to the issues that Gerd Hoffman raised in https://bugzilla.redhat.com/show_bug.cgi?id=1003983 Three of the six are simple refactoring of existing code, done separately so that the patches that change functionality would be simpler to review. None of them is

[libvirt] [PATCH 2/6] qemu: allow some PCI devices to be attached to PCIe slots

2013-09-25 Thread Laine Stump
Part of the resolution to: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 Although most devices available in qemu area defined as PCI devices, and strictly speaking should only be attached via a PCI slot, in practice qemu allows them to be attached to a PCIe slot and sometimes this makes

[libvirt] [PATCH 3/6] qemu: replace multiple strcmps with a switch on an enum

2013-09-25 Thread Laine Stump
I'm not sure why this code was written to compare the strings that it had just retrieved from an enum-string conversion, rather than just look at the original enum values, but this yields the same results, and is much more efficient (especially as you add more devices). This is a prerequisite for

[libvirt] [PATCH 6/6] qemu: prefer to put a Q35 machine's dmi-to-pci-bridge at 00:1E.0

2013-09-25 Thread Laine Stump
This resolves one of the issues listed in: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 00:1E.0 is the location of this controller on at least some actual Q35 hardware, so we try to replicate the placement. The bridge should work just as well in any other location though, so if 00:1E.0

[libvirt] [PATCH 4/6] qemu: support ich9-intel-hda audio device

2013-09-25 Thread Laine Stump
This resolves one of the issues in: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 This device is identical to qemu's intel-hda device (known as ich6 in libvirt), but has a different PCI device ID (which matches the ID of the hda audio built into the ich9 chipset, of course). It's not

Re: [libvirt] [PATCH 5/6] qemu: turn if into switch in qemuDomainValidateDevicePCISlotsQ35

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: This will make it simpler to add checks for other types of controllers. This is a prerequisite for patches to resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 --- src/qemu/qemu_command.c | 41

Re: [libvirt] [PATCH 1/6] qemu: eliminate redundant if clauses in qemuCollectPCIAddress

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: Replace them with switch cases. This will make it more efficient when we add exceptions more controller types, and other device types. s/more/for more/ This is a prerequisite for patches to resolve:

Re: [libvirt] [PATCH 3/6] qemu: replace multiple strcmps with a switch on an enum

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: I'm not sure why this code was written to compare the strings that it had just retrieved from an enum-string conversion, rather than just look at the original enum values, but this yields the same results, and is much more efficient (especially as you

Re: [libvirt] [PATCH 2/6] qemu: allow some PCI devices to be attached to PCIe slots

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: Part of the resolution to: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 Although most devices available in qemu area defined as PCI devices, and strictly speaking should only be attached via a PCI slot, in practice qemu allows them to

Re: [libvirt] [PATCH 6/6] qemu: prefer to put a Q35 machine's dmi-to-pci-bridge at 00:1E.0

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: This resolves one of the issues listed in: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 00:1E.0 is the location of this controller on at least some actual Q35 hardware, so we try to replicate the placement. The bridge should work just

Re: [libvirt] [PATCH 4/6] qemu: support ich9-intel-hda audio device

2013-09-25 Thread Ján Tomko
On 09/25/2013 02:30 PM, Laine Stump wrote: This resolves one of the issues in: https://bugzilla.redhat.com/show_bug.cgi?id=1003983 This device is identical to qemu's intel-hda device (known as ich6 in libvirt), but has a different PCI device ID (which matches the ID of the hda audio

Re: [libvirt] regarding libvirt development.

2013-09-25 Thread Eric Blake
On 09/24/2013 11:39 PM, cooldharma06 wrote: hi, i wish to give my contribution for the libvirt development. Any guide or documentation available for libvirt development. Or Any suggestions you have about the development means, please guide me. Welcome! http://libvirt.org/hacking.html

Re: [libvirt] [PATCH 0/6] Several Q35 related tweaks

2013-09-25 Thread Laine Stump
On 09/25/2013 08:30 AM, Laine Stump wrote: These patches are all in response to the issues that Gerd Hoffman raised in https://bugzilla.redhat.com/show_bug.cgi?id=1003983 Three of the six are simple refactoring of existing code, done separately so that the patches that change

[libvirt] [PATCH 01/23] Fix crash on OOM in xenParseSxpr

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The xenParseSxpr method sets def-nconsoles to 1 before allocating the def-consoles array. If the allocation fails due to OOM the cleanup code will thus crash accessing out of bounds. Signed-off-by: Daniel P. Berrange berra...@redhat.com ---

[libvirt] [PATCH 05/23] Don't clobber 'ret' in LXC XML test case

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The testCompareXMLToXMLHelper method clobbered the 'ret' variable in several places leading to a failure to report OOM errors from the test suite. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/lxcxml2xmltest.c | 13 + 1

[libvirt] [PATCH 02/23] Fix handling of OOM when getting Xen dom ID

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The methods for obtaining the Xen dom ID cannot distinguish between returning -1 due to an error and returning -1 due to the domain being shutoff. Change them to return the dom ID via an output parameter. Signed-off-by: Daniel P. Berrange

[libvirt] [PATCH 14/23] Fix leak in virLockSpaceResourceFree

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Normally a lockspace resource is not freed while there are active owners. During initial resource creation though, an OOM error will trigger this scenario. virLockSpaceResourceFree was not freeing the 'owners' field in this case. Signed-off-by: Daniel

[libvirt] [PATCH 18/23] Avoid uninitialized data in qemuMonitorTestNew

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virDomainChrSourceDef variable should be memset to 0, so that the cleanup block does not free uninitialized data on OOM. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/qemumonitortestutils.c | 4 1 file changed, 4

[libvirt] [PATCH 17/23] Avoid double free in qemuMonitorCommonTestInit on OOM

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The qemuMonitorCommonTestInit method did not allocate the test object, so it should not free it upon failure. Doing so causes a double free with the caller. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/qemumonitortestutils.c | 1 -

[libvirt] [PATCH 04/23] Fix crash on OOM in virDomainSnapshotDefParse

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virDomainSnapshotDefParse method assigned to def-ndisks before allocating def-disks. Thus if an OOM occurred, the cleanup code would access out of bounds. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/conf/snapshot_conf.c | 4 ++--

[libvirt] [PATCH 00/23] Fix yet more OOM errors

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com A nice mix of leaks and crashes and ignoring errors. Daniel P. Berrange (23): Fix crash on OOM in xenParseSxpr Fix handling of OOM when getting Xen dom ID Don't clobber return value in virInterfaceDefParseProtoIPv6 Fix crash on OOM in

[libvirt] [PATCH 10/23] Don't print all test suite errors to stderr in vmx2xmltest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The vmx2xmltest test would print all errors to stderr, which is not helpful when running OOM tests, and differs from the behaviour of other tests. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/vmx2xmltest.c | 51

[libvirt] [PATCH 12/23] Fix double-free in virJSONParserHandleStartMap on OOM

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If OOM occurs in virJSONParserHandleStartMap it will free a variable that is owned by another object. This leads to a later double-free. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/util/virjson.c | 1 - 1 file changed, 1 deletion(-)

[libvirt] [PATCH 06/23] Fix double free of hostdev on OOM in xenParseSxprPCI

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If xenParseSxprPCI failed to expand the def-hostdevs array due to OOM, it would free the hostdev instance twice. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/xenxs/xen_sxpr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

[libvirt] [PATCH 16/23] Fix leak on OOM in qemuMonitorCommonTestNew

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Don't leak the path string in qemuMonitorCommonTestNew if an OOM occurs. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/qemumonitortestutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemumonitortestutils.c

[libvirt] [PATCH 23/23] Avoid use of uninitialized data in virnetmessagetest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If an error occurs in virnetmessagetest it was possible it would free uninitialized data. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virnetmessagetest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 09/23] Fix leak of comment string if virConfAddEntry fails on OOM

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The code parsing comments in config files called virConfAddEntry but did not check for failure. This caused the comment string to leak on OOM. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/util/virconf.c | 5 - 1 file changed, 4

[libvirt] [PATCH 08/23] Add missing check for OOM with virVMXEscapeHexPipe

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virVMXFormatConfig called virVMXEscapeHexPipe but forgot to check for OOM. This caused data to silently be lost. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/vmx/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[libvirt] [PATCH 19/23] Avoid crash on OOM in virbuftest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virbuftest code did not check virBufferError before accessing the buffer contents, resulting in a crash on OOM conditions. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virbuftest.c | 14 ++ 1 file changed, 14

[libvirt] [PATCH 13/23] Fix leak of parser state in virJSONValueFromString

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If OOM or another error occurs in virJSONValueFromString the parser state object will be leaked. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/util/virjson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virjson.c

[libvirt] [PATCH 20/23] Avoid crash on OOM in virlockspacetest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virlockspacetest.c did not check for failure to create a lockspace, causing a crash on OOM Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virlockspacetest.c | 21 ++--- 1 file changed, 14 insertions(+), 7

[libvirt] [PATCH 03/23] Don't clobber return value in virInterfaceDefParseProtoIPv6

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Several places in virInterfaceDefParseProtoIPv6 clobber the default 'ret' return value. So when jumping to cleanup on error, 'ret' may mistakenly be set to 0 instead of -1. This caused failure to report OOM errors, meaning data was silently lost during

[libvirt] [PATCH 21/23] Avoid crash on OOM in virportallocatortest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virportallocatortest did not check if the object allocation failed in all cases. This lead to a crash on OOM in the testsuite Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virportallocatortest.c | 6 ++ 1 file changed, 6

[libvirt] [PATCH 22/23] Avoid crash on OOM in virnetmessagetest

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virnetmessagetest code did not check for failure to allocate the message object. This lead to a crash on OOM in the test suite. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virnetmessagetest.c | 6 ++ 1 file changed, 6

[libvirt] [PATCH 11/23] Fix leak of iterators in virDBusMessageIterEncode

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com If virDBusMessageIterEncode hits an OOM condition it often leaks the memory associated with the dbus iterator object Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/util/virdbus.c | 24 +--- 1 file changed, 21

[libvirt] [PATCH 07/23] Fix crash on OOM parsing storage pool XML

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The virStoragePoolDefParseSource method would set def-nhosts before allocating def-hosts. If the allocation failed due to OOM, the cleanup code would crash accessing out of bounds. Signed-off-by: Daniel P. Berrange berra...@redhat.com ---

[libvirt] [PATCH 15/23] Don't ignore errors parsing nwfilter rules

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com For inexplicable reasons, the nwfilter XML parser is intentionally ignoring errors that arise during parsing. As well as meaning that users don't get any feedback on their XML mistakes, this will lead it to silently drop data in OOM conditions.

[libvirt] [PATCH] virsh-domain: Add a missing check and fix leak in cmdScreenshot

2013-09-25 Thread Hongwei Bi
--- tools/virsh-domain.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 856e888..7fe42df 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4610,7 +4610,8 @@ cmdScreenshot(vshControl *ctl, const vshCmd

Re: [libvirt] [PATCH] LXC: Detect fs support. Mount only supported fs in containers

2013-09-25 Thread Doug Goldstein
On Wed, Sep 25, 2013 at 5:49 AM, Bogdan Purcareata bogdan.purcare...@freescale.com wrote: Some filesystems - specifically securityfs - are not supported in all systems running libvirt containers. When starting a container, mount only the filesystems that are supported on the host. Detection of

Re: [libvirt] [PATCH 2/3] conf: Refactor storing and usage of feature flags

2013-09-25 Thread Ján Tomko
On 09/24/2013 10:43 AM, Peter Krempa wrote: To allow a finer control for some future flags, refactor the code to store them in an array instead of a bitmap. --- src/conf/domain_conf.c | 166 ++--- src/conf/domain_conf.h | 2 +-

Re: [libvirt] [PATCH RFC 3/3] qemu: Add support for paravirtual spinlocks in the guest

2013-09-25 Thread Ján Tomko
On 09/24/2013 10:43 AM, Peter Krempa wrote: The linux kernel recently added support for paravirtual spinlock handling to avoid performance regressions on overcomitted hosts. This feature needs to be turned in the hypervisor so that the guest OS is s/turned in/turned on in/ notified about the

Re: [libvirt] [PATCH 1/3] schema: Rename option to make it reusable

2013-09-25 Thread Ján Tomko
On 09/24/2013 10:43 AM, Peter Krempa wrote: --- docs/schemas/domaincommon.rng | 8 1 file changed, 4 insertions(+), 4 deletions(-) ACK Jan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] virsh-domain: Add a missing check and fix leak in cmdScreenshot

2013-09-25 Thread Eric Blake
On 09/25/2013 08:54 AM, Hongwei Bi wrote: --- tools/virsh-domain.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) @@ -4620,7 +4621,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) if (!file) { if (!(file=vshGenFileName(ctl, dom, mime))) I fixed

Re: [libvirt] [PATCH 05/23] Don't clobber 'ret' in LXC XML test case

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The testCompareXMLToXMLHelper method clobbered the 'ret' variable in several places leading to a failure to report OOM errors from the test suite. Signed-off-by: Daniel P. Berrange

[libvirt] [PATCH] virsh: Fix domdisplay when domain only uses TLS

2013-09-25 Thread Christophe Fergeau
It's possible to create a domain which will only use a TLS port and will not have a non-TLS port set by using: graphics type='spice' autoport='yes' defaultMode='secure'/ In such a setup, the 'graphics' node for the running domain will be: graphics type='spice' tlsPort='5900'

Re: [libvirt] [PATCH 10/23] Don't print all test suite errors to stderr in vmx2xmltest

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The vmx2xmltest test would print all errors to stderr, which is not helpful when running OOM tests, and differs from the behaviour of other tests. Signed-off-by: Daniel P. Berrange

Re: [libvirt] [PATCH RFC 3/3] qemu: Add support for paravirtual spinlocks in the guest

2013-09-25 Thread Doug Goldstein
On Tue, Sep 24, 2013 at 3:43 AM, Peter Krempa pkre...@redhat.com wrote: The linux kernel recently added support for paravirtual spinlock handling to avoid performance regressions on overcomitted hosts. This feature needs to be turned in the hypervisor so that the guest OS is notified about the

[libvirt] libvirt-glib fails to compile with CLANG compiler

2013-09-25 Thread Jason Helfman
When compiling libvirt-glib with CLANG, I get the following error. 16 warnings generated. CCLD libvirt-glib-1.0.la GEN LibvirtGLib-1.0.gir /usr/local/lib/libvirt.so: undefined reference to `__stack_chk_fail_local' clang: error: linker command failed with exit code 1 (use -v to see

Re: [libvirt] [PATCH 11/23] Fix leak of iterators in virDBusMessageIterEncode

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If virDBusMessageIterEncode hits an OOM condition it often leaks the memory associated with the dbus iterator object Signed-off-by: Daniel P. Berrange berra...@redhat.com --- cleanup: +

Re: [libvirt] [PATCH 15/23] Don't ignore errors parsing nwfilter rules

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com For inexplicable reasons, the nwfilter XML parser is intentionally ignoring errors that arise during parsing. As well as meaning that users don't get any feedback on their XML mistakes, this will

Re: [libvirt] [PATCH 20/23] Avoid crash on OOM in virlockspacetest

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The virlockspacetest.c did not check for failure to create a lockspace, causing a crash on OOM Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virlockspacetest.c | 21

Re: [libvirt] [PATCH 23/23] Avoid use of uninitialized data in virnetmessagetest

2013-09-25 Thread Eric Blake
On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If an error occurs in virnetmessagetest it was possible it would free uninitialized data. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/virnetmessagetest.c | 3 ++- 1 file

Re: [libvirt] [PATCH 11/23] Fix leak of iterators in virDBusMessageIterEncode

2013-09-25 Thread Daniel P. Berrange
On Wed, Sep 25, 2013 at 10:45:00AM -0600, Eric Blake wrote: On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If virDBusMessageIterEncode hits an OOM condition it often leaks the memory associated with the dbus iterator object

Re: [libvirt] [PATCH 11/23] Fix leak of iterators in virDBusMessageIterEncode

2013-09-25 Thread Eric Blake
On 09/25/2013 10:54 AM, Daniel P. Berrange wrote: On Wed, Sep 25, 2013 at 10:45:00AM -0600, Eric Blake wrote: On 09/25/2013 08:51 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If virDBusMessageIterEncode hits an OOM condition it often leaks the memory associated

Re: [libvirt] [PATCH] spec: Only distribute ChangeLog in -devel package

2013-09-25 Thread Cole Robinson
On 09/04/2013 11:18 AM, Eric Blake wrote: On 09/04/2013 09:11 AM, Daniel P. Berrange wrote: client: COPYING COPYING.LESSER daemon: none other[*]: AUTHORS ChangeLog.gz NEWS README TODO where I have yet another question: should the other package be libvirt-docs or libvirt-devel? Your patch

[libvirt] [PATCH 2/4] Remove existing OOM test impl

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/testutils.c | 188 +++--- 1 file changed, 22 insertions(+), 166 deletions(-) diff --git a/tests/testutils.c b/tests/testutils.c index

[libvirt] [PATCH 0/4] Rewrite the test OOM checking code

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com This rewrites the OOM checking code to be much much much more scalable. Instead of looping running 'main' multiple times, we loop running 'virtTestRun' multiple times. Although the overall number of mallocs to be checked is basically the same, checking

[libvirt] [PATCH 1/4] Don't clobber 'ret' variable in testCompareXMLToXMLHelper

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The qemuxml2xmltest.c function testCompareXMLToXMLHelper would clobber the 'ret' variable causing it to mis-diagnose OOM errors. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- tests/qemuxml2xmltest.c | 23 +-- 1 file

[libvirt] [PATCH 4/4] Introduce new OOM testing support

2013-09-25 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The previous OOM testing support would re-run the entire main method each iteration, failing a different malloc each time. When a test suite has 'n' allocations, the number of repeats requires is (n * (n + 1) ) / 2. This gets very large, very

[libvirt] [PATCH] spec: Clean up distribution of ChangeLog (and others)

2013-09-25 Thread Cole Robinson
- Move COPYING* to libvirt-client, so every package pulls them in - Move AUTHORS ChangeLog.gz NEWS README TODO from -daemon to -docs - Drop duplicate distribution of docs in -python --- libvirt.spec.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in

Re: [libvirt] [PATCH v2 1/9] test: Allow specifying object runstate in driver XML

2013-09-25 Thread Cole Robinson
On 08/30/2013 12:43 PM, Eric Blake wrote: On 08/30/2013 10:03 AM, Cole Robinson wrote: When passing in custom driver XML, allow a block like domain xmlns:test='http://libvirt.org/schemas/domain/test/1.0' ... test:runstate5/test:runstate Since the enum virDomainState is part of our

Re: [libvirt] [PATCH] spec: Clean up distribution of ChangeLog (and others)

2013-09-25 Thread Eric Blake
On 09/25/2013 11:23 AM, Cole Robinson wrote: - Move COPYING* to libvirt-client, so every package pulls them in - Move AUTHORS ChangeLog.gz NEWS README TODO from -daemon to -docs - Drop duplicate distribution of docs in -python --- libvirt.spec.in | 6 +++--- 1 file changed, 3 insertions(+),

  1   2   >