Re: [Qemu-devel] [PATCH] migrate/cpu-throttle: Add max-cpu-throttle migration parameter

2018-08-02 Thread Li Qiang
2018-08-02 18:47 GMT+08:00 Dr. David Alan Gilbert : > * Li Qiang (liq...@gmail.com) wrote: > > Currently, the default maximum CPU throttle for migration is > > 99(CPU_THROTTLE_PCT_MAX). This is too big and can make a remarkable > > performance effect for the guest. We see a l

[Qemu-devel] [PATCH] migrate/cpu-throttle: Add max-cpu-throttle migration parameter

2018-08-01 Thread Li Qiang
parameter to limit the CPU throttle. Signed-off-by: Li Qiang --- hmp.c | 8 migration/migration.c | 23 ++- migration/migration.h | 1 + migration/ram.c | 4 +++- qapi/migration.json | 21 ++--- 5 files changed, 52 insertions(+), 5

Re: [Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle

2018-07-31 Thread Li Qiang
2018-07-31 23:50 GMT+08:00 Daniel P. Berrangé : > On Tue, Jul 31, 2018 at 04:48:35PM +0200, Juan Quintela wrote: > > "Dr. David Alan Gilbert" wrote: > > > * Li Qiang (liq...@gmail.com) wrote: > > >> The default max cpu throttle is 99, this is too big t

[Qemu-devel] [PATCH 2/3] migration: Add qmp command for migrate_set_max_cpu_throttle

2018-07-31 Thread Li Qiang
The default max cpu throttle is 99, this is too big that may influence the guest loads. Add a qmp to config it can make it more flexible. Signed-off-by: Li Qiang --- cpus.c| 5 + include/qom/cpu.h | 8 migration/migration.c | 10 ++ qapi/migration.json

[Qemu-devel] [PATCH 1/3] migrate: replace the cpu throttle percentage max with a variable

2018-07-31 Thread Li Qiang
So we can config it using qmp. Signed-off-by: Li Qiang --- cpus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index b5844b7103..6569c73d24 100644 --- a/cpus.c +++ b/cpus.c @@ -83,6 +83,8 @@ static unsigned int throttle_percentage; #define

[Qemu-devel] [PATCH 3/3] hmp: add hmp for migrate_set_max_cpu_throttle

2018-07-31 Thread Li Qiang
Signed-off-by: Li Qiang --- hmp-commands.hx | 14 ++ hmp.c | 6 ++ hmp.h | 1 + 3 files changed, 21 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 91dfe51c37..9d54ecbe4e 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1042,6

[Qemu-devel] [PATCH 0/3] Add a new migrate_set_max_cpu_throttle qmp command

2018-07-31 Thread Li Qiang
the CPU throttle. Li Qiang (3): migrate: replace the cpu throttle percentage max with a variable migration: Add qmp command for migrate_set_max_cpu_throttle hmp: add hmp for migrate_set_max_cpu_throttle cpus.c| 9 - hmp-commands.hx | 14 ++ hmp.c

Re: [Qemu-devel] Do I need update the microcode of virtual machine

2018-01-18 Thread Li Qiang
2018-01-18 18:49 GMT+08:00 Daniel P. Berrange : > On Thu, Jan 18, 2018 at 06:38:57PM +0800, Li Qiang wrote: > > Hi Paolo, all, > > > > I have a question about the intel microcode update for spectre variant#2. > > From my understanding, there is no need to update the m

Re: [Qemu-devel] Do I need update the microcode of virtual machine

2018-01-18 Thread Li Qiang
2018-01-18 18:43 GMT+08:00 Paolo Bonzini : > On 18/01/2018 11:38, Li Qiang wrote: > > Hi Paolo, all, > > > > I have a question about the intel microcode update for spectre variant#2. > > From my understanding, there is no need to update the microcode of VMs > &g

[Qemu-devel] Do I need update the microcode of virtual machine

2018-01-18 Thread Li Qiang
n't update the microcode in the guest. If I update the guest micorcode, the are both 1. So I want to know, if I should update the microcode in guest. If the answer is Yes, then what about the Windows guest, how to update the microcode? Thanks, Li Qiang

Re: [Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest

2017-06-13 Thread Li Qiang
2017-06-14 14:30 GMT+08:00 Gerd Hoffmann : > On Tue, 2017-06-13 at 20:39 -0700, Li Qiang wrote: > > From: Li Qiang > > > > In 'xhci_write_event' function, the 'ev_trb' is not full initialized. > > This will lead an info leak issue. This patch avoid

Re: [Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest

2017-06-13 Thread Li Qiang
2017-06-14 11:47 GMT+08:00 : > Hi, > > This series failed automatic build test. Please find the testing commands > and > their output below. If you have docker installed, you can probably > reproduce it > locally. > > > > CC hw/timer/a9gtimer.o > In file included from /tmp/qemu-test/src/hw/

[Qemu-devel] [PATCH] usb: xhci: fix info leak when writing event to the guest

2017-06-13 Thread Li Qiang
From: Li Qiang In 'xhci_write_event' function, the 'ev_trb' is not full initialized. This will lead an info leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/usb/hcd-xhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-

[Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr

2017-04-07 Thread Li Qiang
Free 'orig_value' in error path. Signed-off-by: Li Qiang --- hw/9pfs/9p-xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c index eec160b..d05c1a1 100644 --- a/hw/9pfs/9p-xattr.c +++ b/hw/9pfs/9p-xattr.c @@ -108,6 +108,7 @@ ssize_t v9fs_

Re: [Qemu-devel] [PATCH for-2.9?] 9pfs: fix migration_block leak

2017-03-31 Thread Li Qiang
2017-03-31 15:07 GMT+08:00 Greg Kurz : > On Fri, 31 Mar 2017 09:26:35 +0800 > Li Qiang wrote: > > > Hello, > > > > 2017-03-30 23:46 GMT+08:00 Greg Kurz : > > > > > On Thu, 30 Mar 2017 08:25:25 -0500 > > > Eric Blake wrote: > > > &

Re: [Qemu-devel] [PATCH for-2.9?] 9pfs: fix migration_block leak

2017-03-30 Thread Li Qiang
Hello, 2017-03-30 23:46 GMT+08:00 Greg Kurz : > On Thu, 30 Mar 2017 08:25:25 -0500 > Eric Blake wrote: > > > On 03/30/2017 07:27 AM, Li Qiang wrote: > > > The guest can leave the pdu->s->migration_blocker exists by attach > > > > s/exists/in place/ &

[Qemu-devel] [PATCH] 9pfs: fix migration_block leak

2017-03-30 Thread Li Qiang
The guest can leave the pdu->s->migration_blocker exists by attach but not remove a fid. Then if we hot unplug the 9pfs device, the v9fs_reset() just free the fids, but not free the migration_blocker. This will leak a memory leak. This patch avoid this. Signed-off-by: Li Qiang --- hw/9pf

[Qemu-devel] [PATCH] 9pfs: fix file descriptor leak

2017-03-23 Thread Li Qiang
ff-by: Li Qiang --- hw/9pfs/9p.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index b8c0b99..48babce 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1550,6 +1550,10 @@ static void coroutine_fn v9fs_lcreate(void *opaque) err = -ENOENT;

[Qemu-devel] [PATCH] scsi: mptsas: fix the wrong reading size in fetch request

2017-03-14 Thread Li Qiang
When fetching request, it should read sizeof(*hdr), not the pointer hdr. Signed-off-by: Li Qiang --- hw/scsi/mptsas.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 2e091c0..765ab53 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi

Re: [Qemu-devel] [PATCH 0/3] ide: ahci: fix memory leak in device unit

2017-03-13 Thread Li Qiang
Hello John, Does this patch go to upstream? Thanks. 2017-03-04 6:48 GMT+08:00 John Snow : > > > On 03/02/2017 05:08 AM, Li Qiang wrote: > > As the pci ahci can be hotplug and unplug, in the ahci unrealize > > function it should free all the resource once allocated in the

Re: [Qemu-devel] [PATCH v2] spice-char: fix segfault in char_spice_finalize

2017-03-02 Thread Li Qiang
ardev is not inserted > > in the 'spice_chars' list, the 'QLIST_REMOVE' will cause a segfault. > > Add a detect to avoid it. > > > > Signed-off-by: Li Qiang > > Reviewed-by: Marc-André Lureau > > > --- > > spice-qemu-char.c | 5

[Qemu-devel] [PATCH 1/3] ide: qdev: register ide bus unrealize function

2017-03-02 Thread Li Qiang
we have an idebus unrealize function, but it was being registered as the unrealize function for the IDE Device, so it was not getting invoked on device teardown because nothing is "unrealizing" the IDE devices themselves. Suggested-by: John Snow Signed-off-by: Li Qiang --- hw/ide/q

[Qemu-devel] [PATCH 3/3] ide: ahci: call cleanup function in ahci unit

2017-03-02 Thread Li Qiang
This can avoid memory leak when hotunplug the ahci device. Signed-off-by: Li Qiang --- hw/ide/ahci.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 6a17acf..f60826d 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1485,6 +1485,18 @@ void

[Qemu-devel] [PATCH 2/3] ide: core: add cleanup function

2017-03-02 Thread Li Qiang
As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patch add ide_exit to free the resource. Signed-off-by: Li Qiang --- hw/ide/core.c | 8 include/hw/ide/internal.h | 1 + 2

[Qemu-devel] [PATCH 0/3] ide: ahci: fix memory leak in device unit

2017-03-02 Thread Li Qiang
As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patchset first add cleanup function in core layer and then call it in the ahci unit. Li Qiang (3): ide: qdev: register ide bus unrealize

Re: [Qemu-devel] [PATCH 1/2] ide: core: add cleanup function

2017-02-28 Thread Li Qiang
Hello John, Paolo, 2017-03-01 8:47 GMT+08:00 John Snow : > > > On 02/09/2017 02:04 AM, Li Qiang wrote: > > As the pci ahci can be hotplug and unplug, in the ahci unrealize > > function it should free all the resource once allocated in the > > realized function.

[Qemu-devel] [PATCH] usb: ohci: fix error return code in servicing td

2017-02-22 Thread Li Qiang
It should return 1 if an error occurs when reading td. This will avoid an infinite loop issue in ohci_service_ed_list. Signed-off-by: Li Qiang --- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 21c93e0..fe8406a

[Qemu-devel] [PATCH v2] spice-char: fix segfault in char_spice_finalize

2017-02-21 Thread Li Qiang
In 'qemu_chr_open_spice_vmc' if the 'psubtype' is NULL, it will call 'char_spice_finalize'. But as the SpiceChardev is not inserted in the 'spice_chars' list, the 'QLIST_REMOVE' will cause a segfault. Add a detect to avoid it. Signed-off-by:

[Qemu-devel] [PATCH] spice-char: fix segfault in char_spice_finalize

2017-02-20 Thread Li Qiang
In 'qemu_chr_open_spice_vmc' if the 'psubtype' is NULL, it will call 'char_spice_finalize'. But as the SpiceChardev is not inserted in the 'spice_chars' list, the 'QLIST_REMOVE' will cause a segfault. Add a detect to avoid it. Signed-off-by:

Re: [Qemu-devel] [PATCH 1/2] ide: core: add cleanup function

2017-02-15 Thread Li Qiang
Hello, 2017-02-15 7:30 GMT+08:00 John Snow : > > > On 02/09/2017 08:22 PM, Li Qiang wrote: > > Hello John, > > > > 2017-02-10 3:42 GMT+08:00 John Snow > <mailto:js...@redhat.com>>: > > > > > > > > On 02/09/2017 02:04 AM, Li Q

Re: [Qemu-devel] [PATCH] usb: ohci: limit the number of link eds

2017-02-14 Thread Li Qiang
Hello Gerd, Ping... 2017-02-07 18:23 GMT+08:00 Li Qiang : > From: Li Qiang > > The guest may builds an infinite loop with link eds. This patch > limit the number of linked ed to avoid this. > > Signed-off-by: Li Qiang > --- > hw/usb/hcd-ohci.c | 9 - > 1

Re: [Qemu-devel] [PATCH] usb: ehci: fix memory leak in ehci

2017-02-14 Thread Li Qiang
Ping... 2017-02-08 10:42 GMT+08:00 Li Qiang : > From: Li Qiang > > In usb_ehci_init function, it initializes 's->ipacket', but there > is no corresponding function to free this. As the ehci can be hotplug > and unplug, this will leak host memory leak. In order to ma

Re: [Qemu-devel] [PATCH] usb: ohci: fix error return code in servicing iso td

2017-02-14 Thread Li Qiang
Ping... 2017-02-07 19:15 GMT+08:00 Li Qiang : > From: Li Qiang > > It should return 1 if an error occurs when reading iso td. > This will avoid an infinite loop issue in ohci_service_ed_list. > > Signed-off-by: Li Qiang > --- > hw/usb/hcd-ohci.c | 2 +- > 1 file

[Qemu-devel] [PATCH v3] net: e1000e: fix an infinite loop issue

2017-02-09 Thread Li Qiang
This issue is like the issue in e1000 network card addressed in this commit: e1000: eliminate infinite loops on out-of-bounds transfer start. Signed-off-by: Li Qiang --- Change since v2: fix error in e1000e_ring_empty eliminate unnecessory detect code in loop Changes since v1: make wraparound

Re: [Qemu-devel] [PATCH 1/2] ide: core: add cleanup function

2017-02-09 Thread Li Qiang
Hello John, 2017-02-10 3:42 GMT+08:00 John Snow : > > > On 02/09/2017 02:04 AM, Li Qiang wrote: > > As the pci ahci can be hotplug and unplug, in the ahci unrealize > > function it should free all the resource once allocated in the > > realized function. This patc

[Qemu-devel] [PATCH 1/2] ide: core: add cleanup function

2017-02-08 Thread Li Qiang
As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patch adds two cleanup function. Signed-off-by: Li Qiang --- hw/ide/core.c | 21 + include/hw/ide/internal.h

[Qemu-devel] [PATCH 2/2] ide: ahci: call cleanup function in ahci unit

2017-02-08 Thread Li Qiang
This can avoid memory leak when hotunplug the ahci device. Signed-off-by: Li Qiang --- hw/ide/ahci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 3c19bda..56f68a8 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1485,6 +1485,14 @@ void

[Qemu-devel] [PATCH 0/2] ide: ahci: fix memory leak in device unit

2017-02-08 Thread Li Qiang
As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patchset first add cleanup function in core layer and then call it in the ahci unit. Li Qiang (2): ide: core: add cleanup function ide: ahci

[Qemu-devel] [PATCH v2] net: e1000e: fix an infinite loop issue

2017-02-08 Thread Li Qiang
From: Li Qiang This issue is like the issue in e1000 network card addressed in this commit: e1000: eliminate infinite loops on out-of-bounds transfer start. Signed-off-by: Li Qiang --- Changes since v1: make wraparound detect in e1000e_ring_empty hw/net/e1000e_core.c | 23

Re: [Qemu-devel] [PATCH] net: e1000e: fix an infinite loop issue

2017-02-08 Thread Li Qiang
Hello Dmitry, 2017-02-08 18:01 GMT+08:00 Dmitry Fleytman : > > On 8 Feb 2017, at 11:30 AM, Li Qiang wrote: > > Hello, > > 2017-02-08 16:38 GMT+08:00 Dmitry Fleytman : > >> Hello, >> >> Thanks for the patch! >> >> The problem of infinite loop

Re: [Qemu-devel] [PATCH] net: e1000e: fix an infinite loop issue

2017-02-08 Thread Li Qiang
, I think this issue is the same. Could you please explain more? Thanks. > ~Dmitry > > > On 7 Feb 2017, at 11:43 AM, Li Qiang wrote: > > > > From: Li Qiang > > > > This issue is the same as e1000 network card in this commit: > > e1000: eliminate infinite l

Re: [Qemu-devel] [PATCH] misc: edu: free dma timer in device unit

2017-02-07 Thread Li Qiang
2017-02-08 14:53 GMT+08:00 Jiri Slaby : > On 02/08/2017, 04:40 AM, Li Qiang wrote: > > From: Li Qiang > > > > This can avoid a memory leak when hotplug and unplug. > > > > Signed-off-by: Li Qiang > > --- > > hw/misc/edu.c | 1 + > > 1 file c

[Qemu-devel] [PATCH] misc: edu: free dma timer in device unit

2017-02-07 Thread Li Qiang
From: Li Qiang This can avoid a memory leak when hotplug and unplug. Signed-off-by: Li Qiang --- hw/misc/edu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 401039c..7565552 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -375,6 +375,7 @@ static

[Qemu-devel] [PATCH] usb: ehci: fix memory leak in ehci

2017-02-07 Thread Li Qiang
From: Li Qiang In usb_ehci_init function, it initializes 's->ipacket', but there is no corresponding function to free this. As the ehci can be hotplug and unplug, this will leak host memory leak. In order to make the hierarchy clean, we should add a ehci pci finalize function,

[Qemu-devel] [PATCH] usb: ohci: fix error return code in servicing iso td

2017-02-07 Thread Li Qiang
From: Li Qiang It should return 1 if an error occurs when reading iso td. This will avoid an infinite loop issue in ohci_service_ed_list. Signed-off-by: Li Qiang --- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c

[Qemu-devel] [PATCH] usb: ohci: limit the number of link eds

2017-02-07 Thread Li Qiang
From: Li Qiang The guest may builds an infinite loop with link eds. This patch limit the number of linked ed to avoid this. Signed-off-by: Li Qiang --- hw/usb/hcd-ohci.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index

[Qemu-devel] [PATCH] net: e1000e: fix an infinite loop issue

2017-02-07 Thread Li Qiang
From: Li Qiang This issue is the same as e1000 network card in this commit: e1000: eliminate infinite loops on out-of-bounds transfer start. Signed-off-by: Li Qiang --- hw/net/e1000e_core.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/net

Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout

2017-02-05 Thread Li Qiang
Hello Gerd, Ping. 2017-01-23 17:09 GMT+08:00 Marc-André Lureau : > > > On Sun, Jan 22, 2017 at 11:43 AM Li Qiang wrote: > >> From: Li Qiang >> >> In virtio_gpu_set_scanout function, when creating the 'rect' >> its refcoun

Re: [Qemu-devel] [PATCH] cirrus: fix oob access issue

2017-01-24 Thread Li Qiang
ed everything and their grandma, and > found (with Gerd's feedback) those aspects safe, I only *assumed* that > for the negative pitch case, "addr" would point to the bottom left > corner of the rectangle: > > On 01/15/15 12:21, Laszlo Ersek wrote: > > > The neg

[Qemu-devel] [PATCH] cirrus: fix oob access issue

2017-01-24 Thread Li Qiang
From: Li Qiang When doing bitblt copy in backward mode, we should minus the blt width first just like the adding in the forward mode. This can avoid the oob access of the front of vga's vram. Signed-off-by: Li Qiang --- hw/display/cirrus_vga.c | 3 ++- 1 file changed, 2 insertions(

[Qemu-devel] [PATCH] cirrus: fix oob access issue

2017-01-24 Thread Li Qiang
From: Li Qiang When doing bitblt copy in backward mode, minus the blt width first to avoid an oob access issue. Signed-off-by: Li Qiang --- hw/display/cirrus_vga.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index

[Qemu-devel] [PATCH] virtio-gpu: fix memory leak in set scanout

2017-01-21 Thread Li Qiang
From: Li Qiang In virtio_gpu_set_scanout function, when creating the 'rect' its refcount is set to 2, by pixman_image_create_bits and qemu_create_displaysurface_pixman function. This can lead a memory leak issues. This patch avoid this issue. Signed-off-by: Li Qiang --- hw/disp

Re: [Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label

2017-01-14 Thread Li Qiang
Hello Guangrong, 2017-01-13 17:00 GMT+08:00 Xiao Guangrong : > > > On 01/13/2017 11:02 AM, Li Qiang wrote: > >> From: Li Qiang >> >> The spec doesn't say the namespace label can't be zero >> when read/write it. As this is no harmful, just allow

[Qemu-devel] [PATCH] nvdimm: allow read/write zero-size namespace label

2017-01-12 Thread Li Qiang
From: Li Qiang The spec doesn't say the namespace label can't be zero when read/write it. As this is no harmful, just allow it. Signed-off-by: Li Qiang --- hw/mem/nvdimm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c ind

[Qemu-devel] [PATCH] serial: fix memory leak in serial exit

2017-01-04 Thread Li Qiang
From: Li Qiang The serial_exit_core function doesn't free some resources. This can lead memory leak when hotplug and unplug. This patch avoid this. Signed-off-by: Li Qiang --- hw/char/serial.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/char/serial.c b/hw/char/ser

[Qemu-devel] [PATCH] Crypto: fix leak in ivgen essiv init

2017-01-03 Thread Li Qiang
From: Li Qiang On error path, the 'salt' doesn't been freed thus leading a memory leak. This patch avoid this. Signed-off-by: Li Qiang --- crypto/ivgen-essiv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/ivgen-essiv.c b/crypto/ivgen-essiv.c index 634de63..cba20

Re: [Qemu-devel] [PATCH] virtio-gpu: fix memory leak in resource attach backing

2016-12-29 Thread Li Qiang
2016-12-29 22:57 GMT+08:00 Marc-André Lureau : > Hi > > - Original Message - > > In the resource attach backing function, everytime it will > > allocate 'res->iov' thus can leading a memory leak. This > > patch avoid this. > > > > Sig

Re: [Qemu-devel] [PATCH] virtio-gpu-3d: fix memory leak in resource attach backing

2016-12-29 Thread Li Qiang
2016-12-29 21:56 GMT+08:00 Marc-André Lureau : > Hi > > - Original Message - > > If the virgl_renderer_resource_attach_iov function fails the > > 'res_iovs' will be leaked. Add check of the return value to > > free the 'res_iovs' when failing

[Qemu-devel] [PATCH] virtio-gpu: fix memory leak in resource attach backing

2016-12-29 Thread Li Qiang
In the resource attach backing function, everytime it will allocate 'res->iov' thus can leading a memory leak. This patch avoid this. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/display/virtio-gpu.c b/hw/display

[Qemu-devel] [PATCH] virtio-gpu-3d: fix memory leak in resource attach backing

2016-12-29 Thread Li Qiang
If the virgl_renderer_resource_attach_iov function fails the 'res_iovs' will be leaked. Add check of the return value to free the 'res_iovs' when failing. Signed-off-by: Li Qiang --- hw/display/virtio-gpu-3d.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) dif

Re: [Qemu-devel] [PATCH] 9pfs: fix crash when fsdev is missing

2016-12-19 Thread Li Qiang
On 2016-12-19 22:28 GMT+08:00 Greg Kurz wrote: > If the user passes -device virtio-9p without the corresponding -fsdev, QEMU > dereferences a NULL pointer and crashes. > > This is a 2.8 regression introduced by commit 702dbcc274e2c. > > Signed-off-by: Greg Kurz >

[Qemu-devel] [PATCH v3] audio: ac97: add exit function

2016-12-14 Thread Li Qiang
From: Li Qiang Currently the ac97 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang --- Changes since the v2: take out of the null check Changes since the v1: close the streams hw/

[Qemu-devel] [PATCH v3] audio: es1370: add exit function

2016-12-14 Thread Li Qiang
From: Li Qiang Currently the es1370 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang --- Changes since the v2: take out of the null check Changes since the v1: close the streams hw/

[Qemu-devel] [PATCH v2] audio: es1370: add exit function

2016-12-13 Thread Li Qiang
From: Li Qiang Currently the es1370 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang --- Changes since the v1: close the streams hw/audio/es1370.c | 19 +++ 1 file ch

[Qemu-devel] [PATCH v2] audio: ac97: add exit function

2016-12-13 Thread Li Qiang
From: Li Qiang Currently the ac97 device emulation doesn't have a exit function, hot unplug this device will leak some memory. Add a exit function to avoid this. Signed-off-by: Li Qiang --- Changes since the v1: close the streams hw/audio/ac97.c | 18 ++ 1 file change

Re: [Qemu-devel] [PATCH] virtio-gpu: fix information leak in capset get dispatch

2016-12-13 Thread Li Qiang
Ping! 2016-11-01 20:37 GMT+08:00 Li Qiang : > From: Li Qiang > > In virgl_cmd_get_capset function, it uses g_malloc to allocate > a response struct to the guest. As the 'resp'struct hasn't been full > initialized it will lead the 'resp->padding' field

Re: [Qemu-devel] [PATCH] virtio-gpu: call cleanup mapping function in resource destroy

2016-12-13 Thread Li Qiang
Ping! 2016-11-29 10:29 GMT+08:00 Li Qiang : > If the guest destroy the resource before detach banking, the 'iov' > and 'addrs' field in resource is not freed thus leading memory > leak issue. This patch avoid this. > > Signed-off-by: Li Qiang > --- >

Re: [Qemu-devel] [PATCH] audio: es1370: add exit function

2016-12-13 Thread Li Qiang
ping! 2016-11-29 18:48 GMT+08:00 Li Qiang : > From: Li Qiang > > Currently the es1370 device emulation doesn't have a exit function, > hot unplug this device will leak some leak. Add a exit function to > avoid this. > > Signed-off-by: Li Qiang > --- > hw/audio

Re: [Qemu-devel] [PATCH] audio: ac97: add exit function

2016-12-13 Thread Li Qiang
Ping! 2016-11-29 18:33 GMT+08:00 Li Qiang : > From: Li Qiang > > Currently the ac97 device emulation doesn't have a exit function, > hot unplug this device will leak some leak. Add a exit function to > avoid this. > > Signed-off-by: Li Qiang > --- > hw/aud

Re: [Qemu-devel] [PATCH] audio: ac97: add exit function

2016-11-29 Thread Li Qiang
2016-11-30 8:47 GMT+08:00 Jonathan Neuschäfer : > On Tue, Nov 29, 2016 at 02:33:41AM -0800, Li Qiang wrote: > > From: Li Qiang > > > > Currently the ac97 device emulation doesn't have a exit function, > > hot unplug this device will leak some leak. Add a exit

Re: [Qemu-devel] [PATCH] watchdog: 6300esb: add exit function

2016-11-29 Thread Li Qiang
2016-11-29 18:49 GMT+08:00 Markus Armbruster : > Li Qiang writes: > > > Hi > > > > 2016-11-29 16:39 GMT+08:00 Richard W.M. Jones : > > > >> On Mon, Nov 28, 2016 at 05:49:04PM -0800, Li Qiang wrote: > >> > From: Li Qiang > >> >

[Qemu-devel] [PATCH] audio: es1370: add exit function

2016-11-29 Thread Li Qiang
From: Li Qiang Currently the es1370 device emulation doesn't have a exit function, hot unplug this device will leak some leak. Add a exit function to avoid this. Signed-off-by: Li Qiang --- hw/audio/es1370.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/audio/es1370.c

[Qemu-devel] [PATCH] audio: ac97: add exit function

2016-11-29 Thread Li Qiang
From: Li Qiang Currently the ac97 device emulation doesn't have a exit function, hot unplug this device will leak some leak. Add a exit function to avoid this. Signed-off-by: Li Qiang --- hw/audio/ac97.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/audio/ac97.c b/hw/

Re: [Qemu-devel] [PATCH] watchdog: 6300esb: add exit function

2016-11-29 Thread Li Qiang
2016-11-29 17:00 GMT+08:00 Richard W.M. Jones : > On Tue, Nov 29, 2016 at 04:56:55PM +0800, Li Qiang wrote: > > Hi > > > > 2016-11-29 16:39 GMT+08:00 Richard W.M. Jones : > > > > > On Mon, Nov 28, 2016 at 05:49:04PM -0800, Li Qiang wrote: > > > >

Re: [Qemu-devel] [PATCH] watchdog: 6300esb: add exit function

2016-11-29 Thread Li Qiang
Hi 2016-11-29 16:39 GMT+08:00 Richard W.M. Jones : > On Mon, Nov 28, 2016 at 05:49:04PM -0800, Li Qiang wrote: > > From: Li Qiang > > > > When the Intel 6300ESB watchdog is hot unplug. The timer allocated > > in realize isn't freed thus leaking memory leak. T

[Qemu-devel] [PATCH] virtio-gpu: call cleanup mapping function in resource destroy

2016-11-28 Thread Li Qiang
If the guest destroy the resource before detach banking, the 'iov' and 'addrs' field in resource is not freed thus leading memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/

[Qemu-devel] [PATCH] watchdog: 6300esb: add exit function

2016-11-28 Thread Li Qiang
From: Li Qiang When the Intel 6300ESB watchdog is hot unplug. The timer allocated in realize isn't freed thus leaking memory leak. This patch avoid this through adding the exit function. Signed-off-by: Li Qiang --- hw/watchdog/wdt_i6300esb.c | 9 + 1 file changed, 9 inser

[Qemu-devel] [PATCH 2/2] virtio-gpu: call cleanup mapping function in resource destroy

2016-11-24 Thread Li Qiang
If the guest destroy the resource before detach banking, the 'iov' and 'addrs' field in resource is not freed thus leading memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/di

[Qemu-devel] [PATCH 1/2] virtio-gpu: add declaration for virtio_gpu_cleanup_mapping function

2016-11-24 Thread Li Qiang
The virtio_gpu_resource_destroy function is before the definition of the cleanup mapping function and it should call this cleanup mapping function, so we should add a declaration for it. Signed-off-by: Li Qiang --- hw/display/virtio-gpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw

[Qemu-devel] [PATCH 0/2] fix memory leak in virtio_gpu_resource_destroy

2016-11-24 Thread Li Qiang
If the guest destroy the resource before detach banking, the 'iov' and 'addrs' field in resource is not freed thus leading memory leak issue. This patchset address this. Li Qiang (2): virtio-gpu: add declaration for virtio_gpu_cleanup_mapping function virtio-gpu: call clea

[Qemu-devel] [PATCH v3 3/4] 9pfs: add cleanup operation for handle backend driver

2016-11-16 Thread Li Qiang
In the init operation of handle backend dirver, it allocates a handle_data struct and opens a mount file. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p-handle.c | 9 + 1 file changed, 9 insertions

[Qemu-devel] [PATCH v3 2/4] 9pfs: add cleanup operation in FileOperations

2016-11-16 Thread Li Qiang
Currently, the backend of VirtFS doesn't have a cleanup function. This will lead resource leak issues if the backed driver allocates resources. This patch addresses this issue. Signed-off-by: Li Qiang --- Changes since the v1: -move the cleanup stuff above calls to g_free -add cleanup ca

[Qemu-devel] [PATCH v3 1/4] 9pfs: adjust the order of resource cleanup in device unrealize

2016-11-16 Thread Li Qiang
Unrealize should undo things that were set during realize in reverse order. So should do in the error path in realize. Signed-off-by: Li Qiang --- Changes since the v2: -adjust the order in the error path in realize hw/9pfs/9p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH v3 4/4] 9pfs: add cleanup operation for proxy backend driver

2016-11-16 Thread Li Qiang
In the init operation of proxy backend dirver, it allocates a V9fsProxy struct and some other resources. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- Changes since the v2: -only close proxy->sockfd if QEMU ope

[Qemu-devel] [PATCH v3 0/4] 9pfs: add cleanup operation in handle/proxy backend

2016-11-16 Thread Li Qiang
Currently, the backend of VirtFS doesn't have a cleanup function. This will leak some resources in handle and proxy backend driver. This patchset addresses this issue. Li Qiang (4): 9pfs: adjust the order of resource cleanup in device unrealize 9pfs: add cleanup operation in FileOpera

Re: [Qemu-devel] [PATCH v2 0/3] 9pfs: add cleanup operation in handle/proxy backend

2016-11-15 Thread Li Qiang
It is caused by the git config. remove the "From x" section in git [sendemail] will solve the message ID issue. 2016-11-15 18:16 GMT+08:00 Greg Kurz : > On Mon, 14 Nov 2016 21:13:50 -0500 > Li Qiang wrote: > > > Currently, the backend of VirtFS doesn't have a c

[Qemu-devel] [PATCH v2 3/3] 9pfs: add cleanup operation for proxy backend driver

2016-11-14 Thread Li Qiang
In the init operation of proxy backend dirver, it allocates a V9fsProxy struct and some other resources. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p-proxy.c | 10 ++ 1 file changed, 10 insertions

[Qemu-devel] [PATCH v2 1/3] 9pfs: add cleanup operation in FileOperations

2016-11-14 Thread Li Qiang
Currently, the backend of VirtFS doesn't have a cleanup function. This will lead resource leak issues if the backed driver allocates resources. This patch addresses this issue. Signed-off-by: Li Qiang --- Changes since the v1: -move the cleanup stuff above calls to g_free -add cleanup ca

[Qemu-devel] [PATCH v2 0/3] 9pfs: add cleanup operation in handle/proxy backend

2016-11-14 Thread Li Qiang
Currently, the backend of VirtFS doesn't have a cleanup function. This will leak some resources in handle and proxy backend driver. This patchset addresses this issue. Li Qiang (3): 9pfs: add cleanup operation in FileOperations 9pfs: add cleanup operation for handle backend driver 9pfs

[Qemu-devel] [PATCH v2 2/3] 9pfs: add cleanup operation for handle backend driver

2016-11-14 Thread Li Qiang
In the init operation of handle backend dirver, it allocates a handle_data struct and opens a mount file. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p-handle.c | 8 1 file changed, 8 insertions

[Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize

2016-11-14 Thread Li Qiang
From: Li Qiang Unrealize should undo things that were set during realize in reverse order. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index aea7e9d..f7e14ac 100644 --- a

[Qemu-devel] [PATCH 3/3] 9pfs: add cleanup operation for proxy backend driver

2016-11-14 Thread Li Qiang
From: Li Qiang In the init operation of proxy backend dirver, it allocates a V9fsProxy struct and some other resources. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p-proxy.c | 10 ++ 1 file

[Qemu-devel] [PATCH 0/3] add cleanup operation in handle/proxy backend

2016-11-14 Thread Li Qiang
From: Li Qiang Currently, the backend of VirtFS doesn't have a cleanup function. This will leak some resources in handle and proxy backend driver. This patchset addresses this issue. Li Qiang (3): 9pfs: add cleanup operation in FileOperations 9pfs: add cleanup operation for handle ba

[Qemu-devel] [PATCH 2/3] 9pfs: add cleanup operation for handle backend driver

2016-11-14 Thread Li Qiang
From: Li Qiang In the init operation of handle backend dirver, it allocates a handle_data struct and opens a mount file. We should free these resources when the 9pfs device is unrealized. This is what this patch does. Signed-off-by: Li Qiang --- hw/9pfs/9p-handle.c | 8 1 file

[Qemu-devel] [PATCH 1/3] 9pfs: add cleanup operation in FileOperations

2016-11-14 Thread Li Qiang
From: Li Qiang Currently, the backend of VirtFS doesn't have a cleanup function. This will lead resource leak issues if the backed driver allocates resources. This patch addresses this issue. Signed-off-by: Li Qiang --- fsdev/file-op-9p.h | 1 + hw/9pfs/9p.c | 3 +++ 2 files chang

[Qemu-devel] [PATCH] 9pfs: free the private data memory in device unrealize

2016-11-12 Thread Li Qiang
From: Li Qiang When the 9pfs use 'handle'/'proxy' as the backend driver it will allocate a private data memory. But this memory is not freed in the unrealize function thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/9pfs/9p.c | 1

[Qemu-devel] [PATCH] usb: ehci: fix memory leak in ehci_init_transfer

2016-11-08 Thread Li Qiang
From: Li Qiang In ehci_init_transfer function, if the 'cpage' is bigger than 4, it doesn't free the 'p->sgl' once allocated previously thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/usb/hcd-ehci.c | 1 + 1 file changed, 1 i

[Qemu-devel] [PATCH] usbredir: free vm_change_state_handler in usbredir destroy dispatch

2016-11-07 Thread Li Qiang
From: Li Qiang In usbredir destroy dispatch function, it doesn't free the vm change state handler once registered in usbredir_realize function. This will lead a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/usb/redirect.c | 5 - 1 file changed, 4 inser

[Qemu-devel] [PATCH] virtio-gpu: fix information leak in capset get dispatch

2016-11-01 Thread Li Qiang
From: Li Qiang In virgl_cmd_get_capset function, it uses g_malloc to allocate a response struct to the guest. As the 'resp'struct hasn't been full initialized it will lead the 'resp->padding' field to the guest. Use g_malloc0 to avoid this. Signed-off-by: Li Qiang

[Qemu-devel] [PATCH] virtio-gpu: fix memory leak in update_cursor_data_virgl

2016-11-01 Thread Li Qiang
From: Li Qiang In update_cursor_data_virgl function, if the 'width'/ 'height' is not equal to current cursor's width/height it will return without free the 'data' allocated previously. This will lead a memory leak issue. This patch fix this issue. Signed-off-b

<    3   4   5   6   7   8   9   >