Re: [Qemu-devel] [PULL 00/25] RISC-V Post-merge spec conformance and cleanup

2018-03-21 Thread Thomas Huth
On 20.03.2018 23:25, Michael Clark wrote: > The following changes since commit f1a63fcfcd92c88be8942b5ae71aef9749a4f135: > > Update version for v2.12.0-rc0 release (2018-03-20 19:04:22 +) > > are available in the git repository at: > > https://github.com/riscv/riscv-qemu.git tags/riscv-q

Re: [Qemu-devel] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not ""

2018-03-21 Thread Thomas Huth
On 20.03.2018 13:05, Michael S. Tsirkin wrote: > On Tue, Mar 20, 2018 at 09:58:23AM +0100, Laurent Vivier wrote: >> Le 20/03/2018 à 02:54, Michael S. Tsirkin a écrit : >>> QEMU coding style at the moment asks for all non-system >>> include files to be used with #include "foo.h". >>> However this ru

Re: [Qemu-devel] [Qemu-arm] [PATCH v2 2/2] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR

2018-03-21 Thread Shannon Zhao
On 2018/3/20 19:54, Peter Maydell wrote: > On 20 March 2018 at 11:36, Shannon Zhao wrote: >> >> >> On 2018/3/20 19:22, Peter Maydell wrote: >>> On 20 March 2018 at 07:26, Shannon Zhao wrote: While we skip the GIC_INTERNAL irqs, we don't change the register offset accordingly. This wil

Re: [Qemu-devel] make vm-test [was: [PATCH] maintainers: Add myself as a OpenBSD maintainer]

2018-03-21 Thread Fam Zheng
On Mon, 03/19 17:06, Eric Blake wrote: > On 02/16/2018 11:44 AM, Philippe Mathieu-Daudé wrote: > > On 02/16/2018 02:41 PM, Kamil Rytarowski wrote: > > > On 16.02.2018 18:30, Philippe Mathieu-Daudé wrote: > > > > But before announcing the host OS being supported again, I'd rather see > > > > reprodu

Re: [Qemu-devel] [PATCH 1/8] migration: stop compressing page in migration thread

2018-03-21 Thread Peter Xu
On Fri, Mar 16, 2018 at 04:05:14PM +0800, Xiao Guangrong wrote: > > Hi David, > > Thanks for your review. > > On 03/15/2018 06:25 PM, Dr. David Alan Gilbert wrote: > > > > migration/ram.c | 32 > > > > Hi, > >Do you have some performance numbers to show th

Re: [Qemu-devel] [PATCH v2 2/2] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR

2018-03-21 Thread Shannon Zhao
On 2018/3/20 16:42, Auger Eric wrote: > Hi Shannon, > On 20/03/18 08:26, Shannon Zhao wrote: >> While we skip the GIC_INTERNAL irqs, we don't change the register offset >> accordingly. This will overlap the GICR registers value and leave the >> last GIC_INTERNAL irq's registers out of update. >>

[Qemu-devel] [Bug 1757363] [NEW] infinite loop due to improper deal with "eret" on mips32

2018-03-21 Thread dantachen
Public bug reported: 1.qemu 2.9.1 release on the official web build with tcg 2.cmd: qemu-system-mips -kernel kernelfile 3. host: ubuntu 16.04.1 with linux kernel 4.6.2 x86_64 guest: mips bigendian 32bit (tplink firmware) detail: static inline void exception_return(CPUMIPSState *env) { de

Re: [Qemu-devel] [PATCH 2/8] migration: stop allocating and freeing memory frequently

2018-03-21 Thread Peter Xu
On Tue, Mar 13, 2018 at 03:57:33PM +0800, guangrong.x...@gmail.com wrote: > From: Xiao Guangrong > > Current code uses compress2()/uncompress() to compress/decompress > memory, these two function manager memory allocation and release > internally, that causes huge memory is allocated and freed ve

Re: [Qemu-devel] [PATCH] make: improve check for stale generated files in source dir

2018-03-21 Thread Laurent Vivier
Le 20/03/2018 à 15:23, Daniel P. Berrangé a écrit : > When doing a build with builddir != srcdir, if any generated files are > accidentally present in srcdir from a previous build, these can cause > unexpected failures. > > Currently there is a rule that checks for existance of config-host.mak, >

Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation

2018-03-21 Thread Marcel Apfelbaum
On 21/03/2018 4:07, Fam Zheng wrote: > On Tue, 03/20 12:30, Marcel Apfelbaum wrote: >> Hi Eric, >> >> On 19/03/2018 23:53, Eric Blake wrote: >>> Use the correct printf formats, so that a 32-bit compile doesn't >>> spit out lots of warnings about %lx being incompatible with uint64_t. >>> Broken sinc

Re: [Qemu-devel] [PATCH for-2.12] qcow2: Reset free_cluster_index when allocating a new refcount block

2018-03-21 Thread Alberto Garcia
On Tue 20 Mar 2018 06:54:15 PM CET, Eric Blake wrote: >> When we try to allocate new clusters we first look for available ones >> starting from s->free_cluster_index and once we find them we increase >> their reference counts. Before we get to call update_refcount() to do >> this last step s->free

Re: [Qemu-devel] [PULL 00/25] RISC-V Post-merge spec conformance and cleanup

2018-03-21 Thread Laurent Vivier
Le 21/03/2018 à 08:05, Thomas Huth a écrit : > On 20.03.2018 23:25, Michael Clark wrote: >> The following changes since commit f1a63fcfcd92c88be8942b5ae71aef9749a4f135: >> >> Update version for v2.12.0-rc0 release (2018-03-20 19:04:22 +) >> >> are available in the git repository at: >> >> h

Re: [Qemu-devel] [PATCH for-2.12 05/12] luks: Turn another invalid assertion into check

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:25PM +0100, Kevin Wolf wrote: > Commit e39e959e fixed an invalid assertion in the .bdrv_length > implementation, but left a similar assertion in place for > .bdrv_truncate. Instead of crashing when the user requests a too large > image size, fail gracefully. > > A fil

Re: [Qemu-devel] [PATCH for-2.12 06/12] qemu-iotests: Test invalid resize on luks

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:26PM +0100, Kevin Wolf wrote: > This tests that the .bdrv_truncate implementation for luks doesn't crash > for invalid image sizes. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/210 | 37 + > 1 file changed, 37 insertio

Re: [Qemu-devel] [PATCH for-2.12 04/12] qemu-iotests: Enable 025 for luks

2018-03-21 Thread Daniel P . Berrangé
On Tue, Mar 20, 2018 at 06:36:24PM +0100, Kevin Wolf wrote: > We want to test resizing even for luks. The only change that is needed > is to explicitly zero out new space for luks because it's undefined. > > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/025 | 9 - > 1 file changed

Re: [Qemu-devel] [PATCH for-2.12] rdma: Fix 32-bit compilation

2018-03-21 Thread Fam Zheng
On Wed, 03/21 11:20, Marcel Apfelbaum wrote: > On 21/03/2018 4:07, Fam Zheng wrote: > > On Tue, 03/20 12:30, Marcel Apfelbaum wrote: > >> Hi Eric, > >> > >> On 19/03/2018 23:53, Eric Blake wrote: > >>> Use the correct printf formats, so that a 32-bit compile doesn't > >>> spit out lots of warnings

Re: [Qemu-devel] [PATCH 3/8] migration: support to detect compression and decompression errors

2018-03-21 Thread Peter Xu
On Tue, Mar 13, 2018 at 03:57:34PM +0800, guangrong.x...@gmail.com wrote: > From: Xiao Guangrong > > Currently the page being compressed is allowed to be updated by > the VM on the source QEMU, correspondingly the destination QEMU > just ignores the decompression error. However, we completely mis

Re: [Qemu-devel] [PATCH v2 0/4] tpm: Fix initialization of a few flags of CRB interface

2018-03-21 Thread Marc-André Lureau
Hi On Tue, Mar 20, 2018 at 9:52 PM, Stefan Berger wrote: > Fix the initialization of a few flags of the CRB interface. I tested the > changes > with UEFI and it works fine. SeaBIOS needs to have the latest patches applied. > >Stefan > > Stefan Berger (4): > tpm: CRB: Set tpmRegValidSts fla

[Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Paolo Bonzini
If the user does not have permissions to send ioctls to the device (due to SELinux or cgroups, for example), the output can look like qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: Operation not permitted. Is this a SCSI device? but this is confusing because the ioct

Re: [Qemu-devel] [PATCH v2 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 03:16:52PM -0300, Eduardo Habkost wrote: > On Mon, Mar 19, 2018 at 06:29:08PM +0100, Vitaly Kuznetsov wrote: > > Roman Kagan writes: > > > (This is also a problem with has_msr_hv_frequencies, and is in general a > > > long-standing issue of hv_* properties being done differ

Re: [Qemu-devel] [PATCH v2 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Paolo Bonzini
On 20/03/2018 19:16, Eduardo Habkost wrote: >> Suggestions? (To be honest I don't really like us adding new hv_* >> property for every new Hyper-V feature we support. I doubt anyone needs >> 'partial' Hyper-V emulation. It would be nice to have a single versioned >> 'hv' feature implying everything

Re: [Qemu-devel] Bug AioContext polling is not implemented on Windows with qemu-system-ppc.exe

2018-03-21 Thread Paolo Bonzini
On 20/03/2018 18:11, Howard Spoelstra wrote: > Hi, > > I just built qemu-system-ppc.exe for windows using a fully up-to-date Fedora > 27. > Command line for build: > > ./configure --cross-prefix=x86_64-w64-mingw32- > --target-list="ppc-softmmu ppc64-softmmu" --enable-gtk > --with-gtkabi=3.0 --en

Re: [Qemu-devel] [PULL 00/25] RISC-V Post-merge spec conformance and cleanup

2018-03-21 Thread Paolo Bonzini
On 21/03/2018 08:05, Thomas Huth wrote: > On 20.03.2018 23:25, Michael Clark wrote: >> The following changes since commit f1a63fcfcd92c88be8942b5ae71aef9749a4f135: >> >> Update version for v2.12.0-rc0 release (2018-03-20 19:04:22 +) >> >> are available in the git repository at: >> >> https:

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 03:32:27PM -0300, Eduardo Habkost wrote: > On Tue, Mar 20, 2018 at 06:34:59PM +0100, Vitaly Kuznetsov wrote: > > @@ -1747,6 +1760,15 @@ static int kvm_put_msrs(X86CPU *cpu, int level) > > if (cpu->hyperv_time) { > > kvm_msr_entry_add(cpu, HV_X64

Re: [Qemu-devel] [PATCH v3 1/2] i386/kvm: add support for Hyper-V reenlightenment MSRs

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 06:34:59PM +0100, Vitaly Kuznetsov wrote: > KVM recently gained support for Hyper-V Reenlightenment MSRs which are > required to make KVM-on-Hyper-V enable TSC page clocksource to its guests > when INVTSC is not passed to it (and it is not passed by default in Qemu > as it e

Re: [Qemu-devel] [PATCH v3 15/16] block/mirror: Add copy mode QAPI interface

2018-03-21 Thread Max Reitz
On 2018-03-20 18:35, Eric Blake wrote: > On 02/28/2018 12:05 PM, Max Reitz wrote: >> This patch allows the user to specify whether to use active or only >> background mode for mirror block jobs.  Currently, this setting will >> remain constant for the duration of the entire block job. >> >> Signed-

[Qemu-devel] [PATCH] migration: fix pfd leak

2018-03-21 Thread Marc-André Lureau
Fix leak spotted by ASAN: Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7fe1abb80a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38) #1 0x7fe1aaf1bf75 in g_malloc0 ../glib/gmem.c:124 #2 0x7fe1aaf1c249 in g_malloc0_n ../glib/gmem.c:355 #3 0x55f4841cfaa9 in post

[Qemu-devel] [PATCH v3 07/49] qapi: mcgen() shouldn't indent # lines

2018-03-21 Thread Marc-André Lureau
Skip preprocessor lines when adding indentation, since that would likely result in invalid code. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index bc4ecd6c76..4

[Qemu-devel] [PATCH v3 01/49] qapi/visit: remove useless prefix argument

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/visit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 5d72d8936c..3c5ea1289e 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -293,7 +293,7 @@ class QAPISc

[Qemu-devel] [PATCH v3 02/49] qapi/events: generate event enum in main module

2018-03-21 Thread Marc-André Lureau
The event generator produces an enum, and put it in the last visited module. It fits better in the main module, since it's the set of all visited events, from all modules. Signed-off-by: Marc-André Lureau --- scripts/qapi/events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH v3 05/49] qapi: leave the ifcond attribute undefined until check()

2018-03-21 Thread Marc-André Lureau
We commonly initialize attributes to None in .init(), then set their real value in .check(). Accessing the attribute before .check() yields None. If we're lucky, the code that accesses the attribute prematurely chokes on None. It won't for .ifcond, because None is a legitimate value. Leave the

[Qemu-devel] [PATCH v3 04/49] qapi: pass 'if' condition into QAPISchemaEntity objects

2018-03-21 Thread Marc-André Lureau
Built-in objects remain unconditional. Explicitly defined objects use the condition specified in the schema. Implicitly defined objects inherit their condition from their users. For most of them, there is exactly one user, so the condition to use is obvious. The exception is the wrapped type's

[Qemu-devel] [PATCH v3 03/49] qapi: add 'if' to top-level expressions

2018-03-21 Thread Marc-André Lureau
Accept 'if' key in top-level elements, accepted as string or list of string type. The following patches will modify the test visitor to check the value is correctly saved, and generate #if/#endif code (as a single #if/endif line or a series for a list). Example of 'if' key: { 'struct': 'TestIfStru

[Qemu-devel] [PATCH v3 00/49] qapi: add #if pre-processor conditions to generated code

2018-03-21 Thread Marc-André Lureau
Hi, In order to clean-up some hacks in qapi (having to unregister commands at runtime), I proposed a "[PATCH v5 02/20] qapi.py: add a simple #ifdef condition" (see http://lists.gnu.org/archive/html/qemu-devel/2016-08/msg03106.html). However, we decided to drop that patch from the series and sol

[Qemu-devel] [PATCH v3 11/49] qapi/commands: add #if conditions to commands

2018-03-21 Thread Marc-André Lureau
Wrap generated code with #if/#endif using an 'ifcontext' on QAPIGenCSnippet objects. Signed-off-by: Marc-André Lureau --- scripts/qapi/commands.py | 19 ++- tests/test-qmp-cmds.c| 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/qapi/commands.

[Qemu-devel] [PATCH v3 13/49] qapi-types: refactor variants handling

2018-03-21 Thread Marc-André Lureau
Generate variants objects outside gen_object(). This will allow to easily wrap gen_object() with ifcond_decorator in the following patch. gen_variants_objects() calls gen_object() for each variants, so it remains guarded for each generated variant object. self._gen_type_cleanup(name) is factored

[Qemu-devel] [PATCH v3 09/49] qapi-introspect: modify to_qlit() to append ', ' on level > 0

2018-03-21 Thread Marc-André Lureau
The following patch is going to break list entries with #if/#endif, so they should have the trailing ',' as suffix. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/introspect.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/

[Qemu-devel] [PATCH v3 06/49] qapi: add 'ifcond' to visitor methods

2018-03-21 Thread Marc-André Lureau
Modify the test visitor to check correct passing of values. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/commands.py | 2 +- scripts/qapi/common.py | 31 ++ scripts/qapi/doc.py| 10 +++

[Qemu-devel] [PATCH v3 14/49] qapi-types: add #if conditions to types & visitors

2018-03-21 Thread Marc-André Lureau
Types & visitors are coupled and must be handled together to avoid temporary build regression. Wrap generated types/visitor code with #if/#endif using the context helpers. Signed-off-by: Marc-André Lureau --- scripts/qapi/types.py | 46 ++- scripts/qapi/v

[Qemu-devel] [PATCH v3 10/49] qapi-introspect: add preprocessor conditions to generated QLit

2018-03-21 Thread Marc-André Lureau
The generator will take (obj, condition) tuples to wrap generated QLit objects for 'obj' with #if/#endif conditions. This commit adds 'ifcond' condition to top-level QLit objects. See generated tests/test-qmp-introspect.c. Example diff after this patch: --- before 2018-01-08 11:55:24.757083

[Qemu-devel] [PATCH v3 08/49] qapi: add #if/#endif helpers

2018-03-21 Thread Marc-André Lureau
Add helpers to wrap generated code with #if/#endif lines. Add QAPIGenCSnippet class to write C snippet code, make QAPIGenC inherit from it, for full C files with copyright headers etc. Add a 'with' statement context manager that will be used to wrap generator visitor methods. The manager will ch

[Qemu-devel] [PATCH v3 17/49] qapi: change enum visitor to take QAPISchemaMember

2018-03-21 Thread Marc-André Lureau
This will allow to add and access more properties associated with enum values/members, like the associated 'if' condition. We may want to have a specialized type QAPISchemaEnumMember, for now this will do. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- scripts/qapi/common.

[Qemu-devel] [PATCH v3 19/49] qapi: factor out check_known_keys()

2018-03-21 Thread Marc-André Lureau
The following patches are going to need similar checks from various code path. This refactoring will report all conflicting keys (instead of the first one encountered). Modify unknown-expr-key to check plural form. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 2

[Qemu-devel] [PATCH v3 12/49] qapi/events: add #if conditions to events

2018-03-21 Thread Marc-André Lureau
Wrap generated code with #if/#endif using an 'ifcontext' on QAPIGenCSnippet objects. Signed-off-by: Marc-André Lureau --- scripts/qapi/events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 26ae00f6f7..dae03e3d88 1

[Qemu-devel] [PATCH v3 23/49] qapi: rename allow_dict to allow_implicit

2018-03-21 Thread Marc-André Lureau
This makes it a bit clearer what is the intent of the dictionnary for the check_type() function, since there was some confusion on a previous iteration of this series. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 12 ++-- 1 file changed,

[Qemu-devel] [PATCH v3 18/49] tests: modify visit_enum_type() in test-qapi to print members

2018-03-21 Thread Marc-André Lureau
Use a common self._print_members() to print enum members details. Signed-off-by: Marc-André Lureau --- tests/qapi-schema/comments.out | 14 ++- tests/qapi-schema/doc-bad-section.out| 13 ++- tests/qapi-schema/doc-good.out | 17 ++-- tests/qapi-schema/empty.out

[Qemu-devel] [PATCH v3 21/49] qapi: add 'if' to enum members

2018-03-21 Thread Marc-André Lureau
QAPISchemaMember gains .ifcond for enum members: inherited classes, such as QAPISchemaObjectTypeMember, will thus have an ifcond member after this (those different types will also use the .ifcond to store the condition and generate conditional code in the following patches). Generated code is not

[Qemu-devel] [PATCH v3 15/49] qapi: do not define enumeration value explicitely

2018-03-21 Thread Marc-André Lureau
The C standard has the initial value at 0 and the subsequent values incremented by 1. No need to set this explicitely. This will prevent from artificial "gaps" when compiling out some enum values and having unnecessarily large MAX values & enums arrays. Signed-off-by: Marc-André Lureau --- scri

[Qemu-devel] [PATCH v3 20/49] qapi: add a dictionnary form with 'name' key for enum members

2018-03-21 Thread Marc-André Lureau
Desugar the enum NAME form to { 'name': NAME }. This will allow to add new enum members, such as 'if' in the following patch. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py| 49 --- tests/Makefile.include| 3 +- tests/

[Qemu-devel] [PATCH v3 26/49] qapi: add an error in case a discriminator is conditionnal

2018-03-21 Thread Marc-André Lureau
Making a discriminator conditonal doesn't make much sense. Instead, the union could be made conditional. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 11 +-- tests/Makefile.include | 1 + .../flat-union-invalid-if-discri

[Qemu-devel] [PATCH v3 27/49] qapi: add 'if' on union members

2018-03-21 Thread Marc-André Lureau
Add 'if' key to union members: { 'union': 'TestIfUnion', 'data': 'mem': { 'type': 'str', 'if': 'COND'} } Generated code is not changed by this patch but with "qapi: add #if conditions to generated code". Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 17

[Qemu-devel] [PATCH v3 16/49] qapi: rename QAPISchemaEnumType.values to .members

2018-03-21 Thread Marc-André Lureau
Rename QAPISchemaEnumType.values and related variables to members. Makes sense ever since commit 93bda4dd4 changed .values from list of string to list of QAPISchemaMember. Obvious no-op. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 36 +-

[Qemu-devel] [PATCH v3 25/49] qapi: add 'if' to implicit struct members

2018-03-21 Thread Marc-André Lureau
Generated code is not changed by this patch, but with "qapi: add #if conditions to generated code" patch. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 14 +++--- tests/qapi-schema/qapi-schema-test.json | 12 +--- tests/qapi-schema/qapi-schema-tes

[Qemu-devel] [PATCH v3 32/49] qapi2texi: add 'If:' condition to enum values

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 5 - tests/qapi-schema/doc-good.json | 4 +++- tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/doc-good.texi | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/doc.py b/scripts/qa

[Qemu-devel] [PATCH v3 28/49] qapi: add 'if' to alternate members

2018-03-21 Thread Marc-André Lureau
Add 'if' key to alternate members: { 'alternate': 'TestIfAlternate', 'data': { 'alt': { 'type': 'TestStruct', 'if': 'COND' } } } Generated code is not changed by this patch but with "qapi: add #if conditions to generated code". Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py

[Qemu-devel] [PATCH v3 22/49] qapi-event: add 'if' condition to implicit event enum

2018-03-21 Thread Marc-André Lureau
Add condition to QAPIEvent enum members based on the event 'if'. Generated code is not changed by this patch, but with "qapi: add #if conditions to generated code" patch. There is no coverage of this change in qapi-schema-test.out since the event_names enum is an implicit type created by qapi-eve

[Qemu-devel] [PATCH v3 43/49] qapi: make s390 commands depend on TARGET_S390X

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Acked-by: Cornelia Huck --- qapi/misc.json | 101 -- qapi/target.json| 106 include/sysemu/arch_init.h | 7 -- hw/s390x/s390-skeys.c |

[Qemu-devel] [PATCH v3 24/49] qapi: add a dictionary form with 'type' key for members

2018-03-21 Thread Marc-André Lureau
Wherever a struct/union/alternate/command/event member with NAME: TYPE form is accepted, desugar it to a NAME: { 'type': TYPE } form. This will allow to add new member details, such as 'if' in the following patch to introduce conditionals, or 'default' for default values etc. Signed-off-by: Marc-

Re: [Qemu-devel] [PATCH v2 0/4] tpm: Fix initialization of a few flags of CRB interface

2018-03-21 Thread Stefan Berger
On 03/21/2018 06:35 AM, Marc-André Lureau wrote: Hi On Tue, Mar 20, 2018 at 9:52 PM, Stefan Berger wrote: Fix the initialization of a few flags of the CRB interface. I tested the changes with UEFI and it works fine. SeaBIOS needs to have the latest patches applied. Stefan Stefan Berger (

[Qemu-devel] [PATCH v3 31/49] qapi2texi: add 'If:' section to generated documentation

2018-03-21 Thread Marc-André Lureau
The documentation is generated only once, and doesn't know C pre-conditions. Add 'If:' sections for top-level entities. Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 22 -- tests/qapi-schema/doc-good.json | 2 +- tests/qapi-schema/doc-good.out | 1

[Qemu-devel] [PATCH v3 49/49] RFC: make RTC_CHANGE per-target

2018-03-21 Thread Marc-André Lureau
A few targets don't emit RTC_CHANGE, we could restrict the event to the tagets that do emit it. Note: There is a lot more of events & commands that we could restrict to capable targets, with the cost of some additional complexity, but the benefit of added correctness and better introspection. Not

[Qemu-devel] [PATCH v3 29/49] qapi: add #if conditions to generated code members

2018-03-21 Thread Marc-André Lureau
Wrap generated enum/struct members and code with #if/#endif, using the .ifcond members added in the previous patches. Some types generate both enum and struct members for example, so a step-by-step is unnecessarily complicated to deal with (it would easily generate invalid intermediary code). Sig

[Qemu-devel] [PATCH v3 33/49] qapi2texi: add 'If:' condition to struct members

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 4 +++- tests/qapi-schema/doc-good.json | 3 ++- tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/doc-good.texi | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/doc.py b/scripts/qapi/

[Qemu-devel] [PATCH v3 30/49] docs: document schema configuration

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- docs/devel/qapi-code-gen.txt | 38 1 file changed, 38 insertions(+) diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index a569d24745..eec52e63e5 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs

[Qemu-devel] [PATCH v3 36/49] qapi: add conditions to SPICE type/commands/events on the schema

2018-03-21 Thread Marc-André Lureau
Add #if defined(CONFIG_SPICE) in generated code, and adjust the qmp/hmp code accordingly. query-qmp-schema no longer reports the command/events etc as available when disabled at compile time. Commands made conditional: * query-spice Before the patch, the command for !CONFIG_SPICE is unregiste

[Qemu-devel] [PATCH v3 38/49] build-sys: move qmp-introspect per target

2018-03-21 Thread Marc-André Lureau
The following patches are going to introduce per-target #ifdef in the schemas. The introspection data is statically generated once, and must thus be built per-target to reflect target-specific configuration. Drop "do_test_visitor_in_qmp_introspect(&qmp_schema_qlit)" since the schema is no longer

[Qemu-devel] [PATCH v3 41/49] qapi: add a top-unit 'target' schema

2018-03-21 Thread Marc-André Lureau
Add a 'target' top-unit to be compiled seperately from the common qapi modules, in order to allow poisoined target #ifdef. The generated commands must be registered seperately. The events have a different enum, and must thus use a different limiter/emitter. Signed-off-by: Marc-André Lureau ---

[Qemu-devel] [PULL v1 1/4] tpm: CRB: Set tpmRegValidSts flag to '1' in device reset

2018-03-21 Thread Stefan Berger
Fix the initialization of the tpmRegValidSts flag and set it to '1' during device reset without expecting a write to another register. This seems to also be the default behavior of real hardware. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_crb.c | 4 ++-- 1 file c

[Qemu-devel] [PATCH v3 34/49] qapi2texi: add condition to variants

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 5 +++-- tests/qapi-schema/doc-good.json | 4 ++-- tests/qapi-schema/doc-good.out | 3 +++ tests/qapi-schema/doc-good.texi | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/doc.py b/script

[Qemu-devel] [PATCH v3 44/49] target.json: add a note about query-cpu* not being s390x-specific

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Acked-by: Cornelia Huck --- qapi/target.json | 6 ++ 1 file changed, 6 insertions(+) diff --git a/qapi/target.json b/qapi/target.json index b07a8926d8..be0ff84a6e 100644 --- a/qapi/target.json +++ b/qapi/target.json @@ -241,6 +241,9 @@ # an unknown

[Qemu-devel] [PATCH v3 42/49] qapi: make rtc-reset-reinjection and SEV depend on TARGET_I386

2018-03-21 Thread Marc-André Lureau
Move rtc-reset-reinjection and SEV in target.json and make them conditional on TARGET_I386. Signed-off-by: Marc-André Lureau --- qapi/misc.json | 166 -- qapi/target.json | 175 - target/i386/sev_i386.h |

[Qemu-devel] [PATCH v3 35/49] qapi: add conditions to VNC type/commands/events on the schema

2018-03-21 Thread Marc-André Lureau
Add #if defined(CONFIG_VNC) in generated code, and adjust the qmp/hmp code accordingly. query-qmp-schema no longer reports the command/events etc as available when disabled at compile. Commands made conditional: * query-vnc, query-vnc-servers, change-vnc-password Before the patch, the command

[Qemu-devel] [PULL v1 4/4] tpm: CRB: query backend for TPM established flag

2018-03-21 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_crb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index e8c42f6..ef8b80e 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -84,6 +84,12 @@ static uint64_t tpm_crb_mm

[Qemu-devel] [PATCH v3 47/49] qapi: make query-cpu-definitions depend on specific targets

2018-03-21 Thread Marc-André Lureau
It depends on TARGET_PPC || TARGET_ARM || TARGET_I386 || TARGET_S390X. Signed-off-by: Marc-André Lureau Reviewed-by: Eduardo Habkost Acked-by: Cornelia Huck --- qapi/misc.json | 10 -- qapi/target.json| 12 include/sysemu/arch_init.h | 1 - monit

[Qemu-devel] [PATCH v3 37/49] qapi: add conditions to REPLICATION type/commands on the schema

2018-03-21 Thread Marc-André Lureau
Add #if defined(CONFIG_REPLICATION) in generated code, and adjust the code accordingly. Made conditional: * xen-set-replication, query-xen-replication-status, xen-colo-do-checkpoint Before the patch, we first register the commands unconditionally in generated code (requires a stub), then c

[Qemu-devel] [PATCH v3 45/49] qapi: make query-gic-capabilities depend on TARGET_ARM

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- qapi/misc.json | 43 -- qapi/target.json | 45 monitor.c| 11 --- target/arm/monitor.c | 2 +- 4 files changed, 46 insertions(+), 55 deletions(-

Re: [Qemu-devel] [PATCH v3 2/2] i386/kvm: lower requirements for Hyper-V frequency MSRs exposure

2018-03-21 Thread Roman Kagan
On Tue, Mar 20, 2018 at 06:35:00PM +0100, Vitaly Kuznetsov wrote: > Requiring tsc_is_stable_and_known() is too restrictive: even without INVTCS > nested Hyper-V-on-KVM enables TSC pages for its guests e.g. when > Reenlightenment MSRs are present. Presence of frequency MSRs doesn't mean > these freq

[Qemu-devel] [PATCH v3 48/49] qapi: remove qmp_unregister_command()

2018-03-21 Thread Marc-André Lureau
This command is no longer needed after the schema is made conditional. Signed-off-by: Marc-André Lureau --- include/qapi/qmp/dispatch.h | 1 - qapi/qmp-registry.c | 8 2 files changed, 9 deletions(-) diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index f

[Qemu-devel] [PATCH v3 39/49] qapi-commands: don't initialize command list in qmp_init_marshall()

2018-03-21 Thread Marc-André Lureau
This will let the caller add several list of commands coming from different schemas (the following patches split the schemas for common and arch-specific parts). Signed-off-by: Marc-André Lureau --- scripts/qapi/commands.py | 2 -- monitor.c| 1 + qga/main.c | 1 +

[Qemu-devel] [PULL v1 3/4] tpm: CRB: reset locAssigned upon relinquishing locality

2018-03-21 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_crb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 4bd76b5..e8c42f6 100644 --- a/hw/tpm/tpm_crb.c +++ b/hw/tpm/tpm_crb.c @@ -137,6 +137,8 @@ static void tpm_crb_mmio_writ

Re: [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Laurent Vivier
On 21/03/2018 11:58, Paolo Bonzini wrote: > If the user does not have permissions to send ioctls to the device (due to > SELinux or cgroups, for example), the output can look like > > qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: > Operation not permitted. Is this a

[Qemu-devel] [PULL v1 2/4] tpm: CRB: set registers to 0 by default

2018-03-21 Thread Stefan Berger
Initialize all registers of the CRB device to 0. This clears a few flags upon a reset. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_crb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/tpm/tpm_crb.c b/hw/tpm/tpm_crb.c index 114b66e..4bd76b5 100644 --- a/h

Re: [Qemu-devel] [PATCH v1 3/6] migration: calculate vCPU blocktime on dst side

2018-03-21 Thread Dr. David Alan Gilbert
* Alexey Perevalov (a.pereva...@samsung.com) wrote: > This patch provides blocktime calculation per vCPU, > as a summary and as a overlapped value for all vCPUs. > > This approach was suggested by Peter Xu, as an improvements of > previous approch where QEMU kept tree with faulted page address and

[Qemu-devel] [PATCH v3 40/49] RFC: qapi: learn to split schema by 'top-unit'

2018-03-21 Thread Marc-André Lureau
Another take at making the schema modular, this time by introducing the concept of a 'top-unit'. With this approach, each module is part of a top-unit, which is visited first before visiting the module themselfs. The default 'top-unit' is None. Else, a module belong to a 'top-unit' whose name is gi

[Qemu-devel] [PATCH] dump: display cause of write failure

2018-03-21 Thread Laurent Vivier
Use error_setg_errno() to display the reason why data write has failed. For instance, instead of a laconic dump: failed to write elf header or dump: failed to save memory we have now: dump: failed to write elf header: No space left on device or dump: failed to save memory: No space left

[Qemu-devel] [PATCH v3 46/49] qapi: make query-cpu-model-expansion depend on s390 or x86

2018-03-21 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau Reviewed-by: Eduardo Habkost Acked-by: Cornelia Huck --- qapi/misc.json | 38 - qapi/target.json | 39 ++ include/sysemu/arch_init.h | 3 -- monitor.c

[Qemu-devel] [PATCH for-2.13 0/4] NBD export bitmaps

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Hi all. This is a proposal and realization of new NBD meta context: qemu-dirty-bitmap. (I'll send corresponding proposal to NBD protocol after some negotiation here) Corresponding queries will look like: qemu-dirty-bitmap: Mapping from export-bitmap-name to BdrvDirtyBitmap is done through qmp co

[Qemu-devel] [PULL v1 0/4] Merge tpm 2018/03/21

2018-03-21 Thread Stefan Berger
This series of patches fixes the initialization and setting of a few flags of the TPM CRB interface. The following changes since commit f1a63fcfcd92c88be8942b5ae71aef9749a4f135: Update version for v2.12.0-rc0 release (2018-03-20 19:04:22 +) are available in the git repository at: git://

[Qemu-devel] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block.json | 27 +++ blockdev-nbd.c | 23 +++ 2 files changed, 50 insertions(+) diff --git a/qapi/block.json b/qapi/block.json index c694524002..4afbbcd7b7 100644 --- a/qapi/block.json +++ b/qapi/bl

[Qemu-devel] [PATCH 3/4] nbd/server: implement dirty bitmap export

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 + nbd/server.c| 207 ++-- 2 files changed, 203 insertions(+), 6 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index fcdcd54502..f0b459283f 1006

[Qemu-devel] [PATCH 1/4] nbd/server: refactor nbd_negotiate_meta_query for several namespaces

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 60 +++- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index cea158913b..b830997114 100644 --- a/nbd/server.c +++ b/nbd/server.c @@

[Qemu-devel] [PATCH 2/4] nbd/server: add nbd_meta_single_query helper

2018-03-21 Thread Vladimir Sementsov-Ogievskiy
The helper will be reused for bitmaps namespace. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index b830997114..8fe53ffd4b 100644 --- a/nbd/

Re: [Qemu-devel] [PATCH] dump: display cause of write failure

2018-03-21 Thread Marc-André Lureau
On Wed, Mar 21, 2018 at 1:08 PM, Laurent Vivier wrote: > Use error_setg_errno() to display the reason why data write > has failed. For instance, instead of a laconic > > dump: failed to write elf header > or > dump: failed to save memory > > we have now: > > dump: failed to write elf header:

Re: [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Paolo Bonzini
On 21/03/2018 13:17, Laurent Vivier wrote: > On 21/03/2018 11:58, Paolo Bonzini wrote: >> If the user does not have permissions to send ioctls to the device (due to >> SELinux or cgroups, for example), the output can look like >> >> qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version

Re: [Qemu-devel] [PATCH] scsi: turn "is this a SCSI device?" into a conditional hint

2018-03-21 Thread Eric Blake
On 03/21/2018 05:58 AM, Paolo Bonzini wrote: If the user does not have permissions to send ioctls to the device (due to SELinux or cgroups, for example), the output can look like qemu-kvm: -device scsi-block,drive=disk: cannot get SG_IO version number: Operation not permitted. Is this a SCSI

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed

2018-03-21 Thread Max Reitz
On 2018-03-21 13:37, Max Reitz wrote: > On 2018-03-12 19:36, Eric Blake wrote: >> From: Peter Xu >> >> Start to use dedicate IO thread for QMP monitors that are not using >> MUXed chardev. >> >> Reviewed-by: Fam Zheng >> Reviewed-by: Stefan Hajnoczi >> Signed-off-by: Peter Xu >> Message-Id: <20

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed

2018-03-21 Thread Max Reitz
On 2018-03-12 19:36, Eric Blake wrote: > From: Peter Xu > > Start to use dedicate IO thread for QMP monitors that are not using > MUXed chardev. > > Reviewed-by: Fam Zheng > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Peter Xu > Message-Id: <20180309090006.10018-21-pet...@redhat.com> > Sign

Re: [Qemu-devel] [PATCH 0/3] tests: trivial enhancements for OOB

2018-03-21 Thread Eric Blake
On 03/21/2018 01:55 AM, Peter Xu wrote: First two patches add OOB detection for current qapi-schema tests (which I missed in the OOB series but pointed out by Eric Blake). The 3rd patch addressed one suggestion from Eric too here: http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg03177.ht

Re: [Qemu-devel] [PATCH 1/3] tests: let qapi-schema tests detect oob

2018-03-21 Thread Eric Blake
On 03/21/2018 01:55 AM, Peter Xu wrote: The allow_oob parameter was passed in but not used in tests. Now reflect that in the tests, so we need to touch up other command testers with that new change. Signed-off-by: Peter Xu --- tests/qapi-schema/doc-good.out | 4 ++-- tests/qapi-sc

Re: [Qemu-devel] [PATCH v3 00/49] qapi: add #if pre-processor conditions to generated code

2018-03-21 Thread no-reply
Hi, This series failed build test on s390x host. Please find the details below. Type: series Message-id: 20180321115211.17937-1-marcandre.lur...@redhat.com Subject: [Qemu-devel] [PATCH v3 00/49] qapi: add #if pre-processor conditions to generated code === TEST SCRIPT BEGIN === #!/bin/bash # Tes

  1   2   3   4   >