Re: [Qemu-devel] [PATCH] qom: suppress conscan warning of returning null point

2014-09-19 Thread Paolo Bonzini
Il 20/09/2014 02:11, Amos Kong ha scritto: > Conscan complains about g_malloc0() and malloc() return null. > > Error: NULL_RETURNS (CWE-476): > qemu-kvm/qom/object.c:239: returned_null: Function "g_malloc0(gsize)" > returns null. > qemu-kvm/qom/object.c:239: var_assigned: Assigning: "ti->cl

Re: [Qemu-devel] [PATCH v4] Add HMP command "info memory-devices"

2014-09-19 Thread zhugh
On Fri, 2014-09-19 at 11:34 -0400, Luiz Capitulino wrote: > On Fri, 19 Sep 2014 15:30:19 +0200 > Igor Mammedov wrote: > > > On Thu, 18 Sep 2014 16:09:32 +0800 > > zhugh wrote: > > > > > Hi, > > > > > > Could anyone help to review this patch? > > > If there was no problem, could help to merge i

Re: [Qemu-devel] [PATCH] qom: suppress conscan warning of returning null point

2014-09-19 Thread Gonglei (Arei)
> Subject: [Qemu-devel] [PATCH] qom: suppress conscan warning of returning null > point > > Conscan complains about g_malloc0() and malloc() return null. > > Error: NULL_RETURNS (CWE-476): > qemu-kvm/qom/object.c:239: returned_null: Function "g_malloc0(gsize)" > returns null. > qemu-kvm/qom

[Qemu-devel] [PATCH] qom: suppress conscan warning of returning null point

2014-09-19 Thread Amos Kong
Conscan complains about g_malloc0() and malloc() return null. Error: NULL_RETURNS (CWE-476): qemu-kvm/qom/object.c:239: returned_null: Function "g_malloc0(gsize)" returns null. qemu-kvm/qom/object.c:239: var_assigned: Assigning: "ti->class" = null return value from "g_malloc0(gsize)". qe

Re: [Qemu-devel] [PATCH] chardev: Add reconnecting to client sockets

2014-09-19 Thread Eric Blake
On 09/19/2014 03:58 PM, miny...@acm.org wrote: > From: Corey Minyard > > Adds a "recon" option to socket backends that gives a reconnect > timeout. This only applies to client sockets. If the other end > of a socket closes the connection, qemu will attempt to reconnect > after the given number

Re: [Qemu-devel] [PATCH] chardev: Add reconnecting to client sockets

2014-09-19 Thread Paolo Bonzini
Il 19/09/2014 23:58, miny...@acm.org ha scritto: > From: Corey Minyard > > Adds a "recon" option to socket backends that gives a reconnect > timeout. This only applies to client sockets. If the other end > of a socket closes the connection, qemu will attempt to reconnect > after the given numbe

[Qemu-devel] [PATCH v4 17/19] qapi: Drop inline subtype in query-version

2014-09-19 Thread Eric Blake
A future patch will be using a 'name':{dictionary} entry in the QAPI schema to specify a default value for an optional argument; but existing use of inline substructs conflicts with that goal. This patch fixes one of only two commands relying on nested subtypes, by breaking the nesting into an expl

[Qemu-devel] [PATCH v4 14/19] qapi: More rigorous checking for type safety bypass

2014-09-19 Thread Eric Blake
Now that we have a way to validate every type, we can also be stricter about enforcing that callers that want to bypass type safety in generated code. Prior to this patch, it didn't matter what value was associated with the key 'gen', but it looked odd that 'gen':'yes' could result in bypassing th

[Qemu-devel] [PATCH v4 16/19] qapi: Drop tests for inline subtypes

2014-09-19 Thread Eric Blake
A future patch will be using a 'name':{dictionary} entry in the QAPI schema to specify a default value for an optional argument; but existing use of inline substructs conflicts with that goal. This patch fixes the testsuite to avoid nested subtypes, by breaking the nesting into explicit types. Whe

[Qemu-devel] [PATCH v4 18/19] qapi: Drop inline subtype in query-pci

2014-09-19 Thread Eric Blake
A future patch will be using a 'name':{dictionary} entry in the QAPI schema to specify a default value for an optional argument; but existing use of inline substructs conflicts with that goal. This patch fixes one of only two commands relying on nested subtypes, by breaking the nesting into an expl

[Qemu-devel] [PATCH v4 15/19] qapi: Merge UserDefTwo and UserDefNested in tests

2014-09-19 Thread Eric Blake
In the testsuite, UserDefTwo and UserDefNested were identical types other than the member names. Reduce code duplication by having just one type, and choose names that also favor reuse. This will also make it easier for a later patch to get rid of nested inline subtypes in QAPI. When touching cod

[Qemu-devel] [PATCH v4 19/19] qapi: Drop support for inline subtypes

2014-09-19 Thread Eric Blake
A future patch will be using a 'name':{dictionary} entry in the QAPI schema to specify a default value for an optional argument; but existing use of inline substructs conflicts with that goal. Now that all commands have been fixed to avoid inline substructs, nuke support for them, and turn it into

[Qemu-devel] [PATCH v4 06/19] qapi: Better error messages for bad enums

2014-09-19 Thread Eric Blake
The previous commit demonstrated that the generator had several flaws with less-than-perfect enums: - an enum that listed the same string twice (or two variant strings that map to the same C enum) ended up generating an invalid C enum - because the generator adds a _MAX terminator to each enum, the

[Qemu-devel] [PATCH v4 01/19] qapi: Consistent whitespace in tests/Makefile

2014-09-19 Thread Eric Blake
tests/Makefile had a mix of TAB vs. 8-space indentation; given that it is a Makefile, TAB is more idiomatic even though in these particular cases the choice of whitespace didn't matter. Signed-off-by: Eric Blake --- tests/Makefile | 32 1 file changed, 16 inserti

[Qemu-devel] [PATCH v4 13/19] qapi: More rigourous checking of types

2014-09-19 Thread Eric Blake
Now that we know every expression is valid with regards to its keys, we can add further tests that those keys refer to valid types. With this patch, all references to a type (the 'data': of command, type, union, and event, and the 'returns': of command) must resolve to a builtin or another type de

[Qemu-devel] [PATCH v4 11/19] qapi: Add tests of type bypass

2014-09-19 Thread Eric Blake
For a few QMP commands, we are forced to pass an arbitrary type without tracking it properly in QAPI. Among the existing clients, this unnamed type was spelled 'dict', 'visitor', and '**'; this patch standardizes on '**'. There is no difference to the generated code. As the feature was previousl

[Qemu-devel] [PATCH v4 08/19] qapi: Better error messages for bad expressions

2014-09-19 Thread Eric Blake
The previous commit demonstrated that the generator overlooked some fairly basic broken expressions: - missing metataype - metatype key has a non-string value - unknown key in relation to the metatype - conflicting metatype (this patch treats the second metatype as an unknown key of the first key v

[Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator silently parses confusing types, which may cause other errors later on. Later patches will update the expected results as the generator is made stricter. Signed-off-by: Eric Blake --- tests/Makefile | 8 ++-- tests/qapi-schema

[Qemu-devel] [PATCH v4 02/19] qapi: Ignore files created during make check

2014-09-19 Thread Eric Blake
After an in-tree build and run of 'make check-{qapi-schema,unit}', I noticed some leftover files. Signed-off-by: Eric Blake Reviewed-by: Wenchao Xia --- tests/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index c71c110..e2e4957 100644 ---

[Qemu-devel] [PATCH v4 07/19] qapi: Add some expr tests

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator doesn't deal well with expressions that aren't up to par. Later patches will improve the expected results as the generator is made stricter. Only one of the added tests actually behaves sanely at rejecting obvious problems. Note that in some cases, we reject ba

[Qemu-devel] [PATCH v4 04/19] qapi: Document type-safety considerations

2014-09-19 Thread Eric Blake
Go into more details about the various types of valid expressions in a qapi schema, including tweaks to document fixes being done later in the current patch series. Signed-off-by: Eric Blake --- docs/qapi-code-gen.txt | 249 ++--- 1 file changed, 217 i

[Qemu-devel] [PATCH v4 05/19] qapi: Add some enum tests

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator doesn't deal well with enums that aren't up to par. Later patches will update the expected results as the generator is made stricter. Signed-off-by: Eric Blake --- tests/Makefile | 5 - tests/qapi-schema/enum-clash-member.err | 0

[Qemu-devel] [PATCH v4 03/19] qapi: Update docs given recent event, spacing fixes

2014-09-19 Thread Eric Blake
Commit 21cd70d added event support but didn't document what the generated code looks like. Commit 05dfb26 removed some unwanted spaces in the generated code, but didn't reflect those changes into the documentation. Finally, the docs start with a big disclaimer about QMP not using QAPI yet, which

[Qemu-devel] [PATCH v4 10/19] qapi: Better error messages for duplicated expressions

2014-09-19 Thread Eric Blake
The previous commit demonstrated that the generator overlooked duplicate expressions: - a complex type reusing a built-in type name - redeclaration of a type name, whether by the same or different metatype - redeclaration of a command or event - lack of tracking of 'size' as a built-in type Add a

[Qemu-devel] [PATCH v4 09/19] qapi: Add tests of redefined expressions

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator doesn't deal very well with redefined expressions. At the parse level, they are silently accepted; I'm not sure what would happen if we tried to go further and use it in generated code, but the end result can't be good. A later patch will tighten things up and

[Qemu-devel] [PATCH v4 00/19] drop qapi nested structs

2014-09-19 Thread Eric Blake
After dragging my feet due to some libvirt work, I've finally revived this patch series as promised. v3 was here: https://lists.gnu.org/archive/html/qemu-devel/2014-08/msg00725.html v4: update commit message style [Markus] add docs (patches 3-4 are new) [Markus] lots of new tests (spread am

Re: [Qemu-devel] [PATCH] chardev: Add reconnecting to client sockets

2014-09-19 Thread Matthew Garrett
On Fri, Sep 19, 2014 at 04:58:57PM -0500, miny...@acm.org wrote: > From: Corey Minyard > > Adds a "recon" option to socket backends that gives a reconnect > timeout. This only applies to client sockets. If the other end > of a socket closes the connection, qemu will attempt to reconnect > after

[Qemu-devel] [PATCH] chardev: Add reconnecting to client sockets

2014-09-19 Thread minyard
From: Corey Minyard Adds a "recon" option to socket backends that gives a reconnect timeout. This only applies to client sockets. If the other end of a socket closes the connection, qemu will attempt to reconnect after the given number of seconds. This rearranges things a bit, all socket confi

[Qemu-devel] [PATCH] pc: Add missing 'static' attribute

2014-09-19 Thread Stefan Weil
This fixes a warning from smatch (static code analysis). Signed-off-by: Stefan Weil --- hw/i386/pc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2c2e9dc..82a7daa 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -75,7 +75,7 @@ /* Leave

Re: [Qemu-devel] [RFC] vfio: migration to trace points

2014-09-19 Thread Alexander Graf
On 19.09.14 18:07, Eric Auger wrote: > Hi Stefan, > > Thanks for asking. Actually I think this is a bit early. I would like > some VFIO PCI users experiencing it a little bit (typically Alex) and > confirm they are happy with it. Don't be so reluctant - this patch is a step forward, so just mar

Re: [Qemu-devel] [PATCH v3 0/4] qapi: fix crash in dealloc visitor for union types

2014-09-19 Thread Michael Roth
Quoting Luiz Capitulino (2014-09-19 12:52:17) > On Thu, 18 Sep 2014 15:36:39 -0500 > Michael Roth wrote: > > > This series introduces visit_start_union and visit_end_union as a way > > of allowing visitors to trigger generated code to bail out on visiting > > union fields if the visitor implement

Re: [Qemu-devel] [PULL 00/59] Block patches

2014-09-19 Thread Peter Maydell
On 19 September 2014 07:41, Stefan Hajnoczi wrote: > The following changes since commit 10e11f4d2bf171f99c6b13883a510acfbc5dd585: > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > (2014-09-18 20:02:01 +0100) > > are available in the git repository at: > > > git:/

Re: [Qemu-devel] [edk2] [INVITE] OVMF BoF session at the KVM Forum 2014

2014-09-19 Thread Ard Biesheuvel
On 19 September 2014 10:03, Paolo Bonzini wrote: > Il 19/09/2014 16:17, Ard Biesheuvel ha scritto: >> >>> > (**) Ard's patches for the upstream host kernel (== KVM) have been... >>> > ugh, not sure... applied to a maintainer tree? Ard? :) >>> > >> Some are in kvm/master, which I think means to sho

Re: [Qemu-devel] [PATCH v3 0/4] qapi: fix crash in dealloc visitor for union types

2014-09-19 Thread Luiz Capitulino
On Thu, 18 Sep 2014 15:36:39 -0500 Michael Roth wrote: > This series introduces visit_start_union and visit_end_union as a way > of allowing visitors to trigger generated code to bail out on visiting > union fields if the visitor implementation deems doing so to be unsafe. > > See patch 1 for th

Re: [Qemu-devel] [PATCH] exec.c: fix setting 1-byte-long watchpoints

2014-09-19 Thread Peter Maydell
On 18 September 2014 11:33, Peter Maydell wrote: > On 17 September 2014 22:03, Max Filippov wrote: >> With commit 05068c0dfb5b 'exec.c: Relax restrictions on watchpoint length >> and alignment' it's no longer possible to set 1-byte-long watchpoint >> because of incorrect address range check. >> F

Re: [Qemu-devel] [PATCH v3 02/23] block: New BlockBackend

2014-09-19 Thread Markus Armbruster
Kevin Wolf writes: > Am 16.09.2014 um 20:12 hat Markus Armbruster geschrieben: >> A block device consists of a frontend device model and a backend. >> >> A block backend has a tree of block drivers doing the actual work. >> The tree is managed by the block layer. >> >> We currently use a single

Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure

2014-09-19 Thread Luiz Capitulino
On Fri, 19 Sep 2014 19:16:08 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Fri, 19 Sep 2014 09:27:04 +0200 > > Markus Armbruster wrote: > > > >> connect() doesn't "connect to socket", it connects a socket to an > >> address and, if it's of type SOCK_STREAM, initiates a conn

Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure

2014-09-19 Thread Markus Armbruster
Luiz Capitulino writes: > On Fri, 19 Sep 2014 09:27:04 +0200 > Markus Armbruster wrote: > >> connect() doesn't "connect to socket", it connects a socket to an >> address and, if it's of type SOCK_STREAM, initiates a connection. >> Scratch "to". >> >> listen() does "set socket to listening mode"

Re: [Qemu-devel] [question] virtio-net-device and multi-queue option

2014-09-19 Thread Eric Auger
On 09/19/2014 04:30 AM, Gonglei (Arei) wrote: >> From: Eric Auger [mailto:eric.au...@linaro.org] >> Sent: Friday, September 19, 2014 10:23 AM >> To: Gonglei (Arei); qemu list; Michael S. Tsirkin >> Subject: Re: [Qemu-devel] [question] virtio-net-device and multi-queue option >> >> On 09/19/2014 03:

Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure

2014-09-19 Thread Luiz Capitulino
On Fri, 19 Sep 2014 09:27:04 +0200 Markus Armbruster wrote: > connect() doesn't "connect to socket", it connects a socket to an > address and, if it's of type SOCK_STREAM, initiates a connection. > Scratch "to". > > listen() does "set socket to listening mode", but it sounds awkward. > Change to

Re: [Qemu-devel] [edk2] [INVITE] OVMF BoF session at the KVM Forum 2014

2014-09-19 Thread Paolo Bonzini
Il 19/09/2014 16:17, Ard Biesheuvel ha scritto: > >> > (**) Ard's patches for the upstream host kernel (== KVM) have been... >> > ugh, not sure... applied to a maintainer tree? Ard? :) >> > > Some are in kvm/master, which I think means to should go into the next > 3.17-rc, although I haven't seen

Re: [Qemu-devel] [PATCH] Fix cross compilation (nm command)

2014-09-19 Thread Peter Maydell
On 18 September 2014 12:55, Stefan Weil wrote: > Commit c261d774fb9093d00e0938a19f502fb220f62718 added one more binutils > tool: nm also needs a cross prefix. > > Signed-off-by: Stefan Weil > --- > configure |2 ++ > rules.mak |2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) App

[Qemu-devel] [PATCH 1/1] hmp: Remove "info pcmcia"

2014-09-19 Thread Markus Armbruster
This command lists PCMCIA sockets and cards. Only a few ARM boards have sockets (akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, z2), the only card is the DSCM-1 Hitachi Microdrive (qdev "microdrive"), and it is only inserted during machine init, if ever. So this command doesn'

Re: [Qemu-devel] [PATCH] Fix cross compilation (nm command)

2014-09-19 Thread Peter Maydell
On 19 September 2014 06:27, Paolo Bonzini wrote: > Il 18/09/2014 22:07, Peter Maydell ha scritto: >> On 18 September 2014 12:55, Stefan Weil wrote: >>> Commit c261d774fb9093d00e0938a19f502fb220f62718 added one more binutils >>> tool: nm also needs a cross prefix. >>> >>> Signed-off-by: Stefan Wei

Re: [Qemu-devel] [PATCH v3 02/23] block: New BlockBackend

2014-09-19 Thread Kevin Wolf
Am 16.09.2014 um 20:12 hat Markus Armbruster geschrieben: > A block device consists of a frontend device model and a backend. > > A block backend has a tree of block drivers doing the actual work. > The tree is managed by the block layer. > > We currently use a single abstraction BlockDriverState

Re: [Qemu-devel] [RFC] vfio: migration to trace points

2014-09-19 Thread Eric Auger
Hi Stefan, Thanks for asking. Actually I think this is a bit early. I would like some VFIO PCI users experiencing it a little bit (typically Alex) and confirm they are happy with it. Also as I mentionned in the commit message, I identified some parsing issues that forced me to change few format s

Re: [Qemu-devel] [RFC v2 1/3] blockdev: Add function to search for orphaned drives

2014-09-19 Thread John Snow
On 09/19/2014 04:28 AM, Markus Armbruster wrote: John Snow writes: Signed-off-by: John Snow --- blockdev.c| 19 +++ include/sysemu/blockdev.h | 1 + vl.c | 5 + 3 files changed, 25 insertions(+) diff --git a/blockdev.c b/block

Re: [Qemu-devel] [PATCH v4] Add HMP command "info memory-devices"

2014-09-19 Thread Luiz Capitulino
On Fri, 19 Sep 2014 15:30:19 +0200 Igor Mammedov wrote: > On Thu, 18 Sep 2014 16:09:32 +0800 > zhugh wrote: > > > Hi, > > > > Could anyone help to review this patch? > > If there was no problem, could help to merge it? > > > > thanks! > > zhu > > > > On Mon, 2014-09-15 at 19:31 +0800, Zhu Gu

Re: [Qemu-devel] [PATCH 00/15] AHCI test helper refactors

2014-09-19 Thread John Snow
On 09/19/2014 06:53 AM, Markus Armbruster wrote: John Snow writes: The original version of the AHCI test base which is now staged for being merged, processes the ahci_identify test in a monolithic fashion. In authoring new tests, it became necessary and obvious as to how the operation of th

[Qemu-devel] [PULL 42/59] docs: List all image elements currently supported by the fuzzer

2014-09-19 Thread Stefan Hajnoczi
From: Maria Kustova Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Maria Kustova Message-id: cb71485d0f55d1d8401eebaead8324eb78673060.1408450493.git.mari...@catit.be Signed-off-by: Stefan Hajnoczi --- docs/image-fuzzer.txt | 3 ++- 1 file changed, 2 insertions(+), 1 dele

[Qemu-devel] [PULL 40/59] qcow2: Add overlap-check.template option

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Being able to set the overlap-check option to a string and then refine it via the overlap-check.* options is a nice idea for the command line but does not work so well for non-flattened dicts. In that case, one can only specify either but not both, so add a field to overlap-check.

[Qemu-devel] [PULL 41/59] qapi/block-core: Add "new" qcow2 options

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz qcow2 supports more than four options by now, add the new options (overlap check mode and metadata cache size) Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 1408557576-14574-5-git-send-email-mre...@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.j

Re: [Qemu-devel] [PATCH v2 00/14] TCG ppc speedups

2014-09-19 Thread Paolo Bonzini
Il 18/09/2014 22:43, Tom Musta ha scritto: > I also attempted to identify the speedup of just these patches. My > test was booting an Ubunutu 14.04 (PPC64LE) image to the login > prompt, checking some of the timestamps along the way. I was able to > observe a speedup on a modest sized laptop (x86

[Qemu-devel] [PULL 59/59] block: Always compile virtio-blk dataplane

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Dataplane doesn't depend on linux-aio any more, so we don't need the compiling condition now. Configure options are kept but just print a message. Signed-off-by: Fam Zheng Reviewed-by: Paolo Bonzini Message-id: 1410329871-28885-4-git-send-email-f...@redhat.com --- configure

[Qemu-devel] [PULL 55/59] block: vhdx - fix reading beyond pointer during image creation

2014-09-19 Thread Stefan Hajnoczi
From: Jeff Cody In vhdx_create_metadata(), we allocate 40 bytes to entry_buffer for the various metadata table entries. However, we write out 64kB from that buffer into the new file. Only write out the correct 40 bytes. Signed-off-by: Jeff Cody Reviewed-by: Markus Armbruster Signed-off-by: S

[Qemu-devel] [PULL 48/59] ahci: add test_pci_enable to ahci-test.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow This adds a test wherein we engage the PCI AHCI device and ensure that the memory region for the HBA functionality is now accessible. Under Q35 environments, additional PCI configuration is performed to ensure that the HBA functionality will become usable. Signed-off-by: John Sn

[Qemu-devel] [PULL 57/59] virtio: Import virtio_vring.h

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng This header has no further dependencies. It only has some stable data types and primitive functions, so we can copy it to include/hw/virtio in order to allow vring code (and its user virtio-blk dataplane) to be built unconditionally, even for cross compiling. Suggested-by: Paolo

Re: [Qemu-devel] [PULL 00/01] Adding new syscalls to seccomp whitelist

2014-09-19 Thread Peter Maydell
On 19 September 2014 07:38, Eduardo Otubo wrote: > On Fri, Sep 19, 2014 at 4:15 PM, Peter Maydell > wrote: >> ...how about fixing your compile errors on non-x86 platforms >> before adding more stuff here? > > Hm, indeed. I should have double checked that. Thanks for pointing that out. > > Philip

Re: [Qemu-devel] [RFC patch 5/6] s390: implement pci instruction

2014-09-19 Thread Thomas Huth
Hi Frank, On Fri, 19 Sep 2014 13:54:34 +0200 frank.blasc...@de.ibm.com wrote: > From: Frank Blaschka > > This patch implements the s390 pci instructions in qemu. This allows > to attach qemu pci devices including vfio. This does not mean the > devices are functional but at least detection and

[Qemu-devel] [PULL 56/59] async: aio_context_new(): Handle event_notifier_init failure

2014-09-19 Thread Stefan Hajnoczi
From: Chrysostomos Nanakos On a system with a low limit of open files the initialization of the event notifier could fail and QEMU exits without printing any error information to the user. The problem can be easily reproduced by enforcing a low limit of open files and start QEMU with enough I/O

[Qemu-devel] [PULL 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks

2014-09-19 Thread Stefan Hajnoczi
From: Maria Kustova Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Maria Kustova Message-id: c9f4027b6f401c67e9d18f94aed29be445e81d48.1408450493.git.mari...@catit.be Signed-off-by: Stefan Hajnoczi --- tests/image-fuzzer/qcow2/fuzz.py | 16 +++- 1 file changed

[Qemu-devel] [PULL 45/59] ahci: Adding basic functionality qtest.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow Currently, there is no qtest to test the functionality of the AHCI functionality present within the Q35 machine type. This patch adds a skeleton for an AHCI test suite, and adds a simple sanity-check test case where we identify that the AHCI device is present, then disengage the

Re: [Qemu-devel] [PATCH 09/14] ppc: introduce ppc_get_crf and ppc_set_crf

2014-09-19 Thread Paolo Bonzini
Il 18/09/2014 21:51, Tom Musta ha scritto: > > Checkpatch fails: > WARNING: braces {} are necessary for all arms of this statement > #171: FILE: target-ppc/translate.c:1: > +if (ppc_get_crf(env, i) & 0x08) > [...] > -else if (env->crf[i] & 0x04) > [...] > a = 'G';

[Qemu-devel] [PULL 38/59] qcow2: Fix leak of QemuOpts in qcow2_open()

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Currently, the QemuOpts object opts is leaked if anything fails from its creation up to and including the image repair block. Fix this by freeing that object in the fail path. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet Message-id: 1408557576-145

[Qemu-devel] [PULL 50/59] ahci: Add test_hba_spec to ahci-test.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow Add a test routine that checks the boot-up values of the HBA configuration memory space against the AHCI 1.3 specification and Intel ICH9 data sheet (for Q35 machines) for adherence and sane values. The HBA is not yet engaged or put into the idle state. Signed-off-by: John Snow

[Qemu-devel] [PULL 35/59] iotests: Add more tests for qcow2 corruption

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Add tests for unaligned L1/L2/reftable entries and non-fatal corruption reports. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 1409926039-29044-6-git-send-email-mre...@redhat.com Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/060 | 56 +++

[Qemu-devel] [PULL 49/59] ahci: properly shadow the TFD register

2014-09-19 Thread Stefan Hajnoczi
From: John Snow In a real AHCI device, several S/ATA registers are mirrored or shadowed within the AHCI register set. These registers are not updated synchronously for each read access, but are instead updated after a Device-to-Host Register FIS packet is received. The D2H FIS contains the values

[Qemu-devel] [PULL 52/59] ahci: Add test_identify case to ahci-test.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow Utilizing all of the bring-up code in pci_enable and hba_enable, this test issues a simple IDENTIFY command via the HBA and retrieves the response via the PIO receive mechanisms of the HBA. Bugs: The DPS interrupt (Descriptor Processed Status) does not currently get set. This wil

[Qemu-devel] [PULL 58/59] vring: Better error handling if num is too large

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng To be more consistent inside this function. Signed-off-by: Fam Zheng Reviewed-by: Paolo Bonzini Message-id: 1410329871-28885-3-git-send-email-f...@redhat.com --- hw/virtio/dataplane/vring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/datapla

[Qemu-devel] [PULL 34/59] qcow2: Check L1/L2/reftable entries for alignment

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Offsets taken from the L1, L2 and refcount tables are generally assumed to be correctly aligned. However, this cannot be guaranteed if the image has been written to by something different than qemu, thus check all offsets taken from these tables for correct cluster alignment. Sig

[Qemu-devel] [PULL 47/59] ahci: Add test_pci_spec to ahci-test.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow Adds a specification adherence test for AHCI where the boot-up values for the PCI configuration space are compared against the AHCI 1.3 specification. This test does not itself attempt to engage the device. Signed-off-by: John Snow Message-id: 1408643079-30675-4-git-send-email-

[Qemu-devel] [PULL 51/59] ahci: Add test_hba_enable to ahci-test.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow This test engages the HBA functionality and initializes values to sane defaults to allow for minimal HBA functionality. Buffers are allocated and pointers are updated to allow minimal I/O commands to complete as expected. Error registers and responses are sanity checked for speci

[Qemu-devel] [PULL 53/59] block/archipelago: Fix typo in qemu_archipelago_truncate()

2014-09-19 Thread Stefan Hajnoczi
From: Chrysostomos Nanakos Fix a typo introduced by 94c80a438c85f2c19698547fbb115ea46d80c5f1 Signed-off-by: Chrysostomos Nanakos Signed-off-by: Stefan Hajnoczi --- block/archipelago.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/archipelago.c b/block/archipelago.c

[Qemu-devel] [PULL 33/59] qcow2: Use qcow2_signal_corruption() for overlaps

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Use the new function in case of a failed overlap check. This changes output in case of corruption, so adapt iotest 060's reference output accordingly. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet Message-id: 1409926039-29044-4-git-send-email-mre.

[Qemu-devel] [PULL 54/59] block: delete cow block driver

2014-09-19 Thread Stefan Hajnoczi
This patch removes support for the cow file format. Normally we do not break backwards compatibility but in this case there is no impact and it is the most logical option. Extraordinary claims require extraordinary evidence so I will show why removing the cow block driver is the right thing to do

[Qemu-devel] [PULL 39/59] qapi: Allow enums in anonymous unions

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 1408557576-14574-3-git-send-email-mre...@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/qapi-types.py | 2 ++ scripts/qapi-visit.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/script

[Qemu-devel] [PULL 26/59] qdev-monitor: fix segmentation fault on qdev_device_help()

2014-09-19 Thread Stefan Hajnoczi
From: Gonglei Normally, qmp_device_list_properties() may return NULL when a device haven't special properties excpet Object and DeviceState properties, such as virtio-balloon-device. We just need check local_err instead of prop_list. Example: Segmentation fault (core dumped) The backtrace as

[Qemu-devel] [PULL 46/59] ahci: MSI capability should be at 0x80, not 0x50.

2014-09-19 Thread Stefan Hajnoczi
From: John Snow In the Intel ICH9 data sheet, the MSI capability offset in the PCI configuration space for ICH9 AHCI devices is specified to be 0x80. Further, the PCI capability pointer should always point to 0x80 in ICH9 devices, despite the fact that AHCI 1.3 specifies that it should be pointi

[Qemu-devel] [PULL 44/59] layout: Add generators for refcount table and blocks

2014-09-19 Thread Stefan Hajnoczi
From: Maria Kustova Refcount structures are placed in clusters randomly selected from all unallocated host clusters. Reviewed-by: Stefan Hajnoczi Signed-off-by: Maria Kustova Reviewed-by: Fam Zheng Message-id: 7e2f38608db6fba2da53997390b19400d445c45d.1408450493.git.mari...@catit.be Signed-of

[Qemu-devel] [PULL 31/59] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when reading from an image, they should generally not be. Nonetheless, even an image only read from may of course be corrupted and this can be detected during normal operation. In this case, a non-fatal event should

[Qemu-devel] [PULL 30/59] qapi: Sort items in BlockdevOptions definition

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Signed-off-by: Fam Zheng Reviewed-by: Benoît Canet Reviewed-by: Eric Blake Message-id: 1410415798-20673-4-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 38 +++--- 1 file changed, 19 insertions(+), 19 d

[Qemu-devel] [PULL 37/59] hmp: fix memory leak at hmp_info_block_jobs()

2014-09-19 Thread Stefan Hajnoczi
From: Gonglei Signed-off-by: Gonglei Reviewed-by: Markus Armbruster Message-id: 1410874615-14292-1-git-send-email-arei.gong...@huawei.com Signed-off-by: Stefan Hajnoczi --- hmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hmp.c b/hmp.c index 40a90da..31fb6a1 100644 --- a/hmp.c +++

[Qemu-devel] [PULL 28/59] block: Introduce "null" drivers

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng This is an analogue to Linux null_blk. It can be used for testing or benchmarking block device emulation and general block layer functionalities such as coroutines and throttling, where disk IO is not necessary or wanted. Use null-aio:// for AIO version, and null-co:// for corout

[Qemu-devel] [PULL 32/59] qcow2: Add qcow2_signal_corruption()

2014-09-19 Thread Stefan Hajnoczi
From: Max Reitz Add a helper function for easily marking an image corrupt (on fatal corruptions) while outputting an informative message to stderr and via QAPI. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet Message-id: 1409926039-29044-3-git-send-email-mre...@redh

[Qemu-devel] [PULL 20/59] rbd: Drop rbd_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng And also drop the now unused "cancelled" field. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/rbd.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index b7f7d5f..e5341fc 100644 --- a/blo

[Qemu-devel] [PULL 36/59] image-fuzzer: Trivial readability and formatting improvements

2014-09-19 Thread Stefan Hajnoczi
From: Maria Kustova Signed-off-by: Maria Kustova Signed-off-by: Stefan Hajnoczi --- tests/image-fuzzer/qcow2/fuzz.py | 10 tests/image-fuzzer/runner.py | 49 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/tests/image-fuzze

[Qemu-devel] [PULL 25/59] block: Rename qemu_aio_release -> qemu_aio_unref

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Suggested-by: Benoît Canet Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block.c | 8 block/archipelago.c | 4 ++-- block/blkdebug.c| 2 +- block/blkverify.c | 2 +- block/curl.c| 10 +- block/iscsi.c | 6 +++-

[Qemu-devel] [PULL 24/59] block: Drop AIOCBInfo.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Now that all the implementations are converted to asynchronous version and we can emulate synchronous cancellation with it. Let's drop the unused member. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block.c | 24 ++-- include/bloc

[Qemu-devel] [PULL 18/59] quorum: fix quorum_aio_cancel()

2014-09-19 Thread Stefan Hajnoczi
From: Liu Yuan For a fifo read pattern, we only have one running aio (possible other cases that has less number than num_children in the future), so we need to check if .acb is NULL against bdrv_aio_cancel() to avoid segfault. Cc: Eric Blake Cc: Benoit Canet Cc: Kevin Wolf Cc: Stefan Hajnoczi

[Qemu-devel] [PULL 29/59] qapi: Sort BlockdevDriver enum data list

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Reviewed-by: Benoît Canet Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Message-id: 1410415798-20673-3-git-send-email-f...@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qapi

[Qemu-devel] [PULL 22/59] win32-aio: Drop win32_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/win32-aio.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/block/win32-aio.c b/block/win32-aio.c index 5030e32..eed86f7 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -106,22 +106,8

[Qemu-devel] [PULL 23/59] ide: Convert trim_aiocb_info.cancel to .cancel_async

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng We know that either bh is scheduled or ide_issue_trim_cb will be called again, so we just set i, j and ret to the right values. In both cases, ide_trim_bh_cb will be called. Also forward the cancellation to the iocb->aiocb which we get from bdrv_aio_discard. Signed-off-by: Fam Z

[Qemu-devel] [PULL 17/59] qed: Drop qed_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Also drop the now unused ->finished field. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/qed.c | 21 - 1 file changed, 21 deletions(-) diff --git a/block/qed.c b/block/qed.c index f8d9e12..7a15d44 100644 --- a/block/qed.c +++ b/block/qe

[Qemu-devel] [PULL 21/59] sheepdog: Convert sd_aiocb_info.cancel to .cancel_async

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Also drop the now unused SheepdogAIOCB.finished field. Note that this aio is internal to sheepdog driver and has NULL cb and opaque, and should be unused at all. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/sheepdog.c | 46 +++--

[Qemu-devel] [PULL 27/59] aio-win32: avoid out-of-bounds access to the events array

2014-09-19 Thread Stefan Hajnoczi
From: Paolo Bonzini If ret is WAIT_TIMEOUT and there was an event returned by select(), we can write to a location after the end of the array. But in that case we can retry the WaitForMultipleObjects call with the same set of events, so just move the event[ret - WAIT_OBJECT_0] assignment inside

[Qemu-devel] [PULL 19/59] quorum: Convert quorum_aiocb_info.cancel to .cancel_async

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Before, we cancel all the child requests with bdrv_aio_cancel, then free the acb.. Now we just kick off asynchronous cancellation of child requests and return, we know quorum_aio_cb will be called later, so in the end quorum_aio_finalize will take care of calling the caller's cb.

[Qemu-devel] [PULL 16/59] curl: Drop curl_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/curl.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/block/curl.c b/block/curl.c index 938f9d9..6f5d6ae 100644 --- a/block/curl.c +++ b/block/curl.c @@ -613,14 +613,8 @@ out_noclean: return -EINVA

[Qemu-devel] [PULL 15/59] blkverify: Drop blkverify_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Also the finished pointer is not used any more. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/blkverify.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/block/blkverify.c b/block/blkverify.c index 163064c..460393f 100644 --- a/block

[Qemu-devel] [PULL 13/59] archipelago: Drop archipelago_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng The cancelled flag is no longer useful. Later the request will complete as before, and cb will be called. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/archipelago.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/block

[Qemu-devel] [PULL 14/59] blkdebug: Drop blkdebug_aiocb_info.cancel

2014-09-19 Thread Stefan Hajnoczi
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/blkdebug.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 69b330e..08131b3 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -5

  1   2   >