[Qemu-devel] [PULL for 2.9 37/49] tests/qapi-schema: Rename doc-bad-args to doc-bad-command-arg

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-36-git-send-email-arm...@redhat.com> --- tests/Makefile.include| 2 +- tests/qapi-schema/doc-bad-args.err| 1 - tests/qapi-schema/doc

[Qemu-devel] [PULL for 2.9 39/49] qapi: Fix detection of bogus member documentation

2017-03-15 Thread Markus Armbruster
check_definition_doc() checks for member documentation without a matching member. It laboriously second-guesses what members QAPISchema._def_exprs() will create. That's a stupid game. Move the check into QAPISchema.check(), where the members are known. Delegate the actual checking to new QAPIDoc

[Qemu-devel] [PULL for 2.9 49/49] qapi: Fix a misleading parser error message

2017-03-15 Thread Markus Armbruster
When choking on a token where an expression is expected, we report 'Expected "{", "[" or string'. Close, but no cigar. Fix it to Expected '"{", "[", string, boolean or "null"'. Missed in commit e53188a. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-48-

[Qemu-devel] [PULL for 2.9 21/49] qapi: Prefer single-quoted strings more consistently

2017-03-15 Thread Markus Armbruster
PEP 8 advises: In Python, single-quoted strings and double-quoted strings are the same. This PEP does not make a recommendation for this. Pick a rule and stick to it. When a string contains single or double quote characters, however, use the other one to avoid backslashes in

[Qemu-devel] [PULL for 2.9 18/49] qapi2texi: Convert to QAPISchemaVisitor

2017-03-15 Thread Markus Armbruster
qapi2texi works with schema expression trees. Such a tight coupling to schema language syntax is not a good idea. Convert it to the visitor interface the other generators use. No change to generated documentation. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <148958265

[Qemu-devel] [PULL for 2.9 46/49] qapi: union_types is a list used like a dict, make it one

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-45-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 19 +++ 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index f4d1a48..82c25a1 100644

[Qemu-devel] [PULL for 2.9 40/49] qapi: Eliminate check_docs() and drop QAPIDoc.expr

2017-03-15 Thread Markus Armbruster
Move what's left in check_docs() to check_expr(). Delegate the actual checking to new QAPIDoc.check_expr(). QAPIDoc.expr is now unused; drop it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-39-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 27

[Qemu-devel] [PULL for 2.9 33/49] qapi: Fix detection of doc / expression mismatch

2017-03-15 Thread Markus Armbruster
This fixes the errors uncovered by the previous commit. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-32-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 35 +++ tests/qapi-schema/doc-before-in

[Qemu-devel] [PULL for 2.9 34/49] qapi: Move detection of doc / expression name mismatch

2017-03-15 Thread Markus Armbruster
Move the check whether the doc matches the expression name from check_definition_doc() to check_exprs(). This changes the error location from the comment to the expression. Makes sense as the message talks about the expression: "Definition of '%s' follows documentation for '%s'". It's also a ste

[Qemu-devel] [PULL for 2.9 26/49] qapi2texi: Implement boxed argument documentation

2017-03-15 Thread Markus Armbruster
This replaces manual references like "For the arguments, see the documentation of ..." by a generated reference "Arguments: the members of ...". Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-25-git-send-email-arm...@redhat.com> --- qapi-schema.json |

[Qemu-devel] [PULL for 2.9 32/49] tests/qapi-schema: Improve doc / expression mismatch coverage

2017-03-15 Thread Markus Armbruster
New tests doc-before-include.json and doc-before-pragma.json show we fail to reject a misplaced expression comment. New test doc-no-symbol.json shows a bad error message. Signed-off-by: Markus Armbruster Message-Id: <1489582656-31133-31-git-send-email-arm...@redhat.com> Reviewed-by: Eric Blake

[Qemu-devel] [PULL for 2.9 47/49] qapi: Drop unused .check_clash() parameter schema

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-46-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 82c25a1..b798ae4 100644 --- a/scr

[Qemu-devel] [PULL for 2.9 23/49] qapi2texi: Present the table of members more clearly

2017-03-15 Thread Markus Armbruster
The table of members follows the main descriptive text immediately. Makes it hard to see what it is about. Start a new paragraph, and lead with a line "Members:" for object and alternate types, "Values:" for enumeration types, and "Arguments:" for commands and events. Example change (qemu-qmp-ref

[Qemu-devel] [PULL for 2.9 42/49] qapi: Simplify what gets stored in enum_types

2017-03-15 Thread Markus Armbruster
Don't invent a new dictionary structure just for enum_types, simply store the defining expression, like we do for struct_types and union_types. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-41-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 29 ++

[Qemu-devel] [PULL for 2.9 35/49] qapi: Improve error message on @NAME: in free-form doc

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-34-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 17 ++--- tests/qapi-schema/doc-invalid-section.err | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-)

[Qemu-devel] [PULL for 2.9 45/49] qapi: struct_types is a list used like a dict, make it one

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-44-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 735ddaa..f4d1a48 1006

[Qemu-devel] [PULL for 2.9 24/49] qapi2texi: Explain enum value undocumentedness more clearly

2017-03-15 Thread Markus Armbruster
Instead of not saying anything when we have no documentation, say "Not documented". Example change (qemu-qmp-ref.txt): -- Enum: GuestPanicAction An enumeration of the actions taken when guest OS panic is detected Values: 'pause' system pauses 'poweroff' +

[Qemu-devel] [PULL for 2.9 27/49] qapi2texi: Include member type in generated documentation

2017-03-15 Thread Markus Armbruster
The recent merge of docs/qmp-commands.txt and docs/qmp-events.txt into the schema lost type information. Fix this documentation regression. Example change (qemu-qmp-ref.txt): -- Struct: InputKeyEvent Keyboard input event. Members: - 'button' + 'button: InputButton'

[Qemu-devel] [PULL for 2.9 29/49] qapi2texi: Generate documentation for variant members

2017-03-15 Thread Markus Armbruster
A flat union's branch brings in the members of another type. Generate a suitable reference to that type. Example change (qemu-qmp-ref.txt): -- Flat Union: QCryptoBlockOpenOptions The options that are available for all encryption formats when opening an existing volume Membe

[Qemu-devel] [PULL for 2.9 31/49] qapi2texi: Use category "Object" for all object types

2017-03-15 Thread Markus Armbruster
At the protocol level, the distinction between struct, flat union and simple union is meaningless, they are all JSON objects. Document them that way. Example change (qemu-qmp-ref.txt): - -- Simple Union: InputEvent + -- Object: InputEvent Input event union. This also fixes the completely

Re: [Qemu-devel] COLO failover hang

2017-03-15 Thread Zhang Chen
On 03/15/2017 05:06 PM, wangguang wrote: am testing QEMU COLO feature described here [QEMU Wiki](http://wiki.qemu-project.org/Features/COLO). When the Primary Node panic,the Secondary Node qemu hang. hang at recvmsg in qio_channel_socket_readv. And I run { 'execute': 'nbd-server-stop' } an

[Qemu-devel] [PULL for 2.9 12/49] qapi2texi: Fix up output around #optional

2017-03-15 Thread Markus Armbruster
We use tag #optional to mark optional members, like this: # @name: #optional The name of the guest texi_body() strips #optional, but not whitespace around it. For the above, we get in qemu-qmp-qapi.texi @item @code{'name'} (optional) The name of the guest @end table The extra

[Qemu-devel] [PULL for 2.9 22/49] qapi2texi: Plainer enum value and member name formatting

2017-03-15 Thread Markus Armbruster
Use @code{%s} instead of @code{'%s'}. Impact, using @id as example: * Texinfo -@item @code{'id'} +@item @code{id} * HTML -'id' +id * POD (for manual pages): -=item C<'id'> +=item C * Formatted manual pages: -'id' +"id" * Plain text: - ''id'' + 'id' Signed-off-by:

[Qemu-devel] [PULL for 2.9 41/49] qapi: Drop unused variable events

2017-03-15 Thread Markus Armbruster
Missed in commit e98859a Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-40-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 1aaae8e..d5a113c 100644 --- a/sc

[Qemu-devel] [PULL for 2.9 30/49] qapi2texi: Generate descriptions for simple union tags

2017-03-15 Thread Markus Armbruster
Simple union tags carry no type information, because their type is implicit. Their description should make up for it, but many have none. Generate one automatically then. Example change (qemu-qmp-ref.txt): -- Simple Union: ImageInfoSpecific A discriminated record of image format specif

[Qemu-devel] [PULL for 2.9 09/49] qapi: Clean up build of generated documentation

2017-03-15 Thread Markus Armbruster
Rename intermediate qemu-qapi.texi to qemu-qmp-qapi.texi to match its user qemu-qmp-ref.texi, just like qemu-ga-qapi.texi matches qemu-ga-ref.texi. Build the intermediate .texi next to the sources and the final output in docs/ instead of dumping them into the build root. Fix version.texi dependen

Re: [Qemu-devel] [Qemu-ppc] qemu-system-ppc video artifacts since "tcg: drop global lock during TCG code execution"

2017-03-15 Thread Paolo Bonzini
On 14/03/2017 18:34, BALATON Zoltan wrote: > Like from the display controller models that use > memory_region_get_dirty() to check if the frambuffer needs to be > updated? But all display adaptors seem to do this and the problem was > only seem on ppc so it may be related to something ppc specifi

[Qemu-devel] [PULL for 2.9 20/49] qapi: Use raw strings for regular expressions consistently

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-19-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index 748d7ad..8088f60 100644 --- a/script

[Qemu-devel] [PULL for 2.9 14/49] qapi/rocker: Fix up doc comment notes on optional members

2017-03-15 Thread Markus Armbruster
Talking about #optional like this # Note: fields are marked #optional to indicate that they may or may # not appear ... doesn't work so well in generated documentation, because the #optional tag is not visible there. Replace by # Note: optional members may or may not appear ... Sig

[Qemu-devel] [PULL for 2.9 19/49] qapi: The #optional tag is redundant, drop

2017-03-15 Thread Markus Armbruster
We traditionally mark optional members #optional in the doc comment. Before commit 3313b61, this was entirely manual. Commit 3313b61 added some automation because its qapi2texi.py relied on #optional to determine whether a member is optional. This is no longer the case since the previous commit:

[Qemu-devel] [PULL for 2.9 15/49] qapi: Fix QAPISchemaEnumType.is_implicit() for 'QType'

2017-03-15 Thread Markus Armbruster
Missed in commit 7264f5c. Harmless, because nothing checks whether an enumeration type is implicit so far. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-14-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 4 ++-- 1 file changed, 2 insertions(+),

[Qemu-devel] [PULL for 2.9 28/49] qapi2texi: Generate reference to base type members

2017-03-15 Thread Markus Armbruster
The generated documentation doesn't mention object type members inherited from a base type. Fix that. Example change (qemu-qmp-ref.txt): -- Struct: VncServerInfo The network connection information for server Members: 'auth' (optional) authentication method used f

[Qemu-devel] [PULL for 2.9 17/49] qapi: Conjure up QAPIDoc.ArgSection for undocumented members

2017-03-15 Thread Markus Armbruster
qapi2texi.py already conjures up ArgSections for undocumented enumeration values, in texi_enum. Drop that, and conjure them up for all kinds of "arguments" (enumeration values, object and alternate type members) in qapi.py instead. Take care to keep generated documentation exactly the same for no

[Qemu-devel] [PULL for 2.9 01/49] qapi2texi: change texi formatters

2017-03-15 Thread Markus Armbruster
From: Marc-André Lureau STRUCT_FMT is generic enough, rename it to TYPE_FMT, use it for unions. Rename COMMAND_FMT to MSG_FMT, since it applies to both commands and events. Signed-off-by: Marc-André Lureau Message-Id: <20170125130308.16104-2-marcandre.lur...@redhat.com> Reviewed-by: Markus Arm

[Qemu-devel] [PULL for 2.9 04/49] qapi: Make doc comments optional where we don't need them

2017-03-15 Thread Markus Armbruster
Since we added the documentation generator in commit 3313b61, doc comments are mandatory. That's a very good idea for a schema that needs to be documented, but has proven to be annoying for testing. Make doc comments optional again, but add a new directive { 'pragma': { 'doc-required': true

[Qemu-devel] [PULL for 2.9 16/49] qapi: Prepare for requiring more complete documentation

2017-03-15 Thread Markus Armbruster
We currently neglect to check all enumeration values, common members of object types and members of alternate types are documented. Unsurprisingly, many aren't. Add the necessary plumbing to find undocumented ones, except for variant members of object types. Don't enforce anything just yet, but c

[Qemu-devel] [PULL for 2.9 07/49] qapi: Have each QAPI schema declare its returns white-list

2017-03-15 Thread Markus Armbruster
qapi.py has a hardcoded white-list of command names that may violate the rules on permitted return types. Add a new pragma directive 'returns-whitelist', and use it to replace the hard-coded white-list. Signed-off-by: Markus Armbruster Message-Id: <1489582656-31133-6-git-send-email-arm...@redhat

[Qemu-devel] [PULL for 2.9 11/49] qapi: Fix to reject empty union base gracefully

2017-03-15 Thread Markus Armbruster
Common Python pitfall: 'assert base_members' fires on [] in addition to None. Correct to 'assert base_members is not None'. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <1489582656-31133-10-git-send-email-arm...@redhat.com> --- scripts/qa

[Qemu-devel] [PULL for 2.9 25/49] qapi2texi: Don't hide undocumented members and arguments

2017-03-15 Thread Markus Armbruster
Show undocumented object, alternate type members and command, event arguments exactly like undocumented enumeration type values. Example change (qemu-qmp-ref.txt): -- Command: query-rocker Return rocker switch information. + Arguments: + 'name' + Not documented +

[Qemu-devel] [PULL for 2.9 06/49] docs/qapi-code-gen.txt: Drop confusing reference to 'gen'

2017-03-15 Thread Markus Armbruster
Section "Commands" qualifies its rules on permitted argument and return types "with one exception noted below when 'gen' is used". The note went away in commit 2d21291. Clean up the dangling references. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Me

[Qemu-devel] [PULL for 2.9 08/49] qapi: Have each QAPI schema declare its name rule violations

2017-03-15 Thread Markus Armbruster
qapi.py has a hardcoded white-list of type names that may violate the rule on use of upper and lower case. Add a new pragma directive 'name-case-whitelist', and use it to replace the hard-coded white-list. Signed-off-by: Markus Armbruster Message-Id: <1489582656-31133-7-git-send-email-arm...@red

[Qemu-devel] [PULL for 2.9 36/49] qapi: Move empty doc section checking to doc parser

2017-03-15 Thread Markus Armbruster
Results in a more precise error location, but the real reason is emptying out check_docs() step by step. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <1489582656-31133-35-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 20 ++---

[Qemu-devel] [PULL for 2.9 00/49] QAPI patches for 2017-03-16

2017-03-15 Thread Markus Armbruster
Significant improvements to QMP documentation, fixing its regression. Note: only QAPI *generator* code changes, except for trailing space removal in generated qmp-marshal.c and doc comments in QAPI schemas. The following changes since commit 1883ff34b540daacae948f493b0ba525edf5f642: Merge remo

[Qemu-devel] [PULL for 2.9 10/49] tests/qapi-schema: Cover empty union base

2017-03-15 Thread Markus Armbruster
The new test case shows off qapi.py choking on an empty union base. Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau Reviewed-by: Eric Blake Message-Id: <1489582656-31133-9-git-send-email-arm...@redhat.com> --- tests/Makefile.include | 1 + tests/qapi-schema/un

[Qemu-devel] [PULL for 2.9 13/49] qapi: Avoid unwanted blank lines in QAPIDoc

2017-03-15 Thread Markus Armbruster
We silently fix missing #optional tags for QAPIDoc by appending a line "#optional" to the section's .content. However, this interferes with .__repr__ stripping trailing blank lines from .content. Use new ArgSection instance variable .optional instead, and leave .content alone. To permit testing

[Qemu-devel] [PULL for 2.9 02/49] qmp: allow setting properties to empty string in qmp-shell

2017-03-15 Thread Markus Armbruster
From: "Daniel P. Berrange" The qmp-shell property parser currently rejects attempts to set string properties to the empty string eg (QEMU) migrate-set-parameters tls-hostname= Error while parsing command line: Expected a key=value pair, got 'tls-hostname=' command format: [arg-name1=arg1

[Qemu-devel] [PULL for 2.9 03/49] qapi: Factor QAPISchemaParser._include() out of .__init__()

2017-03-15 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Message-Id: <1489582656-31133-2-git-send-email-arm...@redhat.com> --- scripts/qapi.py | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/scrip

Re: [Qemu-devel] [PATCH v7 17/17] intel_iommu: enable vfio devices

2017-03-15 Thread Peter Xu
On Tue, Feb 07, 2017 at 04:28:19PM +0800, Peter Xu wrote: > This patch is based on Aviv Ben-David ()'s patch > upstream: > > "IOMMU: enable intel_iommu map and unmap notifiers" > https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg01453.html > > However I removed/fixed some content, and

Re: [Qemu-devel] [RFC v2 1/8] block: add bdrv_measure() API

2017-03-15 Thread Max Reitz
On 16.03.2017 04:38, Stefan Hajnoczi wrote: > On Thu, Mar 16, 2017 at 02:01:03AM +0100, Max Reitz wrote: >> On 15.03.2017 10:29, Stefan Hajnoczi wrote: >>> bdrv_measure() provides a conservative maximum for the size of a new >>> image. This information is handy if storage needs to be allocated (e.

Re: [Qemu-devel] [PATCH v2] trace: ensure $(tracetool-y) is defined in top level makefile

2017-03-15 Thread Stefan Hajnoczi
On Wed, Mar 15, 2017 at 12:34:21PM +, Daniel P. Berrange wrote: > The build rules for trace files have a dependancy on $(tracetool-y). > This variable populated in the trace/Makefile.objs file and thus its > definition gets pulled into the top level makefile. This happens too > late in the proc

Re: [Qemu-devel] [RFC v2 6/8] qemu-img: add measure subcommand

2017-03-15 Thread Stefan Hajnoczi
On Thu, Mar 16, 2017 at 02:46:12AM +0100, Max Reitz wrote: > On 15.03.2017 10:29, Stefan Hajnoczi wrote: > > The measure subcommand calculates the size required by a new image file. > > This can be used by users or management tools that need to allocate > > space on an LVM volume, SAN LUN, etc befo

Re: [Qemu-devel] [RFC v2 5/8] qcow2: add bdrv_measure() support

2017-03-15 Thread Stefan Hajnoczi
On Thu, Mar 16, 2017 at 02:57:13AM +0100, Max Reitz wrote: > On 15.03.2017 10:29, Stefan Hajnoczi wrote: > > Use qcow2_calc_prealloc_size() to get the required file size. > > > > Signed-off-by: Stefan Hajnoczi > > --- > > TODO: > > * Query block status and only count allocated clusters if in_bs

Re: [Qemu-devel] [RFC v2 3/8] qcow2: extract preallocation calculation function

2017-03-15 Thread Stefan Hajnoczi
On Thu, Mar 16, 2017 at 02:18:36AM +0100, Max Reitz wrote: > On 15.03.2017 10:29, Stefan Hajnoczi wrote: > > Calculating the preallocated image size will be needed to implement > > .bdrv_measure(). Extract the code out into a separate function. > > > > Signed-off-by: Stefan Hajnoczi > > --- > >

Re: [Qemu-devel] [RFC v2 1/8] block: add bdrv_measure() API

2017-03-15 Thread Stefan Hajnoczi
On Thu, Mar 16, 2017 at 02:01:03AM +0100, Max Reitz wrote: > On 15.03.2017 10:29, Stefan Hajnoczi wrote: > > bdrv_measure() provides a conservative maximum for the size of a new > > image. This information is handy if storage needs to be allocated (e.g. > > a SAN or an LVM volume) ahead of time. >

Re: [Qemu-devel] [PATCH v1 2/2] reduce qemu's heap Rss size from 12252kB to 2752KB

2017-03-15 Thread Zhong, Yang
Hello Paolo, As for your said tcmalloc or jemalloc for optimization memory allocation, we also tried the malloc_trim() in glibc, which can get the same memory optimization. diff --git a/util/rcu.c b/util/rcu.c index 9adc5e4..3643e43 100644 --- a/util/rcu.c +++ b/util/rcu.c @@ -32,7 +32,7 @@ #in

[Qemu-devel] [PULL 5/5] virtio-serial-bus: Delete timer from list before free it

2017-03-15 Thread Michael S. Tsirkin
From: zhanghailiang Signed-off-by: zhanghailiang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Paolo Bonzini Reviewed-by: Amit Shah --- hw/char/virtio-serial-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virt

[Qemu-devel] [PULL 4/5] hw/virtio: fix Power Management Control Register for PCI Express virtio devices

2017-03-15 Thread Michael S. Tsirkin
From: Marcel Apfelbaum Make Power Management State flag writable to conform with the PCI Express spec. Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 4 include/hw/compat.h| 4 include/hw/pci/pcie

[Qemu-devel] [PULL 1/5] hw/pcie: fix Extended Configuration Space for devices with no Extended Capabilities

2017-03-15 Thread Michael S. Tsirkin
From: Marcel Apfelbaum Absence of any Extended Capabilities is required to be indicated by an Extended Capability header with a Capability ID of h, a Capability Version of 0h, and a Next Capability Offset of 000h. Instead of inserting a 'NULL' capability is simpler to mark the start of the E

[Qemu-devel] [PULL 3/5] hw/virtio: fix Link Control Register for PCI Express virtio devices

2017-03-15 Thread Michael S. Tsirkin
From: Marcel Apfelbaum Make several Link Control Register flags writable to conform with the PCI Express spec. Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 4 include/hw/compat.h| 4 include/hw/

[Qemu-devel] [PULL 2/5] hw/virtio: fix error enabling flags in Device Control register

2017-03-15 Thread Michael S. Tsirkin
From: Marcel Apfelbaum When the virtio devices are PCI Express, make error-enabling flags writable to respect the PCIe spec. Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-pci.h | 4 include/hw/compat.h| 4 +++

[Qemu-devel] [PULL 0/5] virtio, pci: fixes

2017-03-15 Thread Michael S. Tsirkin
The following changes since commit 1883ff34b540daacae948f493b0ba525edf5f642: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2017-03-15 18:44:05 +) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream fo

Re: [Qemu-devel] [PATCH for-2.9] mirror: Fix backwards mirror_yield parameters

2017-03-15 Thread Stefan Hajnoczi
On Wed, Mar 15, 2017 at 10:59:24AM +, Daniel P. Berrange wrote: > On Wed, Mar 15, 2017 at 10:26:44AM +, Daniel P. Berrange wrote: > > On Wed, Mar 15, 2017 at 06:18:35PM +0800, Stefan Hajnoczi wrote: > > > On Fri, Mar 10, 2017 at 02:49:22PM -0600, Eric Blake wrote: > > > > And here's where I

Re: [Qemu-devel] [PATCH] qemu-img: show help for invalid global options

2017-03-15 Thread Max Reitz
On 13.03.2017 06:11, Stefan Hajnoczi wrote: > The qemu-img sub-command executes regardless of invalid global options: > > $ qemu-img --foo info test.img > qemu-img: unrecognized option '--foo' > image: test.img > ... > > The unrecognized option warning may be missed by the user. This can

Re: [Qemu-devel] [RFC v2 5/8] qcow2: add bdrv_measure() support

2017-03-15 Thread Max Reitz
On 15.03.2017 10:29, Stefan Hajnoczi wrote: > Use qcow2_calc_prealloc_size() to get the required file size. > > Signed-off-by: Stefan Hajnoczi > --- > TODO: > * Query block status and only count allocated clusters if in_bs != NULL > * Exclude backing file clusters if in_bs != NULL and -o backin

Re: [Qemu-devel] [RFC v2 7/8] qemu-iotests: support per-format golden output files

2017-03-15 Thread Max Reitz
On 15.03.2017 10:29, Stefan Hajnoczi wrote: > Some tests produce format-dependent output. Either the difference is > filtered out and ignored, or the test case is format-specific so we > don't need to worry about per-format output differences. > > There is a third case: the test script is the sam

Re: [Qemu-devel] [RFC v2 6/8] qemu-img: add measure subcommand

2017-03-15 Thread Max Reitz
On 15.03.2017 10:29, Stefan Hajnoczi wrote: > The measure subcommand calculates the size required by a new image file. > This can be used by users or management tools that need to allocate > space on an LVM volume, SAN LUN, etc before creating or converting an > image file. > > Suggested-by: Maor

Re: [Qemu-devel] kvm bug in __rmap_clear_dirty during live migration

2017-03-15 Thread Huang, Kai
Thanks! Thanks, -Kai On 3/14/2017 5:57 AM, Paolo Bonzini wrote: On 13/03/2017 15:58, fangying wrote: Hi, Huang Kai After weeks of intensive testing, we think the problem is solved and this issue can be closed. Thanks for the update. We got to the same conclusion. Paolo

Re: [Qemu-devel] [PATCH v2] migration/block: Avoid invoking blk_drain too frequently

2017-03-15 Thread Fam Zheng
On Wed, 03/15 17:31, Dr. David Alan Gilbert wrote: > * Fam Zheng (f...@redhat.com) wrote: > > On Wed, 03/15 11:37, Lidong Chen wrote: > > > Increase bmds->cur_dirty after submit io, so reduce the frequency > > > involve into blk_drain, and improve the performance obviously > > > when block migratio

Re: [Qemu-devel] [PATCH v2 2/2] virtio-scsi: Fix acquire/release in dataplane handlers

2017-03-15 Thread Fam Zheng
On Tue, 03/14 23:36, Fam Zheng wrote: > After the AioContext lock push down, there is a race between > virtio_scsi_dataplane_start and those "assert(s->ctx && > s->dataplane_started)", because the latter doesn't isn't wrapped in s/doesn't// > aio_context_acquire.

Re: [Qemu-devel] [RFC v2 3/8] qcow2: extract preallocation calculation function

2017-03-15 Thread Max Reitz
On 15.03.2017 10:29, Stefan Hajnoczi wrote: > Calculating the preallocated image size will be needed to implement > .bdrv_measure(). Extract the code out into a separate function. > > Signed-off-by: Stefan Hajnoczi > --- > block/qcow2.c | 134 > +

Re: [Qemu-devel] [RFC v2 1/8] block: add bdrv_measure() API

2017-03-15 Thread Max Reitz
On 15.03.2017 10:29, Stefan Hajnoczi wrote: > bdrv_measure() provides a conservative maximum for the size of a new > image. This information is handy if storage needs to be allocated (e.g. > a SAN or an LVM volume) ahead of time. > > Signed-off-by: Stefan Hajnoczi > --- > qapi/block-core.json

[Qemu-devel] [PULL for-rc1 3/3] ide: ahci: call cleanup function in ahci unit

2017-03-15 Thread John Snow
From: Li Qiang This can avoid memory leak when hotunplug the ahci device. Signed-off-by: Li Qiang Message-id: 1488449293-80280-4-git-send-email-liqiang...@360.cn Signed-off-by: John Snow --- hw/ide/ahci.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/ide/ahci.c b/hw/ide

[Qemu-devel] [PULL for-rc1 1/3] ide: qdev: register ide bus unrealize function

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

[Qemu-devel] [PULL for-rc1 2/3] ide: core: add cleanup function

2017-03-15 Thread John Snow
From: Li Qiang As the pci ahci can be hotplug and unplug, in the ahci unrealize function it should free all the resource once allocated in the realized function. This patch add ide_exit to free the resource. Signed-off-by: Li Qiang Message-id: 1488449293-80280-3-git-send-email-liqiang...@360.cn

[Qemu-devel] [PULL for-rc1 0/3] Ide patches

2017-03-15 Thread John Snow
The following changes since commit 1883ff34b540daacae948f493b0ba525edf5f642: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2017-03-15 18:44:05 +) are available in the git repository at: https://github.com/jnsnow/qemu.git tags/ide-pull-request for you to fet

[Qemu-devel] [RFC patch 0/3] block: pause block jobs for bdrv_drain_begin/end

2017-03-15 Thread John Snow
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1367369#c8 It's possible to wedge QEMU if the guest tries to reset a virtio-pci device as QEMU is also using the drive for a blockjob. This patchset aims to allow us to safely pause/resume jobs attached to individual nodes in a manner similar

[Qemu-devel] [RFC patch 1/3] blockjob: add block_job_start_shim

2017-03-15 Thread John Snow
The purpose of this shim is to allow us to pause pre-started jobs. The purpose of *that* is to allow us to buffer a pause request that will be able to take effect before the job ever does any work, allowing us to create jobs during a quiescent state (under which they will be automatically paused),

[Qemu-devel] [RFC patch 2/3] block-backend: add drained_begin / drained_end ops

2017-03-15 Thread John Snow
Signed-off-by: John Snow --- RFC questions: - Does the presence of blk->quiesce_counter relieve the burden of needing blk->public.io_limits_disabled? I could probably eliminate this counter entirely and just spy on the root node's quiescent state at key moments instead. I am confident I'm

[Qemu-devel] [RFC patch 3/3] blockjob: add devops to blockjob backends

2017-03-15 Thread John Snow
This lets us hook into drained_begin and drained_end requests from the backend level, which is particularly useful for making sure that all jobs associated with a particular node (whether the source or the target) receive a drain request. Suggested-by: Kevin Wolf Signed-off-by: John Snow -- RF

Re: [Qemu-devel] [PATCH] nbd-client: fix handling of hungup connections

2017-03-15 Thread Max Reitz
On 14.03.2017 12:11, Paolo Bonzini wrote: > After the switch to reading replies in a coroutine, nothing is > reentering pending receive coroutines if the connection hangs. > Move nbd_recv_coroutines_enter_all to the reply read coroutine, > which is the place where hangups are detected. nbd_teardow

Re: [Qemu-devel] [PATCH] block: quiesce AioContext when detaching from it

2017-03-15 Thread Max Reitz
On 14.03.2017 12:11, Paolo Bonzini wrote: > While it is true that bdrv_set_aio_context only works on a single > BlockDriverState subtree (see commit message for 53ec73e, "block: Use > bdrv_drain to replace uncessary bdrv_drain_all", 2015-07-07), it works > at the AioContext level rather than the Bl

Re: [Qemu-devel] [PATCH v2 06/30] trace: Fix parameter types in migration

2017-03-15 Thread Eric Blake
On 03/15/2017 02:55 PM, Eric Blake wrote: >> Okay, my next version will insert an explicit cast in any caller that is >> otherwise passing a __u64 (since we can't guarantee what type __u64 >> resolves to, and therefore what format string is appropriate for it). > > Or maybe I will just omit those

Re: [Qemu-devel] [PATCH] blockdev: fix bitmap clear undo

2017-03-15 Thread Eric Blake
On 03/15/2017 04:28 PM, John Snow wrote: > Only undo the action if we actually prepared the action. > > Signed-off-by: John Snow > --- > blockdev.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/blockdev.c b/blockdev.c > index f1f49bd..c5b

Re: [Qemu-devel] [PATCH v2 6/9] xen/9pfs: receive requests from the frontend

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:57 -0700 > Stefano Stabellini wrote: > > > Upon receiving an event channel notification from the frontend, schedule > > the bottom half. From the bottom half, read one request from the ring, > > create a pdu and call pdu_submit to

Re: [Qemu-devel] [PATCH v2 8/9] xen/9pfs: send responses back to the frontend

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:59 -0700 > Stefano Stabellini wrote: > > > Once a request is completed, xen_9pfs_push_and_notify gets called. In > > xen_9pfs_push_and_notify, update the indexes (data has already been > > copied to the sg by the common code) and s

Re: [Qemu-devel] [PATCH v2 7/9] xen/9pfs: implement in/out_iov_from_pdu and vmarshal/vunmarshal

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:58 -0700 > Stefano Stabellini wrote: > > > Implement xen_9pfs_init_in/out_iov_from_pdu and > > xen_9pfs_pdu_vmarshal/vunmarshall by creating new sg pointing to the > > data on the ring. > > > > This is safe as we only handle one r

Re: [Qemu-devel] [PATCH v2 6/9] xen/9pfs: receive requests from the frontend

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:57 -0700 > Stefano Stabellini wrote: > > > Upon receiving an event channel notification from the frontend, schedule > > the bottom half. From the bottom half, read one request from the ring, > > create a pdu and call pdu_submit to

Re: [Qemu-devel] [PATCH v2 5/9] xen/9pfs: connect to the frontend

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:56 -0700 > Stefano Stabellini wrote: > > > Write the limits of the backend to xenstore. Connect to the frontend. > > Upon connection, allocate the rings according to the protocol > > specification. > > > > Initialize a QEMUBH to s

[Qemu-devel] [PATCH] blockdev: fix bitmap clear undo

2017-03-15 Thread John Snow
Only undo the action if we actually prepared the action. Signed-off-by: John Snow --- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index f1f49bd..c5b2c2c 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2047,7 +2047,9 @@ static void block_

[Qemu-devel] [PULL for-2.9] Update OpenBIOS images

2017-03-15 Thread Mark Cave-Ayland
Hi Peter, This update contains just the 64-bit PCI BAR fix which enables virtio modern devices to work once again. Please pull. ATB, Mark. The following changes since commit 1883ff34b540daacae948f493b0ba525edf5f642: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagin

Re: [Qemu-devel] [PATCH v1 2/2] reduce qemu's heap Rss size from 12252kB to 2752KB

2017-03-15 Thread Paolo Bonzini
- Original Message - > From: "Anthony Xu" > To: "Paolo Bonzini" > Cc: "Yang Zhong" , "Chao P Peng" > , qemu-devel@nongnu.org > Sent: Wednesday, March 15, 2017 8:05:48 PM > Subject: Re: [Qemu-devel] [PATCH v1 2/2] reduce qemu's heap Rss size from > 12252kB to 2752KB > > > The first un

Re: [Qemu-devel] [RFC PATCH v2 30/30] trace: Force compiler warnings on trace parameter type mismatches

2017-03-15 Thread Eric Blake
On 03/13/2017 02:55 PM, Eric Blake wrote: > --- > > RFC for two reasons: > 1. the Makefile issue documented above means that incremental > builds won't benefit from this patch without manual intervention > (fresh builds, including docker, manage to test it, though) Dan's posted the fix for this

Re: [Qemu-devel] [PATCH v2 06/30] trace: Fix parameter types in migration

2017-03-15 Thread Eric Blake
On 03/14/2017 09:36 AM, Eric Blake wrote: So why is a PRIx64 not the right way to print a __u64 ? >>> >>> Because __u64 is not the same type as uint64_t. On 64-bit Linux, __u64 >>> is 'unsigned long long', while uint64_t is 'unsigned long'. >>> (I prefer %llx to the horrid PRIx64 syntax

Re: [Qemu-devel] [PATCH V2 0/4] hw/virtio: fix several PCI Express compliance issues

2017-03-15 Thread Marcel Apfelbaum
On 03/02/2017 08:25 AM, Marcel Apfelbaum wrote: On 02/20/2017 10:43 PM, Marcel Apfelbaum wrote: v1 -> v2: - Added compat properties (Michael S. Tsirkin) - Rebased on latest master - Regarding the patch 1/4, we don't need to init the PCI "standard" config capabilities to 0 since they ar

Re: [Qemu-devel] [PULL 0/7] virtio, pc: fixes

2017-03-15 Thread Peter Maydell
On 15 March 2017 at 18:01, Michael S. Tsirkin wrote: > The following changes since commit d84f714eafedd8bb9d4aaec8b76417bef8e3535e: > > Update version for v2.9.0-rc0 release (2017-03-14 19:18:23 +) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/virt/kvm/mst/qe

Re: [Qemu-devel] [PATCH v1 2/2] reduce qemu's heap Rss size from 12252kB to 2752KB

2017-03-15 Thread Xu, Anthony
> The first unref is done after as->current_map is overwritten. > as->current_map is accessed under RCU, so it needs call_rcu. It > balances the initial reference that is present since flatview_init. Got it, thanks for explanation. > > but it is not clear to me, is this a bug or by design? Is fl

Re: [Qemu-devel] [PATCH v2 2/9] xen: import ring.h from xen

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Wed, 15 Mar 2017 11:36:12 -0700 (PDT) > Stefano Stabellini wrote: > > > On Wed, 15 Mar 2017, Greg Kurz wrote: > > > On Mon, 13 Mar 2017 16:55:53 -0700 > > > Stefano Stabellini wrote: > > > > > > > Do not use the ring.h header installed on the system.

Re: [Qemu-devel] [PATCH v2 3/9] xen: introduce the header file for the Xen 9pfs transport protocol

2017-03-15 Thread Stefano Stabellini
On Wed, 15 Mar 2017, Greg Kurz wrote: > On Mon, 13 Mar 2017 16:55:54 -0700 > Stefano Stabellini wrote: > > > It uses the new ring.h macros to declare rings and interfaces. > > > > Signed-off-by: Stefano Stabellini > > CC: anthony.per...@citrix.com > > CC: jgr...@suse.com > > --- > > hw/9pfs/xe

Re: [Qemu-devel] [PATCH v2 2/9] xen: import ring.h from xen

2017-03-15 Thread Greg Kurz
On Wed, 15 Mar 2017 11:36:12 -0700 (PDT) Stefano Stabellini wrote: > On Wed, 15 Mar 2017, Greg Kurz wrote: > > On Mon, 13 Mar 2017 16:55:53 -0700 > > Stefano Stabellini wrote: > > > > > Do not use the ring.h header installed on the system. Instead, import > > > the header into the QEMU codeba

Re: [Qemu-devel] [PATCH] Default to GSSAPI (Kerberos) instead of DIGEST-MD5 for SASL

2017-03-15 Thread Eric Blake
On 03/15/2017 01:25 PM, Daniel P. Berrange wrote: > RFC 6331 documents a number of serious security weaknesses in > the SASL DIGEST-MD5 mechanism. As such, QEMU should not be > using or recommending it as a default mechanism for VNC auth > with SASL. > > GSSAPI (Kerberos) is the only other viable

  1   2   3   4   >