Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > Code looks good. Just a question on the error case you're trying to fix. > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> When the vhost-user is reconnecting to the backend, and if the vhost-user >> fails >> at the get_features in

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
> 2024年5月14日 21:58,Raphael Norwitz 写道: > > The code for these two patches looks fine. Just some questions on the > failure case you're trying to fix. > > > On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: >> >> This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. >> >> Since the

[PATCH 07/20] qapi/parser: add semantic 'kind' parameter to QAPIDoc.Section

2024-05-14 Thread John Snow
When iterating all_sections, this is helpful to be able to distinguish "members" from "features"; the only other way to do so is to cross-reference these sections against QAPIDoc.args or QAPIDoc.features, but if the desired end goal for QAPIDoc is to remove everything except all_sections, we need

[PATCH 18/20] qapi: ensure all errors sections are uniformly typset

2024-05-14 Thread John Snow
Transactions have the only instance of an Errors section that isn't a rST list; turn it into one. Signed-off-by: John Snow --- qapi/transaction.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/transaction.json b/qapi/transaction.json index 5749c133d4a..07afc269d54

[PATCH 17/20] qapi: rewrite BlockExportOptions doc block

2024-05-14 Thread John Snow
Rephrase this paragraph so that it can apply to any commands that inherit from this object. Signed-off-by: John Snow --- qapi/block-export.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qapi/block-export.json b/qapi/block-export.json index

[PATCH 01/20] [DO-NOT-MERGE]: Add some ad-hoc linting helpers.

2024-05-14 Thread John Snow
These aren't ready for upstream inclusion, because they do not properly manage version dependencies, execution environment and so on. These are just the tools I use in my Own Special Environment :tm: for testing and debugging. They've been tested only on Fedora 38 for right now, which means:

[PATCH 06/20] qapi/parser: fix comment parsing immediately following a doc block

2024-05-14 Thread John Snow
If a comment immediately follows a doc block, the parser doesn't ignore that token appropriately. Fix that. Signed-off-by: John Snow --- scripts/qapi/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index

[PATCH 14/20] qapi: fix non-compliant JSON examples

2024-05-14 Thread John Snow
If we parse all examples as QMP, we need them to conform to a standard so that they render correctly. Once the QMP lexer is active for examples, these will produce warning messages and fail the build. The QMP lexer still supports elisions, but they must be represented as the value "...", so two

[PATCH 03/20] docs/qapidoc: delint a tiny portion of the module

2024-05-14 Thread John Snow
In the coming patches, it's helpful to have a linting baseline. However, there's no need to shuffle around the deck chairs too much, because most of this code will be removed once the new qapidoc generator (the "transmogrifier") is in place. To ease my pain: just turn off the black auto-formatter

[PATCH 19/20] qapi: convert "Note" sections to plain rST

2024-05-14 Thread John Snow
We do not need a dedicated section for notes. By eliminating a specially parsed section, these notes can be treated as normal rST paragraphs in the new QMP reference manual, and can be placed and styled much more flexibly. Update the QAPI parser to now prohibit special "Note" sections while

[PATCH 15/20] qapi: remove developer factoring comments from QAPI doc blocks

2024-05-14 Thread John Snow
This is part of a project to overhaul the QMP reference manual. One goal of this overhaul is to "inline" inherited argument sections into command reference sections. A consequence of this design decision is that inherited doc block sections need to be merged with the inheritor's sections. When

[PATCH 13/20] docs/qapidoc: fix nested parsing under untagged sections

2024-05-14 Thread John Snow
Sphinx does not like sections without titles, because it wants to convert every section into a reference. When there is no title, it struggles to do this and transforms the tree inproperly. Depending on the rST used, this may result in an assertion error deep in the docutils HTMLWriter. When

[PATCH 10/20] qapi/schema: add __iter__ method to QAPISchemaVariants

2024-05-14 Thread John Snow
This just makes it easier to do something like: for var in variants: ... Instead of the more cumbersome and repetitive: for var in variants.variants: ... Especially in conjunction with entities that aren't guaranteed to have variants. Compare: for var in variants.variants if variants

[PATCH 16/20] qapi: rewrite StatsFilter comment

2024-05-14 Thread John Snow
Rewrite the StatsFilter intro paragraph to be more meaningful to end-users when it is inlined in generated documentation. Signed-off-by: John Snow --- qapi/stats.json | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qapi/stats.json b/qapi/stats.json index

[PATCH 09/20] qapi/parser: add undocumented stub members to all_sections

2024-05-14 Thread John Snow
This helps simplify the doc generator if it doesn't have to check for undocumented members. Signed-off-by: John Snow --- scripts/qapi/parser.py | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index

[PATCH 04/20] qapi/parser: preserve indentation in QAPIDoc sections

2024-05-14 Thread John Snow
Prior to this patch, a section like this: @name: lorem ipsum dolor sit amet consectetur adipiscing elit would be parsed as: "lorem ipsum\ndolor sit amet\n consectetur adipiscing elit" We want to preserve the indentation for even the first body line so that the entire block can be

[PATCH 05/20] qapi/parser: adjust info location for doc body section

2024-05-14 Thread John Snow
Instead of using the info object for the doc block as a whole, update the info pointer for each call to ensure_untagged_section when the existing section is otherwise empty. This way, Sphinx error information will match precisely to where the text actually starts. Signed-off-by: John Snow ---

[PATCH 08/20] qapi/parser: differentiate intro and outro paragraphs

2024-05-14 Thread John Snow
Add a semantic tag to paragraphs that appear *before* tagged sections/members/features and those that appear after. This will control how they are inlined when doc sections are merged and flattened. Signed-off-by: John Snow --- scripts/qapi/parser.py | 22 +- 1 file changed,

[PATCH 12/20] qapi/source: allow multi-line QAPISourceInfo advancing

2024-05-14 Thread John Snow
This is for the sake of the new rST generator (the "transmogrifier") so we can advance multiple lines on occasion while keeping the generated<-->source mappings accurate. next_line now simply takes an optional n parameter which chooses the number of lines to advance. Signed-off-by: John Snow

[PATCH 20/20] qapi: convert "Example" sections to rST

2024-05-14 Thread John Snow
Eliminate the "Example" sections in QAPI doc blocks, converting them into QMP example code blocks. This is generally done by converting "Example:" or "Examples:" lines into ".. code-block:: QMP" lines. This patch does also allow for the use of the rST syntax "Example::" by exempting double-colon

[PATCH 11/20] qapi/schema: add doc_visible property to QAPISchemaDefinition

2024-05-14 Thread John Snow
The intent here is to mark only certain definitions as visible in the end-user docs. All commands and events are inherently visible. Everything else is visible only if it is a member (or a branch member) of a type that is visible, or if it is named as a return type for a command. Notably, this

[PATCH 02/20] qapi: linter fixups

2024-05-14 Thread John Snow
Fix minor irritants to pylint/flake8 et al. (Yes, these need to be guarded by the Python tests. That's a work in progress, a series that's quite likely to follow once I finish this Sphinx project. Please pardon the temporary irritation.) Signed-off-by: John Snow --- scripts/qapi/introspect.py

[PATCH 00/20] qapi: new sphinx qapi domain pre-requisites

2024-05-14 Thread John Snow
Howdy - this patch series is the first batch of patches meant to prepare the QAPI documentation for a new Sphinx module that adds cross-references, an index, improved inlining, elision of types unseen on the wire, and other goodies. This series addresses just existing code and documentation that

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-05-14 Thread Yu Zhang
Hello Peter and all, I did a comparison of the VM live-migration speeds between RDMA and TCP/IP on our servers and plotted the results to get an initial impression. Unfortunately, the Ethernet NICs are not the recent ones, therefore, it may not make much sense. I can do it on servers with more

Re: [PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Raphael Norwitz
Code looks good. Just a question on the error case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > When the vhost-user is reconnecting to the backend, and if the vhost-user > fails > at the get_features in vhost_dev_init(), then the reconnect will fail > and it will not

Re: [PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Raphael Norwitz
The code for these two patches looks fine. Just some questions on the failure case you're trying to fix. On Tue, May 14, 2024 at 2:12 AM Li Feng wrote: > > This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. > > Since the current patch cannot completely fix the lost reconnect >

Re: [PATCH 1/2] copy-before-write: allow specifying minimum cluster size

2024-05-14 Thread Markus Armbruster
Fiona Ebner writes: > Am 26.03.24 um 10:06 schrieb Markus Armbruster: >>> @@ -365,7 +368,13 @@ BlockCopyState *block_copy_state_new(BdrvChild >>> *source, BdrvChild *target, >>> >>> GLOBAL_STATE_CODE(); >>> >>> -cluster_size = block_copy_calculate_cluster_size(target->bs, errp);

[PATCH v3 2/2] vhost-user: fix lost reconnect again

2024-05-14 Thread Li Feng
When the vhost-user is reconnecting to the backend, and if the vhost-user fails at the get_features in vhost_dev_init(), then the reconnect will fail and it will not be retriggered forever. The reason is: When the vhost-user fail at get_features, the vhost_dev_cleanup will be called immediately.

[PATCH v3 1/2] Revert "vhost-user: fix lost reconnect"

2024-05-14 Thread Li Feng
This reverts commit f02a4b8e6431598612466f76aac64ab492849abf. Since the current patch cannot completely fix the lost reconnect problem, there is a scenario that is not considered: - When the virtio-blk driver is removed from the guest os, s->connected has no chance to be set to false, resulting