[Qemu-devel] [PATCH v4] virtio-blk: trivial code optimization

2015-11-10 Thread arei.gonglei
From: Gonglei 1. avoid possible superflous checking 2. make code more robustness Signed-off-by: Gonglei --- v4: address possible integer underover [Stefan] please review again, thanks --- hw/block/virtio-blk.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletion

[Qemu-devel] [PATCH v3] virtio-blk: trivial code optimization

2015-11-09 Thread arei.gonglei
From: Gonglei 1. avoid possible superflous checking 2. make code more robustness Signed-off-by: Gonglei Reviewed-by: Fam Zheng --- v3: change the third condition too [Paolo] add Fam's R-by --- hw/block/virtio-blk.c | 27 +-- 1 file changed, 9 insertions(+), 18 dele

[Qemu-devel] [PATCH v2] virtio-blk: trivial code optimization

2015-11-08 Thread arei.gonglei
From: Gonglei 1. avoid possible superflous checking 2. make code more robustness Signed-off-by: Gonglei --- v2: address Paolo's comments, thanks. --- hw/block/virtio-blk.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/hw/block/virtio-blk.c b/h

[Qemu-devel] [PATCH] virtio-blk: trivial code optimization

2015-11-05 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/block/virtio-blk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 093e475..752586d 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -409,18 +409,20 @@ void vi

[Qemu-devel] [PATCH] ivshmem-server: fix possible OVERRUN

2015-11-01 Thread arei.gonglei
From: Gonglei >>> CID 1337991: Memory - illegal accesses (OVERRUN) >>> Decrementing "i". The value of "i" is now 65534. 218 while (i--) { 219 event_notifier_cleanup(&peer->vectors[i]); 220 } Signed-off-by: Gonglei --- contrib/ivshmem-server/ivshmem-server.

[Qemu-devel] [PATCH] vhost-scsi: fix wrong vhost-scsi firmware path

2015-08-25 Thread arei.gonglei
From: Gonglei vhost-scsi bootindex does't work because Qemu passes wrong fireware path to seabios. before: /pci@i0cf8/scsi@7channel@0/vhost-scsi@0,0 after applying the patch: /pci@i0cf8/scsi@7/channel@0/vhost-scsi@0,0 Reported-by: Subo Signed-off-by: Gonglei --- hw/scsi/vhost-scsi.c | 2

[Qemu-devel] [PATCH] vhost-scsi: Fix mask index err in vhost_scsi_start

2015-07-26 Thread arei.gonglei
From: Lu Lina Signed-off-by: Lu Lina Signed-off-by: Gonglei --- hw/scsi/vhost-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 1941aa1..174b4d2 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -117,7 +11

[Qemu-devel] [PATCH for-2.4] vnc: fix memory leak

2015-07-22 Thread arei.gonglei
From: Gonglei If vnc's password is configured, it will leak memory which cipher variable pointed on every vnc connection. Cc: Daniel P. Berrange Signed-off-by: Gonglei --- ui/vnc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 1483958..e2697

[Qemu-devel] [PATCH 3/4] arm/xlnx-zynqmp: fix memory leak

2015-07-09 Thread arei.gonglei
From: Gonglei fix CID 1311372. Signed-off-by: Gonglei --- hw/arm/xlnx-zynqmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 5e72078..00c5943 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -144,7 +144,

[Qemu-devel] [PATCH 0/4] fix memory leak

2015-07-09 Thread arei.gonglei
From: Gonglei Spotted by Coverity. Gonglei (4): cpu: fix memory leak ppc/spapr_drc: fix memory leak arm/xlnx-zynqmp: fix memory leak vl.c: fix memory leak hw/arm/xlnx-zynqmp.c | 4 ++-- hw/ppc/spapr_drc.c | 1 + target-i386/cpu.c| 2 +- vl.c | 5 - 4 files cha

[Qemu-devel] [PATCH 2/4] ppc/spapr_drc: fix memory leak

2015-07-09 Thread arei.gonglei
From: Gonglei fix CID 1311373. Signed-off-by: Gonglei --- hw/ppc/spapr_drc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index ef98538..ee87432 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -422,6 +422,7 @@ static void realize(Devic

[Qemu-devel] [PATCH 1/4] cpu: fix memory leak

2015-07-09 Thread arei.gonglei
From: Gonglei Failing to save or free storage allocated by "g_strdup(names[0])" leaks it. Actually, we can pass names[0] directly. Signed-off-by: Gonglei --- target-i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index f9b178

[Qemu-devel] [PATCH 4/4] vl.c: fix memory leak

2015-07-09 Thread arei.gonglei
From: Gonglei Failing to save or free storage allocated by "g_strdup(cmd)" leaks it. Let's use a variable to storage it. Signed-off-by: Gonglei --- vl.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 3f269dc..399e816 100644 --- a/vl.c +++ b/vl.c @@ -1

[Qemu-devel] [PATCH] qemu-doc: fix typos

2015-07-03 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- qemu-doc.texi | 2 +- qemu-options.hx | 2 +- qemu-tech.texi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 0125bc7..94af8c0 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1061,7 +1061,7

[Qemu-devel] [PATCH] rocker: fix memory leak

2015-06-24 Thread arei.gonglei
From: Gonglei Meanwhile, using g_new0 instead of g_malloc0, refer to commit 5839e53. Signed-off-by: Gonglei --- hw/net/rocker/rocker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 4d25842..7e06015 100644 --- a/hw/ne

[Qemu-devel] [PATCH] virito-blk: drop duplicate check

2015-06-24 Thread arei.gonglei
From: Gonglei in_num = req->elem.in_num, and req->elem.in_num is checked in line 489, so the check about in_num variable is superflous, let's drop it. Signed-off-by: Gonglei --- hw/block/virtio-blk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/

[Qemu-devel] [PATCH v2] ossaudio: fix memory leak

2015-06-24 Thread arei.gonglei
From: Gonglei Variable "conf" going out of scope leaks the storage it points to in line 856. Signed-off-by: Gonglei --- v2: using an better way to avoid memory leak. (Markus) --- audio/ossaudio.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/audio/ossaudio.c b/

[Qemu-devel] [PATCH v2] rdma: fix memory leak

2015-06-23 Thread arei.gonglei
From: Gonglei Variable "r" going out of scope leaks the storage it points to in line 3268. Signed-off-by: Gonglei Reviewed-by: Amit Shah --- v2: - Drop needless initialization. (Markus & Paolo) - add Amit's R-by. --- migration/rdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-

[Qemu-devel] [PATCH 2/2] qdev: fix OVERFLOW_BEFORE_WIDEN

2015-06-22 Thread arei.gonglei
From: Gonglei Potentially overflowing expression "1 << prop->bitnr" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). Cc: Gerd Hoffmann Signed-off-by: Paolo Bonzini Signed-off-by

[Qemu-devel] [PATCH 1/2] virito-pci: fix OVERRUN problem

2015-06-22 Thread arei.gonglei
From: Gonglei Overrunning array "proxy->guest_features" of 2 4-byte elements at element index 2 (byte offset 8) using index "proxy->gfselect" (which evaluates to 2). Normally, the Linux kernel driver just read/write '0' or '1' as the "proxy->gfselect" values, so using '<' instead of '=<' to make

[Qemu-devel] [PATCH 0/2] fix two overflow problems

2015-06-22 Thread arei.gonglei
From: Gonglei Gonglei (2): virito-pci: fix OVERRUN problem qdev: fix OVERFLOW_BEFORE_WIDEN hw/core/qdev-properties.c | 2 +- hw/virtio/virtio-pci.c| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.7.12.4

[Qemu-devel] [PATCH] rdma: fix memory leak

2015-06-22 Thread arei.gonglei
From: Gonglei Variable "r" going out of scope leaks the storage it points to in line 3268. Signed-off-by: Gonglei --- migration/rdma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index cf5de7e..de80860 100644 --- a/migration/rdma.c

[Qemu-devel] [PATCH] ossaudio: fix memory leak

2015-06-22 Thread arei.gonglei
From: Gonglei Variable "conf" going out of scope leaks the storage it points to in line 856. Signed-off-by: Gonglei --- audio/ossaudio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 11e76a1..7dbe333 100644 --- a/audio/ossaudio.c +++ b/audio/ossa

[Qemu-devel] [PATCH] qemu-error: make the timestamp more obvious and clear

2015-05-20 Thread arei.gonglei
From: Gonglei before: (qemu) 2015-05-21T02:07:43.695065Z qemu-system-x86_64: test after applying this patch: (qemu) [2015-05-21T02:21:46.023619Z UTC] qemu-system-x86_64: test Cc: Eric Blake Signed-off-by: Gonglei --- util/qemu-error.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[Qemu-devel] [PATCH 0/6] pci/isa: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Because DO_UPCAST() is long deprecated, let me do some cleanup work. Please review, thanks Cc: Michael S. Tsirkin Cc: Paolo Bonzini Gonglei (6): pci-assign: QOMify piix: piix3 QOMify piix4: QOMify wdt_i6300esb: QOMify xen_pt: QOMify vt82c686: QOMify hw/i386/kvm/p

[Qemu-devel] [PATCH 6/6] vt82c686: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/isa/vt82c686.c | 47 --- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index b8197b1..bb6f6df 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@

[Qemu-devel] [PATCH 4/6] wdt_i6300esb: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/watchdog/wdt_i6300esb.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 4ebdbb8..cfa2b1b 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i63

[Qemu-devel] [PATCH 2/6] piix: piix3 QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/pci-host/piix.c | 57 +- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 723836f..f0fe4a1 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-ho

[Qemu-devel] [PATCH 5/6] xen_pt: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Cc: Stefano Stabellini Signed-off-by: Gonglei --- hw/xen/xen_pt.c | 10 +- hw/xen/xen_pt.h | 4 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index d095c08..6674974 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c

[Qemu-devel] [PATCH 3/6] piix4: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/isa/piix4.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index d9522b1..2c59e91 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -34,6 +34,10 @@ typedef struct PIIX4State { PCIDevi

[Qemu-devel] [PATCH 1/6] pci-assign: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/i386/kvm/pci-assign.c | 39 +-- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index 9db7c77..74d22f4 100644 --- a/hw/i386/kvm/pci-assign.c +++ b/

[Qemu-devel] [PATCH 1/3] vga-pci: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/display/vga-pci.c | 48 ++-- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index aabfc23..ff5dfb2 100644 --- a/hw/display/vga-pci.c +++ b/hw/disp

[Qemu-devel] [PATCH 3/3] qxl: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/display/qxl.c | 44 ++-- hw/display/qxl.h | 3 +++ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 0cd314c..8f40dfb 100644 --- a/hw/display/qxl.c +++ b

[Qemu-devel] [PATCH 2/3] cirrus_vga: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei QOMify pci-cirrus-vga like isa-cirrus-vga device. Signed-off-by: Gonglei --- hw/display/cirrus_vga.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 8765a7e..5198037 100644 --- a/hw/display/cirrus

[Qemu-devel] [PATCH 0/3] hw/display: QOMify

2015-05-12 Thread arei.gonglei
From: Gonglei Hi, These three patches just some cleanup work about DO_UPCAST(). Please review, Thanks Cc: Gerd Hoffmann Gonglei (3): vga-pci: QOMify cirrus_vga: QOMify qxl: QOMify hw/display/cirrus_vga.c | 8 ++-- hw/display/qxl.c| 44 ++--

[Qemu-devel] [PATCH 02/14] usb: usb-audio QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-audio.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 67deffe..f092bb8 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -361,6 +361,9 @@ t

[Qemu-devel] [PATCH 14/14] usb: usb-serial QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-serial.c | 43 +++ 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 67c2072..6ca3da9 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-seria

[Qemu-devel] [PATCH 08/14] usb: usb-net QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-network.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 1866991..5f2ffd0 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -648,6 +648,9 @@ typed

[Qemu-devel] [PATCH 05/14] usb: usb-hub QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-hub.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 0482f58..c8c6855 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -41,6 +41,9 @@ typedef struct USBHubState

[Qemu-devel] [PATCH 07/14] usb-mtp: fix segmentation fault

2015-05-06 Thread arei.gonglei
From: Gonglei When x-root property not be configured, will cause segfault because of null pointer accessing. Add a check for s->root property avoid segfault. Signed-off-by: Gonglei --- hw/usb/dev-mtp.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c

[Qemu-devel] [PATCH 13/14] usb: usb-redir QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/redirect.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 2416de8..242a654 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -130,6 +130,9 @@ stru

[Qemu-devel] [PATCH 11/14] usb: usb-uas QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-uas.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index 04fc515..38b26c5 100644 --- a/hw/usb/dev-uas.c +++ b/hw/usb/dev-uas.c @@ -127,6 +127,9 @@ struct UASDevice {

[Qemu-devel] [PATCH 10/14] usb: usb-storage QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-storage.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index ae8d40d..abe0e1d 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@

[Qemu-devel] [PATCH 04/14] usb: usb-hid QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-hid.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index 507c966..9623e72 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -51,6 +51,9 @@ ty

[Qemu-devel] [PATCH 00/14] usb: QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Because DO_UPCAST() is long deprecated, let me do some cleanup work for usb sub-system, which I have said in previous conversation of a bugfix. Patch 7 is a bugfix. Please review, thanks :) Gonglei (14): uhci: QOMify usb: usb-audio QOMify usb: usb-bt QOMify usb: usb-hi

[Qemu-devel] [PATCH 09/14] usb: usb-ccid QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-smartcard-reader.c | 50 --- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 78ce681..2d29367 100644 --- a/hw/usb/dev-s

[Qemu-devel] [PATCH 03/14] usb: usb-bt QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-bluetooth.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 9bf6730..b19ec76 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -49,6 +49,

[Qemu-devel] [PATCH 12/14] usb: usb-wacom-tablet QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-wacom.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c index 844eafa..c2450e7 100644 --- a/hw/usb/dev-wacom.c +++ b/hw/usb/dev-wacom.c @@ -56,6 +56,9 @@ typedef struct USBWa

[Qemu-devel] [PATCH 06/14] usb: usb-mtp QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/usb/dev-mtp.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 108ece8..c9c1f32 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -130,6 +130,9 @@ struct MTPState { QT

[Qemu-devel] [PATCH 01/14] uhci: QOMify

2015-05-06 Thread arei.gonglei
From: Gonglei Cc: Gerd Hoffmann Signed-off-by: Gonglei --- hw/usb/hcd-uhci.c | 43 +++ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 327f26d..64a7d87 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/us

[Qemu-devel] [PATCH 1/3] target-mips: fix memory leak

2015-04-28 Thread arei.gonglei
From: Gonglei Coveristy reports that variable prom_buf/params_buf going out of scope leaks the storage it points to. Cc: Aurelien Jarno Cc: Leon Alrae Signed-off-by: Gonglei --- hw/mips/mips_fulong2e.c | 1 + hw/mips/mips_malta.c| 1 + hw/mips/mips_r4k.c | 1 + 3 files changed, 3 in

[Qemu-devel] [PATCH 2/3] xhci: remove unused code

2015-04-28 Thread arei.gonglei
From: Gonglei Value from xfer->packet.ep is assigned to ep here, but that stored value is not used before it is overwritten. Remove it. Cc: Gerd Hoffmann Signed-off-by: Gonglei --- hw/usb/hcd-xhci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index

[Qemu-devel] [PATCH 3/3] vhost-user: remove superfluous '\n' around error_report()

2015-04-28 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/virtio/vhost-user.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index aefe0bb..e7ab829 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@

[Qemu-devel] [PATCH 0/3] trivial patches

2015-04-28 Thread arei.gonglei
From: Gonglei These trivial patches are collected by me during qemu 2.3 hard-freeze time, which spoted by coverity. Please ack or review if possible, thanks. Gonglei (3): target-mips: fix memory leak xhci: remove unused code vhost-user: remove superfluous '\n' around error_report() hw/m

[Qemu-devel] [PATCH] misc: fix typos in copyright declaration

2015-03-26 Thread arei.gonglei
From: Gonglei Add a space after comma. Signed-off-by: Gonglei --- bootdevice.c | 2 +- tests/usb-hcd-ohci-test.c | 2 +- tests/usb-hcd-uhci-test.c | 2 +- tests/usb-hcd-xhci-test.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bootdevice.c b/bootdevice.c i

[Qemu-devel] [PATCH v4 3/3] ohci: fix resource cleanup leak

2015-03-18 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v4 2/3] ehci: fix segfault when hot-unplugging ehci controller

2015-03-18 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v4 0/3] usb: fix segfault when hot-unplugging usb host adapter

2015-03-18 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via D

[Qemu-devel] [PATCH v4 1/3] uhci: fix segfault when hot-unplugging uhci controller

2015-03-18 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v3 1/3] uhci: fix segfault when hot-unplugging uhci controller

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v3 0/3] usb: fix segfault when hot-unplugging usb host adapter

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via D

[Qemu-devel] [PATCH v3 2/3] ehci: fix segfault when hot-unplugging ehci controller

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v3 3/3] ohci: fix resource cleanup leak

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v2 0/3] usb: fix segfault when hot-unplugging usb host adapter

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via D

[Qemu-devel] [PATCH v2 2/3] ehci: using DeviceClasss->reset qemu_register_reset() call

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v2 1/3] uhci: using DeviceClasss->reset qemu_register_reset() call

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH v2 3/3] ohci: using DeviceClasss->reset qemu_register_reset() call

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involved registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Let's hook up reset via Devic

[Qemu-devel] [PATCH] usb: fix segfault when hot-unplugging usb host adapter

2015-03-17 Thread arei.gonglei
From: Gonglei When hot-unplugging the usb controllers (ehci/uhci), we have to clean all resouce of these devices, involed registered reset handler. Otherwise, it may cause NULL pointer access and/or segmentation fault if we reboot the guest os after hot-unplugging. Cc: qemu-stable Reported-by:

[Qemu-devel] [PATCH v2] vnc: fix segmentation fault when invalid vnc parameters are specified

2015-03-12 Thread arei.gonglei
From: Gonglei Reproducer: #./qemu-system-x86_64 -vnc :0,ip qemu-system-x86_64: -vnc :1,ip: Invalid parameter 'ip' Segmentation fault (core dumped) Signed-off-by: Gonglei --- v2: remove useless initialization for variable id. (mjt) --- ui/vnc.c | 7 ++- 1 file changed, 6 insertions(+), 1 d

[Qemu-devel] [PATCH] vnc: fix segmentation fault when invalid vnc parameters are specified

2015-03-11 Thread arei.gonglei
From: Gonglei Reproducer: #./qemu-system-x86_64 -vnc :0,ip qemu-system-x86_64: -vnc :1,ip: Invalid parameter 'ip' Segmentation fault (core dumped) Signed-off-by: Gonglei --- This patch bases on Gerd's vnc queue. --- ui/vnc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff -

[Qemu-devel] [PATCH 2/2] vnc: avoid possible file handler leak

2015-03-11 Thread arei.gonglei
From: Gonglei vs->lsock may equal to 0, modify the check condition, avoid possible vs->lsock leak. Signed-off-by: Gonglei --- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 10a2724..259eca2 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3641,7

[Qemu-devel] [PATCH 0/2] ui: two small fixes

2015-03-11 Thread arei.gonglei
From: Gonglei patch 1 reported by coverity several month ago, patch 2 is founded by code review. Gonglei (2): ui/console: fix OVERFLOW_BEFORE_WIDEN vnc: avoid possible file handler leak ui/console.c | 4 ++-- ui/vnc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.7.1

[Qemu-devel] [PATCH 1/2] ui/console: fix OVERFLOW_BEFORE_WIDEN

2015-03-11 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- ui/console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/console.c b/ui/console.c index 87af6b5..b15ca87 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1285,9 +1285,9 @@ DisplaySurface *qemu_create_displaysurface_guestmem

[Qemu-devel] [PATCH v2] microblaze: fix memory leak

2015-03-04 Thread arei.gonglei
From: Gonglei When not assign a -dtb argument, the variable dtb_filename storage returned from qemu_find_file(), which should be freed after use. Alternatively we define a local variable filename, with 'char *' type, free after use. Cc: Michael Tokarev Cc: Edgar E. Iglesias Signed-off-by: Gong

[Qemu-devel] [PATCH v2] arm: fix memory leak

2015-03-04 Thread arei.gonglei
From: Gonglei Cc: Michael Tokarev Cc: Peter Maydell Signed-off-by: Gonglei --- v2: Fix a complier error, remove `const' from the variable declaration. (mjt) --- hw/arm/digic_boards.c | 1 + hw/arm/highbank.c | 1 + hw/arm/vexpress.c | 3 ++- hw/arm/virt.c | 3 ++- 4 files c

[Qemu-devel] [PULL 1/2] bootdevice: check boot order argument validation before vm running

2015-03-02 Thread arei.gonglei
From: Gonglei Either 'once' option or 'order' option can take effect for -boot at the same time, that is say initial startup processing can check only one. And pc.c's set_boot_dev() fails when its boot order argument is invalid. This patch provide a solution fix this problem: 1. If "once" is gi

[Qemu-devel] [PULL 2/2] bootdevice: add check in restore_boot_order()

2015-03-02 Thread arei.gonglei
From: Gonglei qemu_boot_set() can't fail in restore_boot_order(), then simply assert it doesn't fail, by passing &error_abort if boot_set_handler set. Suggested-by: Markus Armbruster Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- bootdevice.c |4 +++- 1 file changed, 3 inserti

[Qemu-devel] [PULL 0/2] bootdevice patches

2015-03-02 Thread arei.gonglei
From: Gonglei The following changes since commit 0856579cac2f1dacecd847cfcd89680d26ff78f5: Revert "Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging" (2015-03-03 00:29:17 +) are available in the git repository at: https://github.com/gongleiarei/qemu.gi

[Qemu-devel] [PATCH v2] e500: fix memory leak

2015-02-28 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- v2: fix compilation complaint. (mjt) --- hw/ppc/e500.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 7e17d18..c060b50 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -309,8 +309,10 @@ static int ppce500_load_

[Qemu-devel] [PATCH v2 2/2] qemu-char: add cyrillic key 'numerosign' to Russian keymap

2015-02-28 Thread arei.gonglei
From: Wang Xin numero sign is the number sign key of Russian keyboard layout, we get this key with press 'shift + 3'. It's missing in current Russian keymap file, this patch fix it. As number sign is not exsit in Russian keyboard layout[1][2], this patch also remove the 'numbersign' from Russian

[Qemu-devel] [PATCH v2 1/2] qemu-char: add cyrillic characters 'numerosign' to VNC keysyms

2015-02-28 Thread arei.gonglei
From: Wang Xin This patch adds missing cyrillic characters 'numerosign' to the VNC keysym table, it's need by Russian keyboard. And I get the keysym from '', the current keysym table in Qemu was generated from it. Signed-off-by: Wang xin Signed-off-by: Gonglei --- ui/vnc_keysym.h | 1 + 1 fil

[Qemu-devel] [PATCH v2 0/2] Fix key 'numerosign' missing in Russian keyboard

2015-02-28 Thread arei.gonglei
From: Wang Xin Add the keysym and keycode of 'numerosign' in Russian keyboard layout to VNC keysyms table and keymap. v2->v1: Remove the key 'numbersign' from Russian keymap as it is not exsit in Russian keyboard layout. Wang Xin (2): qemu-char: add cyrillic characters 'numerosign' to VNC k

[Qemu-devel] [PATCH 9/9] microblaze: fix memory leak

2015-02-26 Thread arei.gonglei
From: Gonglei When not assign a -dtb argument, the variable dtb_filename storage returned from qemu_find_file(), which should be freed after using. Signed-off-by: Gonglei --- hw/microblaze/boot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/microblaze/boot.c b/hw/m

[Qemu-devel] [PATCH 4/9] macio: fix possible memory leak

2015-02-26 Thread arei.gonglei
From: Gonglei If ret = macio_initfn_ide() is less than 0, the timer_memory will leak the memory it points to. Signed-off-by: Gonglei --- hw/misc/macio/macio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index e0f1e88..bf96

[Qemu-devel] [PATCH 1/9] nbd: fix resource leak

2015-02-26 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd.c b/block/nbd.c index 2f3b9ad..b9955cb 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -273,6 +273,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, */

[Qemu-devel] [PATCH 8/9] sysbus: fix memory leak

2015-02-26 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei --- hw/core/sysbus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 84af593..b53c351 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -91,6 +91,8 @@ bool sysbus_has_irq(SysBusDevice *dev, int n) Ob

[Qemu-devel] [PATCH 0/9] Coverity defects fixes

2015-02-26 Thread arei.gonglei
From: Gonglei All those defects are spotted by Coverity, which classed in high impact outstanding defects. Reports come from scan.coverity.com for Qemu. Cc: Paolo Bonzini Cc: Markus Armbruster Cc: qemu-triv...@nongnu.org Gonglei (9): nbd: fix resource leak arm: fix memory leak sparc/leo

[Qemu-devel] [PATCH] bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'

2015-02-26 Thread arei.gonglei
From: Gonglei Reproducer: $./qemu-system-x86_64 --enable-kvm -kernel /home/vmlinuz-2.6.32.12-0.7-default \ -initrd /home/initrd-2.6.32.12-0.7-default -append \ "root=/dev/ram rw console=ttyS0,115200" -dtb guest.dtb -vnc :10 --monitor stdio -smp 2 QEMU 2.2.50 monitor - type 'help' for more

[Qemu-devel] [PATCH v2 10/11] arm/digic_boards: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/arm/digic_boards.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index 2a4b872..7114c36 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boa

[Qemu-devel] [PATCH v2 11/11] vhost: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/virtio/vhost-backend.c | 2 +- net/vhost-user.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index ff4f200..4d68a27 100644 --- a

[Qemu-devel] [PATCH v2 02/11] a9gtimer: remove superfluous '\n' around error_setg

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/timer/a9gtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c index 435142a..b087bbd 100644 --- a/hw/timer/a9gtimer.c +++ b/hw/timer/a9gtimer.c @@ -289,7

[Qemu-devel] [PATCH v2 09/11] tpm: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/tpm/tpm_passthrough.c | 12 ++-- tpm.c| 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index 2bf3c6f..13ac1d2 100644

[Qemu-devel] [PATCH v2 08/11] xtensa: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/xtensa/sim.c| 2 +- hw/xtensa/xtfpga.c | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 37ea9ae..328d209 100644 --- a/hw/xtensa/sim.c +++ b/hw/

[Qemu-devel] [PATCH v2 05/11] Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- exec.c | 2 +- hw/ide/pci.c | 2 +- hw/microblaze/boot.c | 2 +- migration/rdma.c | 2 +- target-s390x/kvm.c | 2 +- trace/control.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)

[Qemu-devel] [PATCH v2 03/11] pl330.c: remove superfluous '\n' around error_setg

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/dma/pl330.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 16cf77e..5be3df5 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -1566,7 +1566,7 @@ static vo

[Qemu-devel] [PATCH v2 01/11] block: remove superfluous '\n' around error_report/error_setg

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- block/archipelago.c | 6 +++--- hw/block/nand.c | 2 +- qemu-img.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/archipelago.c b/block/archipelago.c index a8114b5..855655c 100644

[Qemu-devel] [PATCH v2 04/11] numa: remove superfluous '\n' around error_setg

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- numa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/numa.c b/numa.c index afd2866..6decd13 100644 --- a/numa.c +++ b/numa.c @@ -59,7 +59,7 @@ static void numa_node_parse(NumaNodeOptions *node,

[Qemu-devel] [PATCH v2 06/11] vhost-scsi: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/scsi/vhost-scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index dcb2bc5..54f916e 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c

[Qemu-devel] [PATCH v2 07/11] vfio: Remove superfluous '\n' around error_report()

2015-02-24 Thread arei.gonglei
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster --- hw/vfio/common.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index c5d1551..9289389 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -201,7 +201

[Qemu-devel] [PATCH v2 00/11] trivial: Remove superfluous '\n' around error_report/error_setg

2015-02-24 Thread arei.gonglei
From: Gonglei v2 -> v1: - remove superfluous "" in patch 3. (Michael Tokarev) - move qemu-img.c hunk from patch 5 to patch 1. (Markus) - add 'R-by' tag for this patch series. Yestoday, I found that some files have superflous '\n' charactor around error_report/error_setg when reviewed patches.

  1   2   3   4   5   6   7   8   9   10   >