Re: [Qemu-devel] [PATCH] hw/arm/vexpress: Fix memory leak reported by Coverity

2015-03-14 Thread Eric Blake
On 03/14/2015 04:59 AM, Stefan Weil wrote: > As the conditional statement had to be splitted anyway, we can also s/splitted/split/ (one of those weird English words that has the same spelling for both present and past tenses) > add a better error report message. > > Signed-off-by: Stefan Weil >

[Qemu-devel] [PATCH] fdc: remove sparc sun4m mutations

2015-03-14 Thread Hervé Poussineau
They were introduced in 6f7e9aec5eb5bdfa57a9e458e391b785c283a007 and 82407d1a4035e5bfefb53ffdcb270872f813b34c and lots of bug fixes were done after that. This fixes (at least) the detection of the floppy controller on Debian 4.0r9/SPARC, and SS-5's OBP initialization routine still works. Signed

Re: [Qemu-devel] [PATCH 0/1] Get the list of arguments from a QMP command

2015-03-14 Thread Markus Armbruster
Kevin Wolf writes: > Am 11.03.2015 um 20:22 hat Markus Armbruster geschrieben: >> Alberto Garcia writes: >> >> > On Wed, Mar 11, 2015 at 11:21:43AM +0100, Markus Armbruster wrote: >> > >> >> > I can actually try to implement full introspection support, but I >> >> > would like to know what API

[Qemu-devel] [PATCH] nvme: Fix unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

2015-03-14 Thread Stefan Weil
The shift operation on nlb gives a 32 bit result if no type cast is applied. This bug was reported by Coverity. Signed-off-by: Stefan Weil --- hw/block/nvme.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 0f3dfb9..1e07166 100644 --

[Qemu-devel] [PATCH] elf-loader: Add missing error handling for call of lseek

2015-03-14 Thread Stefan Weil
This fixes a warning from Coverity. Signed-off-by: Stefan Weil --- include/hw/elf_ops.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/elf_ops.h b/include/hw/elf_ops.h index 16a627b..bd71968 100644 --- a/include/hw/elf_ops.h +++ b/include/hw/elf_ops.h @@ -31

[Qemu-devel] [PATCH] spapr: Add missing checks for NULL pointers and report failures

2015-03-14 Thread Stefan Weil
This fixes potential runtime crashes and two warnings from Coverity. The new error message does not add a prefix "qemu:" because that is already done in function hw_error. It also starts with an uppercase letter because that seems to be the mostly used form. Signed-off-by: Stefan Weil --- I su

[Qemu-devel] [PATCH] linux-user: Add missing check for return value of lock_user

2015-03-14 Thread Stefan Weil
This fixes a warning from Coverity: "Dereference null return value (NULL_RETURNS)" Signed-off-by: Stefan Weil --- linux-user/flatload.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 566a7a8..56ac790 100644 --- a

[Qemu-devel] Get the memory trace

2015-03-14 Thread Wenjie Liu
Hi all, Recently, I am trying to get the memory trace from qemu. Since I am using qemu by Marss, so the version of qemu is 0.14. I have tried several ways to get the guest physical address and the corresponding address, by hacking the watch_memo_read* or glue function. Unfortunately, none of thes

[Qemu-devel] [PATCH] hw/arm/vexpress: Fix memory leak reported by Coverity

2015-03-14 Thread Stefan Weil
As the conditional statement had to be splitted anyway, we can also add a better error report message. Signed-off-by: Stefan Weil --- hw/arm/virt.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 9072bc2..87b50e3 100644 --- a/

Re: [Qemu-devel] [PATCH 0/2] target-i386: Haswell-noTSX and Broadwell-noTSX CPU models

2015-03-14 Thread Andreas Färber
Am 13.03.2015 um 20:45 schrieb Eduardo Habkost: > On Fri, Mar 13, 2015 at 08:25:19PM +0100, Andreas Färber wrote: >> Only thing that comes to mind is whether it might make sense to >> hierarchically make Broadwell the parent type of Broadwell-noTSX, to >> avoid duplication. But then again we alread

[Qemu-devel] [PATCH] hw/arm/vexpress: Fix memory leak reported by Coverity

2015-03-14 Thread Stefan Weil
As the conditional statement had to be splitted anyway, we can also add a better error report message. Signed-off-by: Stefan Weil --- hw/arm/vexpress.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 8496c16..54dd96

Re: [Qemu-devel] [PATCH] virtio: Fix memory leak reported by Coverity

2015-03-14 Thread Stefan Weil
Am 14.03.2015 um 11:31 schrieb Stefan Weil: Signed-off-by: Stefan Weil --- hw/9pfs/virtio-9p-local.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c This patch is superseded by a new one which fixes four si

[Qemu-devel] [PATCH v2] virtio: Fix memory leaks reported by Coverity

2015-03-14 Thread Stefan Weil
All four leaks are similar, so fix them in one patch. Signed-off-by: Stefan Weil --- v1 only fixed one of those leaks. v2 fixes all similar leaks. hw/9pfs/virtio-9p-local.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/hw/9pfs/virtio-9p-loc

[Qemu-devel] [PATCH] virtio: Fix memory leak reported by Coverity

2015-03-14 Thread Stefan Weil
Signed-off-by: Stefan Weil --- hw/9pfs/virtio-9p-local.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c index d05c917..055c7e2 100644 --- a/hw/9pfs/virtio-9p-local.c +++ b/hw/9pfs/virtio-9p-local.c @@ -488,7 +488

Re: [Qemu-devel] [PATCH] pci-assign: Fix warning from coverity (argument cannot be negative)

2015-03-14 Thread Shannon Zhao
On 2015/3/14 16:57, Stefan Weil wrote: > Coverity warns because function monitor_fd_param can return a negative > value which might be passed to function read. > > This won't happen because dev->config_fd will only be negative (-1) > when local_err is set. Yes. > > Signed-off-by: Stefan Weil >

[Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity

2015-03-14 Thread Stefan Weil
Signed-off-by: Stefan Weil --- hw/arm/digic_boards.c |1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c index 7114c36..ad70f7b 100644 --- a/hw/arm/digic_boards.c +++ b/hw/arm/digic_boards.c @@ -109,6 +109,7 @@ static void digic_load_rom(DigicBoard

Re: [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity

2015-03-14 Thread Stefan Weil
Am 14.03.2015 um 10:47 schrieb Shannon Zhao: Free data in function sdp_attr_write after use. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- For minimum modification, just add a variable to record the data. --- hw/bt/sdp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 delet

Re: [Qemu-devel] [PATCH v2] qga/commands-posix: Fix resource leak

2015-03-14 Thread Stefan Weil
Am 14.03.2015 um 10:52 schrieb Shannon Zhao: It's detected by coverity. Close the dirfd. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- v1->v2: close after use [Stefan Weil] --- qga/commands-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qga/commands-posix.c b

[Qemu-devel] [PATCH] hw/arm/highbank: Fix resource leak and wrong image loading

2015-03-14 Thread Stefan Weil
Coverity reports a resource leak for sysboot_filename which is allocated by qemu_find_file. In addition, that name is used to get the size of the image, but a different image name was used to load it. In addition, instead of passing the maximum allowed image size the actual image size was passed

[Qemu-devel] [PATCH v2] qga/commands-posix: Fix resource leak

2015-03-14 Thread Shannon Zhao
It's detected by coverity. Close the dirfd. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- v1->v2: close after use [Stefan Weil] --- qga/commands-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index d5bb5cb..ba8de62 10064

[Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity

2015-03-14 Thread Shannon Zhao
Free data in function sdp_attr_write after use. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- For minimum modification, just add a variable to record the data. --- hw/bt/sdp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c in

Re: [Qemu-devel] [PATCH] iotests: Fix 061's reference output

2015-03-14 Thread Markus Armbruster
Kevin Wolf writes: > Am 03.03.2015 um 20:57 hat Max Reitz geschrieben: >> As of commit dc523cd348c47372faa7271c9aab2030f94c290d, passing an unkown >> option name for image creation no longer results in that option's name >> printed. This affects iotest 061's output, fix it. >> >> Signed-off-by:

[Qemu-devel] [PATCH 2/2] qemu-img: Fix convert, amend error messages for unknown options

2015-03-14 Thread Markus Armbruster
Message quality regressed in commit dc523cd. Signed-off-by: Markus Armbruster --- qemu-img.c | 6 ++ tests/qemu-iotests/061.out | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 5af6f45..82d9078 100644 --- a/qemu-img.c +++ b/q

[Qemu-devel] [PATCH 1/2] iotests: Update 051's reference output

2015-03-14 Thread Markus Armbruster
Commit c4bacaf improved error reporting, but neglected to update 051.out. Commit 2726958 tried to redress, but didn't get it quite right (punctuation difference), and shortly after commit ae071cc..master improved error reporting some more, neglecting 051.out some more. Sorry! Signed-off-by: Mark

[Qemu-devel] [PATCH 0/2] Unbreak qemu-img error messages and iotests

2015-03-14 Thread Markus Armbruster
"check -T -qcow2" now passes again. Sorry for the mess I made. Markus Armbruster (2): iotests: Update 051's reference output qemu-img: Fix convert, amend error messages for unknown options qemu-img.c | 6 ++ tests/qemu-iotests/051.out | 4 +--- tests/qemu-iotests/061.out

Re: [Qemu-devel] [PATCH] hw/bt/sdp: Fix resource leak detect by coverity

2015-03-14 Thread Shannon Zhao
On 2015/3/14 14:57, Stefan Weil wrote: > Am 14.03.2015 um 04:42 schrieb Shannon Zhao: >> Free data in function sdp_attr_write after use. >> >> Signed-off-by: Shannon Zhao >> Signed-off-by: Shannon Zhao >> --- >> hw/bt/sdp.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/hw/bt/sdp.

Re: [Qemu-devel] [PATCH] qga/commands-posix: Fix resource leak

2015-03-14 Thread Shannon Zhao
On 2015/3/14 14:54, Stefan Weil wrote: > Am 14.03.2015 um 04:30 schrieb Shannon Zhao: >> It's detected by coverity. Close the dirfd. >> >> Signed-off-by: Shannon Zhao >> Signed-off-by: Shannon Zhao >> --- >> qga/commands-posix.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/qga

[Qemu-devel] [PATCH] pci-assign: Fix warning from coverity (argument cannot be negative)

2015-03-14 Thread Stefan Weil
Coverity warns because function monitor_fd_param can return a negative value which might be passed to function read. This won't happen because dev->config_fd will only be negative (-1) when local_err is set. Signed-off-by: Stefan Weil --- hw/i386/kvm/pci-assign.c |2 +- 1 file changed, 1 in

[Qemu-devel] [PATCH] elf-loader: Fix truncation warning from coverity

2015-03-14 Thread Stefan Weil
Coverity reports a truncation due to cast operation on operand reltab->sh_size from 64 bits to 32 bits for calls of load_at. Fix the types of the function arguments to match their use in function load_at: the offset is used for lseek which takes an off_t parameter, the size is used for g_malloc an

Re: [Qemu-devel] [PATCH] vl: fix resource leak with monitor_fdset_add_fd

2015-03-14 Thread Markus Armbruster
Eric Blake writes: > On 03/13/2015 06:55 AM, Paolo Bonzini wrote: >> monitor_fdset_add_fd returns an AddfdInfo struct (used by the QMP >> command add_fd). Free it. >> >> Signed-off-by: Paolo Bonzini >> --- >> v1->v2: line length [Fam], pass &error_abort [Shannon] >> --- >> vl.c | 7 +

Re: [Qemu-devel] [PATCH v2 2/7] vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()

2015-03-14 Thread Dmitry Fleytman
Looks good. Thanks. > On Mar 14, 2015, at 08:19, Thomas Huth wrote: > > The function is not used anymore and thus can be deleted. > > Signed-off-by: Thomas Huth > Cc: Dmitry Fleytman > --- > hw/net/vmxnet_rx_pkt.c |7 --- > hw/net/vmxnet_rx_pkt.h |9 - > 2 files changed, 0 i