Re: [Qemu-devel] the whole virtual machine hangs when IO does not come back!

2014-08-17 Thread Paolo Bonzini
Il 11/08/2014 13:39, Gonglei (Arei) ha scritto: >> I think the VM hangs there because the VCPU thread holds the global >> qemu metux lock and waits for IO to come back. However, in my test, the >> IO doesn't come back (because of the multipath software). Therefore, the >> VCPU thread never releas

Re: [Qemu-devel] [PATCH] qemu-nbd: NULL nbd export pointer dereference after kill (TERMINATE)

2014-08-17 Thread Paolo Bonzini
Il 09/08/2014 05:33, Zhang Haoyu ha scritto: > After receive TERMINATE signal, qemu nbd state is set to TERMINATE, then in > the main loop, > nbd_export_close -> nbd_export_put is performed, but sometimes exp->refcount > still greater than zero after nbd_export_put, > so the qemu nbd state has n

Re: [Qemu-devel] [PATCH] qom-test: blacklist xenigd

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 06:33:10PM +0200, Andreas Färber wrote: > Am 14.08.2014 18:02, schrieb Michael S. Tsirkin: > > Patch > > xen:hw:i386:pc_piix: introduce new machine for IGD passthrough > > adds a new machine type. > > Blacklist it since it forces xen accel. > > > > Cc: Tiejun Chen > >

Re: [Qemu-devel] [PATCH v4 07/11] libqos: Added basic virtqueue support to virtio implementation

2014-08-17 Thread Paolo Bonzini
Il 13/08/2014 23:59, Marc Marí ha scritto: > If it is not dereferenced, it can work. But all references will have to > be casted from (void *) to (uint64_t) always which is what readl and > writel expect. I think this is better than calculating the addresses, > but is still a bit ugly. It would al

[Qemu-devel] [PATCH] monitor: fix use after free

2014-08-17 Thread Michael S. Tsirkin
The function monitor_fdset_dup_fd_find_remove() references member of 'mon_fdset' which - when remove flag is set - may be freed in function monitor_fdset_cleanup(). remove is set by monitor_fdset_dup_fd_remove which in practice does not need the returned value, so make it void, and return -1 from m

Re: [Qemu-devel] [PATCH v6 02/10] monitor: fix access freed memory

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 02:25:51PM -0400, Luiz Capitulino wrote: > On Thu, 14 Aug 2014 12:30:10 +0200 > "Michael S. Tsirkin" wrote: > > > On Thu, Aug 14, 2014 at 03:29:13PM +0800, zhanghailiang wrote: > > > The function monitor_fdset_dup_fd_find_remove() references member of > > > 'mon_fdset' >

Re: [Qemu-devel] [PATCH 2/2] i386: Add a Virtual Machine Generation ID device.

2014-08-17 Thread Paolo Bonzini
Il 12/08/2014 10:02, Gal Hammer ha scritto: > Hi, > > On 10/08/2014 20:22, Paolo Bonzini wrote: > >> Il 10/08/2014 13:32, Gal Hammer ha scritto: >>> Based on Microsoft's sepecifications (paper can be dowloaded from >>> http://go.microsoft.com/fwlink/?LinkId=260709), add a device >>> description t

Re: [Qemu-devel] Microcheckpointing: Memory-VCPU / Disk State consistency

2014-08-17 Thread Paolo Bonzini
Il 11/08/2014 22:15, Michael R. Hines ha scritto: > Excellent question: QEMU does have a feature called "drive-mirror" > in block/mirror.c that was introduced a couple of years ago. I'm not > sure what the > adoption rate of the feature is, but I would start with that one. block/mirror.c is asynch

Re: [Qemu-devel] [PATCH v6 02/10] monitor: fix access freed memory

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 02:25:51PM -0400, Luiz Capitulino wrote: > On Thu, 14 Aug 2014 12:30:10 +0200 > "Michael S. Tsirkin" wrote: > > > On Thu, Aug 14, 2014 at 03:29:13PM +0800, zhanghailiang wrote: > > > The function monitor_fdset_dup_fd_find_remove() references member of > > > 'mon_fdset' >

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-17 Thread Michael S. Tsirkin
On Fri, Aug 15, 2014 at 07:33:29AM +, Gonglei (Arei) wrote: > Hi, > > I noticed that the qemu-2.1 release change log says > " PCIe: Basic hot-plug/hot-unplug support for Q35 machine." > And then I made a testing for the hotplugging function of Q35. > But I'm failed, and I got the dmesg log in

Re: [Qemu-devel] [PATCH v4 3/8] intel-iommu: add DMAR table to ACPI tables

2014-08-17 Thread Michael S. Tsirkin
On Sat, Aug 16, 2014 at 01:55:39PM +0800, Le Tan wrote: > Expose Intel IOMMU to the BIOS. If object of TYPE_INTEL_IOMMU_DEVICE exists, > add DMAR table to ACPI RSDT table. For now the DMAR table indicates that there > is only one hardware unit without INTR_REMAP capability on the platform. > > Sig

Re: [Qemu-devel] [PATCH v4 0/8] intel-iommu: introduce Intel IOMMU (VT-d) emulation to q35 chipset

2014-08-17 Thread Michael S. Tsirkin
On Sat, Aug 16, 2014 at 01:55:36PM +0800, Le Tan wrote: > Hi, > > These patches are intended to introduce Intel IOMMU (VT-d) emulation to q35 > chipset. The major job in these patches is to add support for emulating Intel > IOMMU according to the VT-d specification, including basic responses to CS

Re: [Qemu-devel] [PATCH v4 3/8] intel-iommu: add DMAR table to ACPI tables

2014-08-17 Thread Andreas Färber
Am 17.08.2014 13:07, schrieb Michael S. Tsirkin: > On Sat, Aug 16, 2014 at 01:55:39PM +0800, Le Tan wrote: >> Expose Intel IOMMU to the BIOS. If object of TYPE_INTEL_IOMMU_DEVICE exists, >> add DMAR table to ACPI RSDT table. For now the DMAR table indicates that >> there >> is only one hardware un

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-17 Thread Marcel Apfelbaum
On Sun, 2014-08-17 at 13:00 +0200, Michael S. Tsirkin wrote: > On Fri, Aug 15, 2014 at 07:33:29AM +, Gonglei (Arei) wrote: > > Hi, > > > > I noticed that the qemu-2.1 release change log says > > " PCIe: Basic hot-plug/hot-unplug support for Q35 machine." > > And then I made a testing for the h

Re: [Qemu-devel] [PATCH v2] target-sparc64: implement Short Floating-Point Store Instructions

2014-08-17 Thread Mark Cave-Ayland
On 13/08/14 17:38, Richard Henderson wrote: On 08/12/2014 10:02 AM, Artyom Tarasenko wrote: Implement Short Floating-Point Store Instructions as described in the chapter 13.5.2 of UltraSPARC-IIi User's Manual. Particularly this instructions are used by NetBSD 4.0.1+ /sparc64 Signed-off-by: Ar

[Qemu-devel] [PULL] qemu-sparc updates

2014-08-17 Thread Mark Cave-Ayland
Hi Peter, I've updated my qemu-sparc branch with the latest set of SPARC64 fixes. Please pull. ATB, Mark. The following changes since commit f2c85a2f36f57f155cda7bc9f7c42b44f1a2439e: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2014-08-15 17:43:51 +0100) ar

[Qemu-devel] [PATCH v3 2/2] hw/arm/vexpress: add SP810 to the vexpress

2014-08-17 Thread Fabian Aggeler
The SP810, which is present in the Versatile Express motherboards, allows to set the timing reference to either REFCLK or TIMCLK. QEMU currently sets the SP804 timer to 1MHz by default. To reflect this, we set the TimerEn0Sel, TimerEn1Sel, TimerEn2Sel, and TimerEn3Sel of the system control register

[Qemu-devel] [PATCH v3 0/2] Add SP810 to Versatile Express boards

2014-08-17 Thread Fabian Aggeler
Hi, The Versatile Express emulation in QEMU currently does not have a model of the SP810 used in real hardware. The registers provided by this System Controller can be used to set the frequency of the SP804 timers. On newer releases of the board the SP804 is set to 32kHz by default and has to be i

[Qemu-devel] [PATCH v3 1/2] hw/misc/arm_sp810: Create SP810 device

2014-08-17 Thread Fabian Aggeler
This adds a device model for the PrimeXsys System Controller (SP810) which is present in the Versatile Express motherboards. It is so far read-only but allows to read the SCCTRL register. Signed-off-by: Fabian Aggeler --- default-configs/arm-softmmu.mak | 1 + hw/misc/Makefile.objs |

Re: [Qemu-devel] [PATCH memory v1 1/1] memory: remove may_overlap property

2014-08-17 Thread Paolo Bonzini
Il 15/08/2014 09:17, Peter Crosthwaite ha scritto: > In a5e1cbc80e88ed7d73b3fcb46053a3ba167293fc the enforcement of Memory > collisions was disabled. This means that the MemoryRegion map_overlap > state is unused. Remove it completely. > > The commit mentions that it should be fixed, but we have b

Re: [Qemu-devel] [PATCH memory v1 0/5] MemoryRegion Name QOMification

2014-08-17 Thread Paolo Bonzini
Il 15/08/2014 08:53, Peter Crosthwaite ha scritto: > Hi Paolo, > > Another piece to the Memory Region QOMification puzzle. This series gets > rid of the name field of MemoryRegion and converts all users to the QOM > managed Object name. > > Regards, > Peter > > > Peter Crosthwaite (5): > load

Re: [Qemu-devel] [PATCH memory v1 1/1] memory: remove may_overlap property

2014-08-17 Thread Peter Maydell
On 15 August 2014 08:17, Peter Crosthwaite wrote: > In a5e1cbc80e88ed7d73b3fcb46053a3ba167293fc the enforcement of Memory > collisions was disabled. This means that the MemoryRegion map_overlap > state is unused. Remove it completely. > > The commit mentions that it should be fixed, but we have be

Re: [Qemu-devel] [PATCH memory v1 1/1] memory: remove may_overlap property

2014-08-17 Thread Paolo Bonzini
Il 18/08/2014 00:23, Peter Maydell ha scritto: > Um. I think in general colliding memory regions imply a bug in the > machine model which is creating them. We have the collisions > disabled because nobody's got round to fixing this bug in the > PC model yet and it happens to be harmless there. I'm

Re: [Qemu-devel] [PATCH memory v1 1/1] memory: remove may_overlap property

2014-08-17 Thread Peter Crosthwaite
On Mon, Aug 18, 2014 at 8:23 AM, Peter Maydell wrote: > On 15 August 2014 08:17, Peter Crosthwaite > wrote: >> In a5e1cbc80e88ed7d73b3fcb46053a3ba167293fc the enforcement of Memory >> collisions was disabled. This means that the MemoryRegion map_overlap >> state is unused. Remove it completely.

Re: [Qemu-devel] [PATCH v6 06/10] slirp/misc: Use g_malloc() instead of malloc()

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:31, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 03:29:17PM +0800, zhanghailiang wrote: Here we don't check the return value of malloc() which may fail. Use the g_malloc() instead, which will abort the program when there is not enough memory. Signed-off-by: zhanghailiang Re

Re: [Qemu-devel] [PATCH v6 08/10] tests/bios-tables-test: check the value returned by fopen()

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:32, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 03:29:19PM +0800, zhanghailiang wrote: The function fopen() may fail, so check its return value. Signed-off-by: zhanghailiang Signed-off-by: Li Liu Reviewed-by: Alex Bennée --- tests/bios-tables-test.c | 5 + 1 file ch

Re: [Qemu-devel] [PATCH] mlock: fix bug when mlockall called before mbind

2014-08-17 Thread zhanghailiang
On 2014/8/14 17:56, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 05:09:00PM +0800, zhanghailiang wrote: On 2014/8/14 15:15, Hu Tao wrote: On Thu, Aug 14, 2014 at 02:31:41PM +0800, zhanghailiang wrote: On 2014/8/13 19:50, Michael S. Tsirkin wrote: On Wed, Aug 13, 2014 at 07:21:57PM +0800,

Re: [Qemu-devel] [PATCH 2/3] net: Flush queues when runstate changes back to running

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:05, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 02:13:57PM +0800, zhanghailiang wrote: When the runstate changes back to running, we definitely need to flush queues to get packets flowing again. Here we implement this in the net layer: (1) add a member 'VMChangeStateEntry

Re: [Qemu-devel] [PATCH 2/3] net: Flush queues when runstate changes back to running

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:09, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 02:13:57PM +0800, zhanghailiang wrote: When the runstate changes back to running, we definitely need to flush queues to get packets flowing again. Here we implement this in the net layer: (1) add a member 'VMChangeStateEntry

[Qemu-devel] [PATCH trivial v1 1/2] microblaze: ml605: Get rid of ddr_base variable

2014-08-17 Thread Peter Crosthwaite
It's a constant based on a macro. Just use the macro in place. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_ml605_mmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index aea9c

[Qemu-devel] [PATCH trivial v1 2/2] dma: axidma: Variablise repeated s->streams[i] sub-expr

2014-08-17 Thread Peter Crosthwaite
This have 6 inline usages. Make it a bit more readable by using a local variable. Signed-off-by: Peter Crosthwaite --- Theres three more usages of this in coming patches, that would push the number of usages higher hw/dma/xilinx_axidma.c | 10 ++ 1 file changed, 6 insertions(+), 4 delet

Re: [Qemu-devel] [PATCH v6 10/10] block/vvfat: fix setbuf stream parameter may be NULL

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:36, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 03:29:21PM +0800, zhanghailiang wrote: From: Li Liu fopen() may return NULL which will cause setbuf() segmentfault Signed-off-by: zhanghailiang Signed-off-by: Li Liu --- block/vvfat.c | 5 - 1 file changed, 4 insertio

Re: [Qemu-devel] [questions] about using vfio to assign sr-iov vf to vm

2014-08-17 Thread Zhang Haoyu
>> >> Hi, all >> >> I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, >> >> 82599 PF and its VFs belong to the same iommu_group, but I only want to >> >> assign some VFs to one VM, and some other VFs to another VM, ..., >> >> so how to only unbind (part of) the VFs but PF?

Re: [Qemu-devel] [questions] about using vfio to assign sr-iov vf to vm

2014-08-17 Thread Alex Williamson
On Mon, 2014-08-18 at 09:00 +0800, Zhang Haoyu wrote: > >> >> Hi, all > >> >> I'm using VFIO to assign intel 82599 VF to VM, now I encounter a > >> >> problem, > >> >> 82599 PF and its VFs belong to the same iommu_group, but I only want to > >> >> assign some VFs to one VM, and some other VFs to

[Qemu-devel] [PATCH target-arm v1 1/2] arm: armv7m: Rename address_space_mem -> system_memory

2014-08-17 Thread Peter Crosthwaite
This argument is a MemoryRegion and not an AddressSpace. "Address space" means something quite different to "memory region" in QEMU parlance so rename the variable to reduce confusion. Signed-off-by: Peter Crosthwaite --- hw/arm/armv7m.c | 8 include/hw/arm/arm.h | 2 +- 2 files

[Qemu-devel] [PATCH target-arm v1 2/2] arm: stellaris: Remove misleading address_space_mem var

2014-08-17 Thread Peter Crosthwaite
It's a MemoryRegion and not an AddressSpace. But since it's single use, just inline the get_system_memory() call to the only usage to remove it. Signed-off-by: Peter Crosthwaite --- hw/arm/stellaris.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/

[Qemu-devel] [PATCH target-arm v1 1/1] arm: cortex-a9: Fix cache-line size

2014-08-17 Thread Peter Crosthwaite
Caches are 16 bytes in A9. Self identify in CCSIDR accordingly. QEMU doesn't emulate caches, but we should still report the correct cache-line size to the guest. Some guests (like u-boot) complain if the cache-line size mismatches a requested flush or invalidate operation. Signed-off-by: Peter Cr

Re: [Qemu-devel] [PATCH target-arm v1 1/1] arm: cortex-a9: Fix cache-line size

2014-08-17 Thread Edgar E. Iglesias
On Sun, Aug 17, 2014 at 06:59:59PM -0700, Peter Crosthwaite wrote: > Caches are 16 bytes in A9. Self identify in CCSIDR accordingly. Hi, This is a bit confusing, caches are not 16bytes on the a9, they are configurable. Cache lines are 32 bytes. The reported associativity doesn't match either. Fo

Re: [Qemu-devel] [PATCH target-arm v1 1/1] arm: cortex-a9: Fix cache-line size

2014-08-17 Thread Peter Crosthwaite
On Mon, Aug 18, 2014 at 12:18 PM, Edgar E. Iglesias wrote: > On Sun, Aug 17, 2014 at 06:59:59PM -0700, Peter Crosthwaite wrote: >> Caches are 16 bytes in A9. Self identify in CCSIDR accordingly. > > Hi, > > This is a bit confusing, caches are not 16bytes on the a9, they are > configurable. Sorry

Re: [Qemu-devel] [PATCH target-arm v1 1/1] arm: cortex-a9: Fix cache-line size

2014-08-17 Thread Edgar E. Iglesias
On Mon, Aug 18, 2014 at 12:57:43PM +1000, Peter Crosthwaite wrote: > On Mon, Aug 18, 2014 at 12:18 PM, Edgar E. Iglesias > wrote: > > On Sun, Aug 17, 2014 at 06:59:59PM -0700, Peter Crosthwaite wrote: > >> Caches are 16 bytes in A9. Self identify in CCSIDR accordingly. > > > > Hi, > > > > This is

[Qemu-devel] [PATCH] spapr: Fix stale HTAB during live migration

2014-08-17 Thread Samuel Mendoza-Jonas
If a guest reboots during a running migration, changes to the hash page table are not necessarily updated on the destination. Opening a new file descriptor to the HTAB forces the migration handler to resend the entire table. Signed-off-by: Samuel Mendoza-Jonas --- hw/ppc/spapr.c | 6 ++ 1 fi

Re: [Qemu-devel] [PATCH v3 08/16] target-arm: Add SCR_EL3

2014-08-17 Thread Edgar E. Iglesias
On Wed, Aug 13, 2014 at 09:48:35AM -0500, Greg Bellows wrote: > Hi Edgar, > > I was just writing a test to verify the correct behavior of the SCR AW/FW > bits and I think there is an issue. > > During an SCR write an initial valid mask is set from SCR_MASK which is > defined to not include these

Re: [Qemu-devel] [PATCH v2 2/7] target-arm: Implement PMCCNTR_EL0 and related registers

2014-08-17 Thread Peter Crosthwaite
On Sat, Aug 2, 2014 at 1:28 AM, Peter Maydell wrote: > On 26 June 2014 06:02, Alistair Francis wrote: >> This patch adds support for the ARMv8 version of the PMCCNTR and >> related registers. It also starts to implement the PMCCFILTR_EL0 >> register. >> >> Signed-off-by: Peter Crosthwaite >> Sig

Re: [Qemu-devel] [PATCH v2 3/7] target-arm: Add arm_ccnt_enabled function

2014-08-17 Thread Peter Crosthwaite
On Thu, Jun 26, 2014 at 9:28 PM, Peter Crosthwaite wrote: > On Thu, Jun 26, 2014 at 3:02 PM, Alistair Francis > wrote: >> Include a helper function to determine if the CCNT counter >> is enabled as well as the constants used to mask the pmccfiltr_el0 >> and c9_pmxevtyper registers. >> >> Signed-o

[Qemu-devel] [PATCH V2] spapr: Fix stale HTAB during live migration

2014-08-17 Thread Samuel Mendoza-Jonas
If a guest reboots during a running migration, changes to the hash page table are not necessarily updated on the destination. Opening a new file descriptor to the HTAB forces the migration handler to resend the entire table. Signed-off-by: Samuel Mendoza-Jonas --- Changes in v2: Forgot check on k

[Qemu-devel] [PATCH] net: Forbid dealing with packets when VM is not running

2014-08-17 Thread zhanghailiang
For all NICs(except virtio-net) emulated by qemu, Such as e1000, rtl8139, pcnet and ne2k_pci, Qemu can still receive packets when VM is not running. If this happened in *migration's* last PAUSE VM stage, The new dirty RAM related to the packets will be missed, And this will lead serious network fau

Re: [Qemu-devel] [PATCH 1/2] runner: Add an argument for test duration

2014-08-17 Thread Fam Zheng
On Fri, 08/15 17:55, Maria Kustova wrote: > Signed-off-by: Maria Kustova > --- > tests/image-fuzzer/runner.py | 23 ++- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py > index 3fa7fca..688d470 100

Re: [Qemu-devel] [PATCH v6 06/10] slirp/misc: Use g_malloc() instead of malloc()

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:31, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 03:29:17PM +0800, zhanghailiang wrote: Here we don't check the return value of malloc() which may fail. Use the g_malloc() instead, which will abort the program when there is not enough memory. Signed-off-by: zhanghailiang Re

Re: [Qemu-devel] [PATCH v5 2/2] block/quorum: add simple read pattern support

2014-08-17 Thread Liu Yuan
On Fri, Aug 15, 2014 at 03:59:04PM +0200, Benoît Canet wrote: > The Friday 15 Aug 2014 à 13:05:17 (+0800), Liu Yuan wrote : > > This patch adds single read pattern to quorum driver and quorum vote is > > default > > pattern. > > > > For now we do a quorum vote on all the reads, it is designed for

Re: [Qemu-devel] [PATCH v6 05/10] util/path: Use the GLib memory allocation routines

2014-08-17 Thread zhanghailiang
On 2014/8/14 18:15, Michael S. Tsirkin wrote: On Thu, Aug 14, 2014 at 03:29:16PM +0800, zhanghailiang wrote: In this file, we don't check the return value of malloc/strdup/realloc which may fail. Instead of using these routines, we use the GLib memory APIs g_malloc/g_strdup/g_realloc. They wil

Re: [Qemu-devel] [Qemu-trivial] [PATCH v6 09/10] tcg: check return value of fopen()

2014-08-17 Thread zhanghailiang
On 2014/8/16 0:53, Richard Henderson wrote: On 08/15/2014 05:03 AM, Michael Tokarev wrote: f = fopen("/tmp/op.log", "w"); Gosh. So why are we still use fixed filenames in /tmp? Every such use is a potential security holw... :( Ughm. Can't we get rid of this somehow, by requiring a

Re: [Qemu-devel] [v2 3/3] hmp: fix MemdevList memory leak

2014-08-17 Thread chen.fan.f...@cn.fujitsu.com
On Tue, 2014-08-12 at 12:00 +1000, Peter Crosthwaite wrote: > On Mon, Aug 4, 2014 at 2:21 PM, Chen Fan wrote: > > the memdev_list in hmp_info_memdev() is never freed. > > so we use existent method qapi_free_MemdevList() to free it. > > and also we can use qapi_free_MemdevList() to replace list lo

[Qemu-devel] [RESEND v2 1/3] query-memdev: fix potential memory leaks

2014-08-17 Thread Chen Fan
Signed-off-by: Chen Fan Reviewed-by: Peter Crosthwaite Reviewed-by: Hu Tao --- numa.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/numa.c b/numa.c index c78cec9..aa772aa 100644 --- a/numa.c +++ b/numa.c @@ -318,10 +318,11 @@ void memory_region_allocate_system_memory

[Qemu-devel] [RESEND v2 0/3] Fix some memory leaks about query memdev

2014-08-17 Thread Chen Fan
when using valgrind to test the command "query memdev", I had found some memory leaks. the test result: ==13802== 4 bytes in 1 blocks are definitely lost in loss record 125 of 8,508 ==13802==at 0x4A08934: malloc (vg_replace_malloc.c:291) ==13802==by 0x4A08AA8: realloc (vg_replace_malloc.c:

[Qemu-devel] [RESEND v2 3/3] hmp: fix MemdevList memory leak

2014-08-17 Thread Chen Fan
the memdev_list in hmp_info_memdev() is never freed. so we use existent method qapi_free_MemdevList() to free it. and also we can use qapi_free_MemdevList() to replace list loops to clean up the memdev list in error path. Signed-off-by: Chen Fan Reviewed-by: Peter Crosthwaite Reviewed-by: Hu Tao

[Qemu-devel] [RESEND v2 2/3] qom/object.c: fix string_output_get_string() memory leak

2014-08-17 Thread Chen Fan
string_output_get_string() uses g_string_free(str, false) to transfer the 'str' pointer to callers and never free it. Signed-off-by: Chen Fan Reviewed-by: Peter Crosthwaite Reviewed-by: Hu Tao --- hmp.c| 6 -- qom/object.c | 12 ++-- 2 files changed, 14 insertions(+), 4 d

Re: [Qemu-devel] [PATCH v3] vmdk: improve streamOptimized vmdk support

2014-08-17 Thread Fam Zheng
On Wed, 08/06 17:24, Milos Vyletel wrote: > VMDK's streamOptimized format is different from regular sparse format. > L1(GD) and L2(GT) tables are not predefined but rather generated and > written during image creation mainly because there is no way to tell > how much space data will occupy once the