All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/10] For 6.0 patches
@ 2021-03-28 18:45 marcandre.lureau
  2021-03-28 18:45 ` [PULL 01/10] util: fix use-after-free in module_load_one marcandre.lureau
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The following changes since commit 7b9a3c9f94bcac23c534bc9f42a9e914b433b299:

  Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20210326-pull-request' into staging (2021-03-26 12:58:58 +0000)

are available in the Git repository at:

  git@gitlab.com:marcandre.lureau/qemu.git tags/for-6.0-pull-request

for you to fetch changes up to f57d44b452e11d8b7c9743476c30a8d0f80926de:

  tests: Add tests for yank with the chardev-change case (2021-03-27 13:57:40 +0400)

----------------------------------------------------------------
For 6.0 misc patches under my radar.

Peter, let me know if you would rather split that PR.

----------------------------------------------------------------

Lukas Straub (6):
  yank: Remove dependency on qiochannel
  yank: Always link full yank code
  chardev/char.c: Move object_property_try_add_child out of chardev_new
  chardev/char.c: Always pass id to chardev_new
  chardev: Fix yank with the chardev-change case
  tests: Add tests for yank with the chardev-change case

Marc-André Lureau (3):
  util: fix use-after-free in module_load_one
  sphinx: adopt kernel readthedoc theme
  docs: simplify each section title

Priyankar Jain (1):
  dbus-vmstate: Increase the size of input stream buffer used during
    load

 docs/_templates/editpage.html              |   5 -
 docs/conf.py                               |  51 +++---
 docs/devel/_templates/editpage.html        |   5 -
 docs/devel/index.rst                       |   4 +-
 docs/interop/_templates/editpage.html      |   5 -
 docs/interop/index.rst                     |   4 +-
 docs/meson.build                           |   5 +-
 docs/specs/_templates/editpage.html        |   5 -
 docs/specs/index.rst                       |   4 +-
 docs/sphinx-static/theme_overrides.css     | 161 +++++++++++++++++
 docs/system/_templates/editpage.html       |   5 -
 docs/system/index.rst                      |   4 +-
 docs/tools/_templates/editpage.html        |   5 -
 docs/tools/index.rst                       |   4 +-
 docs/user/_templates/editpage.html         |   5 -
 docs/user/index.rst                        |   4 +-
 include/chardev/char.h                     |   3 +
 include/qemu/yank.h                        |  10 --
 migration/yank_functions.h                 |  17 ++
 backends/dbus-vmstate.c                    |  20 ++-
 chardev/char-socket.c                      |  41 +++--
 chardev/char.c                             |  77 +++++---
 migration/channel.c                        |   6 +-
 migration/multifd.c                        |   3 +-
 migration/qemu-file-channel.c              |   3 +-
 migration/yank_functions.c                 |  20 +++
 stubs/yank.c                               |  29 ---
 tests/unit/test-yank.c                     | 200 +++++++++++++++++++++
 util/module.c                              |   3 +-
 util/yank.c                                |   8 -
 MAINTAINERS                                |   3 +-
 migration/meson.build                      |   1 +
 stubs/meson.build                          |   1 -
 tests/docker/dockerfiles/alpine.docker     |   1 +
 tests/docker/dockerfiles/debian10.docker   |   1 +
 tests/docker/dockerfiles/fedora.docker     |   1 +
 tests/docker/dockerfiles/ubuntu.docker     |   1 +
 tests/docker/dockerfiles/ubuntu1804.docker |   1 +
 tests/docker/dockerfiles/ubuntu2004.docker |   1 +
 tests/unit/meson.build                     |   3 +-
 util/meson.build                           |   2 +-
 41 files changed, 567 insertions(+), 165 deletions(-)
 delete mode 100644 docs/_templates/editpage.html
 delete mode 100644 docs/devel/_templates/editpage.html
 delete mode 100644 docs/interop/_templates/editpage.html
 delete mode 100644 docs/specs/_templates/editpage.html
 create mode 100644 docs/sphinx-static/theme_overrides.css
 delete mode 100644 docs/system/_templates/editpage.html
 delete mode 100644 docs/tools/_templates/editpage.html
 delete mode 100644 docs/user/_templates/editpage.html
 create mode 100644 migration/yank_functions.h
 create mode 100644 migration/yank_functions.c
 delete mode 100644 stubs/yank.c
 create mode 100644 tests/unit/test-yank.c

-- 
2.29.0




^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PULL 01/10] util: fix use-after-free in module_load_one
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 02/10] dbus-vmstate: Increase the size of input stream buffer used during load marcandre.lureau
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-stable, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

g_hash_table_add always retains ownership of the pointer passed in as
the key. Its return status merely indicates whether the added entry was
new, or replaced an existing entry. Thus key must never be freed after
this method returns.

Spotted by ASAN:

==2407186==ERROR: AddressSanitizer: heap-use-after-free on address 0x6020003ac4f0 at pc 0x7ffff766659c bp 0x7fffffffd1d0 sp 0x7fffffffc980
READ of size 1 at 0x6020003ac4f0 thread T0
    #0 0x7ffff766659b  (/lib64/libasan.so.6+0x8a59b)
    #1 0x7ffff6bfa843 in g_str_equal ../glib/ghash.c:2303
    #2 0x7ffff6bf8167 in g_hash_table_lookup_node ../glib/ghash.c:493
    #3 0x7ffff6bf9b78 in g_hash_table_insert_internal ../glib/ghash.c:1598
    #4 0x7ffff6bf9c32 in g_hash_table_add ../glib/ghash.c:1689
    #5 0x5555596caad4 in module_load_one ../util/module.c:233
    #6 0x5555596ca949 in module_load_one ../util/module.c:225
    #7 0x5555596ca949 in module_load_one ../util/module.c:225
    #8 0x5555596cbdf4 in module_load_qom_all ../util/module.c:349

Typical C bug...

Fixes: 90629122d2e ("module: use g_hash_table_add()")
Cc: qemu-stable@nongnu.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210316134456.3243102-1-marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 util/module.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/module.c b/util/module.c
index cbe89fede6..7661d0f623 100644
--- a/util/module.c
+++ b/util/module.c
@@ -230,10 +230,11 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail)
         }
     }
 
-    if (!g_hash_table_add(loaded_modules, module_name)) {
+    if (g_hash_table_contains(loaded_modules, module_name)) {
         g_free(module_name);
         return true;
     }
+    g_hash_table_add(loaded_modules, module_name);
 
     search_dir = getenv("QEMU_MODULE_DIR");
     if (search_dir != NULL) {
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 02/10] dbus-vmstate: Increase the size of input stream buffer used during load
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
  2021-03-28 18:45 ` [PULL 01/10] util: fix use-after-free in module_load_one marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 03/10] sphinx: adopt kernel readthedoc theme marcandre.lureau
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Priyankar Jain

From: Priyankar Jain <priyankar.jain@nutanix.com>

This commit fixes an issue where migration is failing in the load phase
because of a false alarm about data unavailability.

Following is the error received when the amount of data to be transferred
exceeds the default buffer size setup by G_BUFFERED_INPUT_STREAM(4KiB),
even when the maximum data size supported by this backend is 1MiB
(DBUS_VMSTATE_SIZE_LIMIT):

  dbus_vmstate_post_load: Invalid vmstate size: 4364
  qemu-kvm: error while loading state for instance 0x0 of device 'dbus-vmstate/dbus-vmstate'

This commit sets the size of the input stream buffer used during load to
DBUS_VMSTATE_SIZE_LIMIT which is the maximum amount of data a helper can
send during save phase.
Secondly, this commit makes sure that the input stream buffer is loaded before
checking the size of the data available in it, rectifying the false alarm about
data unavailability.

Fixes: 5010cec2bc87 ("Add dbus-vmstate object")
Signed-off-by: Priyankar Jain <priyankar.jain@nutanix.com>
Message-Id: <cdaad4718e62bf22fd5e93ef3e252de20da5c17c.1612273156.git.priyankar.jain@nutanix.com>
[ Modified printf format for gsize ]
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 backends/dbus-vmstate.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c
index 2a0d2e4a31..9cfd758c42 100644
--- a/backends/dbus-vmstate.c
+++ b/backends/dbus-vmstate.c
@@ -204,6 +204,8 @@ static int dbus_vmstate_post_load(void *opaque, int version_id)
     m = g_memory_input_stream_new_from_data(self->data, self->data_size, NULL);
     s = g_data_input_stream_new(m);
     g_data_input_stream_set_byte_order(s, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
+    g_buffered_input_stream_set_buffer_size(G_BUFFERED_INPUT_STREAM(s),
+                                            DBUS_VMSTATE_SIZE_LIMIT);
 
     nelem = g_data_input_stream_read_uint32(s, NULL, &err);
     if (err) {
@@ -244,11 +246,23 @@ static int dbus_vmstate_post_load(void *opaque, int version_id)
         }
 
         len = g_data_input_stream_read_uint32(s, NULL, &err);
+        if (len > DBUS_VMSTATE_SIZE_LIMIT) {
+            error_report("%s: Invalid vmstate size: %u", __func__, len);
+            return -1;
+        }
+
+        g_buffered_input_stream_fill(G_BUFFERED_INPUT_STREAM(s), len, NULL,
+                                     &err);
+        if (err) {
+            goto error;
+        }
+
         avail = g_buffered_input_stream_get_available(
             G_BUFFERED_INPUT_STREAM(s));
-
-        if (len > DBUS_VMSTATE_SIZE_LIMIT || len > avail) {
-            error_report("%s: Invalid vmstate size: %u", __func__, len);
+        if (len > avail) {
+            error_report("%s: Not enough data available to load for Id: '%s'. "
+                "Available data size: %zu, Actual vmstate size: %u",
+                __func__, id, avail, len);
             return -1;
         }
 
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 03/10] sphinx: adopt kernel readthedoc theme
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
  2021-03-28 18:45 ` [PULL 01/10] util: fix use-after-free in module_load_one marcandre.lureau
  2021-03-28 18:45 ` [PULL 02/10] dbus-vmstate: Increase the size of input stream buffer used during load marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 04/10] docs: simplify each section title marcandre.lureau
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The default "alabaster" sphinx theme has a couple shortcomings:
- the navbar moves along the page
- the search bar is not always at the same place
- it lacks some contrast and colours

The "rtd" theme from readthedocs.org is a popular third party theme used
notably by the kernel, with a custom style sheet. I like it better,
perhaps others do too. It also simplifies the "Edit on Gitlab" links.

Tweak a bit the custom theme to match qemu.org style, use the
QEMU logo, and favicon etc.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Message-Id: <20210323115328.4146052-1-marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
---
 docs/_templates/editpage.html              |   5 -
 docs/conf.py                               |  51 ++++---
 docs/devel/_templates/editpage.html        |   5 -
 docs/interop/_templates/editpage.html      |   5 -
 docs/meson.build                           |   5 +-
 docs/specs/_templates/editpage.html        |   5 -
 docs/sphinx-static/theme_overrides.css     | 161 +++++++++++++++++++++
 docs/system/_templates/editpage.html       |   5 -
 docs/tools/_templates/editpage.html        |   5 -
 docs/user/_templates/editpage.html         |   5 -
 tests/docker/dockerfiles/alpine.docker     |   1 +
 tests/docker/dockerfiles/debian10.docker   |   1 +
 tests/docker/dockerfiles/fedora.docker     |   1 +
 tests/docker/dockerfiles/ubuntu.docker     |   1 +
 tests/docker/dockerfiles/ubuntu1804.docker |   1 +
 tests/docker/dockerfiles/ubuntu2004.docker |   1 +
 16 files changed, 199 insertions(+), 59 deletions(-)
 delete mode 100644 docs/_templates/editpage.html
 delete mode 100644 docs/devel/_templates/editpage.html
 delete mode 100644 docs/interop/_templates/editpage.html
 delete mode 100644 docs/specs/_templates/editpage.html
 create mode 100644 docs/sphinx-static/theme_overrides.css
 delete mode 100644 docs/system/_templates/editpage.html
 delete mode 100644 docs/tools/_templates/editpage.html
 delete mode 100644 docs/user/_templates/editpage.html

diff --git a/docs/_templates/editpage.html b/docs/_templates/editpage.html
deleted file mode 100644
index 4319b0f5ac..0000000000
--- a/docs/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/conf.py b/docs/conf.py
index 2ee6111872..3802b70d62 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -150,38 +150,47 @@
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'alabaster'
+try:
+    import sphinx_rtd_theme
+except ImportError:
+    raise ConfigError(
+        'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
+    )
+
+html_theme = 'sphinx_rtd_theme'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-# We initialize this to empty here, so the per-manual conf.py can just
-# add individual key/value entries.
-html_theme_options = {
-}
+if html_theme == 'sphinx_rtd_theme':
+    html_theme_options = {
+        "style_nav_header_background": "#802400",
+    }
+
+html_logo = os.path.join(qemu_docdir, "../ui/icons/qemu_128x128.png")
+
+html_favicon = os.path.join(qemu_docdir, "../ui/icons/qemu_32x32.png")
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-# QEMU doesn't yet have any static files, so comment this out so we don't
-# get a warning about a missing directory.
-# If we do ever add this then it would probably be better to call the
-# subdirectory sphinx_static, as the Linux kernel does.
-# html_static_path = ['_static']
+html_static_path = [os.path.join(qemu_docdir, "sphinx-static")]
+
+html_css_files = [
+    'theme_overrides.css',
+]
+
+html_context = {
+    "display_gitlab": True,
+    "gitlab_user": "qemu-project",
+    "gitlab_repo": "qemu",
+    "gitlab_version": "master",
+    "conf_py_path": "/docs/", # Path in the checkout to the docs root
+}
 
 # Custom sidebar templates, must be a dictionary that maps document names
 # to template names.
-#
-# This is required for the alabaster theme
-# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
-html_sidebars = {
-    '**': [
-        'about.html',
-        'editpage.html',
-        'navigation.html',
-        'searchbox.html',
-    ]
-}
+#html_sidebars = {}
 
 # Don't copy the rST source files to the HTML output directory,
 # and don't put links to the sources into the output HTML.
diff --git a/docs/devel/_templates/editpage.html b/docs/devel/_templates/editpage.html
deleted file mode 100644
index a86d22bca8..0000000000
--- a/docs/devel/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/interop/_templates/editpage.html b/docs/interop/_templates/editpage.html
deleted file mode 100644
index 215e562681..0000000000
--- a/docs/interop/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/interop/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/meson.build b/docs/meson.build
index f84306ba7e..855e3916e9 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -27,10 +27,9 @@ if sphinx_build.found()
   build_docs = (sphinx_build_test_out.returncode() == 0)
 
   if not build_docs
-    warning('@0@ is either too old or uses too old a Python version'
-            .format(sphinx_build.full_path()))
+    warning('@0@: @1@'.format(sphinx_build.full_path(), sphinx_build_test_out.stderr()))
     if get_option('docs').enabled()
-      error('Install a Python 3 version of python-sphinx')
+      error('Install a Python 3 version of python-sphinx and the readthedoc theme')
     endif
   endif
 endif
diff --git a/docs/specs/_templates/editpage.html b/docs/specs/_templates/editpage.html
deleted file mode 100644
index aaa468aa98..0000000000
--- a/docs/specs/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/specs/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/sphinx-static/theme_overrides.css b/docs/sphinx-static/theme_overrides.css
new file mode 100644
index 0000000000..c70ef95128
--- /dev/null
+++ b/docs/sphinx-static/theme_overrides.css
@@ -0,0 +1,161 @@
+/* -*- coding: utf-8; mode: css -*-
+ *
+ * Sphinx HTML theme customization: read the doc
+ * Based on Linux Documentation/sphinx-static/theme_overrides.css
+ */
+
+/* Improve contrast and increase size for easier reading. */
+
+body {
+    font-family: serif;
+    color: black;
+    font-size: 100%;
+}
+
+h1, h2, .rst-content .toctree-wrapper p.caption, h3, h4, h5, h6, legend {
+    font-family: sans-serif;
+}
+
+.rst-content dl:not(.docutils) dt {
+    border-top: none;
+    border-left: solid 3px #ccc;
+    background-color: #f0f0f0;
+    color: black;
+}
+
+.wy-nav-top {
+    background: #802400;
+}
+
+.wy-side-nav-search input[type="text"] {
+    border-color: #f60;
+}
+
+.wy-menu-vertical p.caption {
+    color: white;
+}
+
+.wy-menu-vertical li.current a {
+    color: #505050;
+}
+
+.wy-menu-vertical li.on a, .wy-menu-vertical li.current > a {
+    color: #303030;
+}
+
+.fa-gitlab {
+      box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19);
+      border-radius: 5px;
+}
+
+div[class^="highlight"] pre {
+    font-family: monospace;
+    color: black;
+    font-size: 100%;
+}
+
+.wy-menu-vertical {
+    font-family: sans-serif;
+}
+
+.c {
+    font-style: normal;
+}
+
+p {
+    font-size: 100%;
+}
+
+/* Interim: Code-blocks with line nos - lines and line numbers don't line up.
+ * see: https://github.com/rtfd/sphinx_rtd_theme/issues/419
+ */
+
+div[class^="highlight"] pre {
+    line-height: normal;
+}
+.rst-content .highlight > pre {
+    line-height: normal;
+}
+
+/* Keep fields from being strangely far apart due to inheirited table CSS. */
+.rst-content table.field-list th.field-name {
+    padding-top: 1px;
+    padding-bottom: 1px;
+}
+.rst-content table.field-list td.field-body {
+    padding-top: 1px;
+    padding-bottom: 1px;
+}
+
+@media screen {
+
+    /* content column
+     *
+     * RTD theme's default is 800px as max width for the content, but we have
+     * tables with tons of columns, which need the full width of the view-port.
+     */
+
+    .wy-nav-content{max-width: none; }
+
+    /* table:
+     *
+     *   - Sequences of whitespace should collapse into a single whitespace.
+     *   - make the overflow auto (scrollbar if needed)
+     *   - align caption "left" ("center" is unsuitable on vast tables)
+     */
+
+    .wy-table-responsive table td { white-space: normal; }
+    .wy-table-responsive { overflow: auto; }
+    .rst-content table.docutils caption { text-align: left; font-size: 100%; }
+
+    /* captions:
+     *
+     *   - captions should have 100% (not 85%) font size
+     *   - hide the permalink symbol as long as link is not hovered
+     */
+
+    .toc-title {
+        font-size: 150%;
+        font-weight: bold;
+    }
+
+    caption, .wy-table caption, .rst-content table.field-list caption {
+        font-size: 100%;
+    }
+    caption a.headerlink { opacity: 0; }
+    caption a.headerlink:hover { opacity: 1; }
+
+    /* Menu selection and keystrokes */
+
+    span.menuselection {
+        color: blue;
+        font-family: "Courier New", Courier, monospace
+    }
+
+    code.kbd, code.kbd span {
+        color: white;
+        background-color: darkblue;
+        font-weight: bold;
+        font-family: "Courier New", Courier, monospace
+    }
+
+    /* fix bottom margin of lists items */
+
+    .rst-content .section ul li:last-child, .rst-content .section ul li p:last-child {
+          margin-bottom: 12px;
+    }
+
+    /* inline literal: drop the borderbox, padding and red color */
+
+    code, .rst-content tt, .rst-content code {
+        color: inherit;
+        border: none;
+        padding: unset;
+        background: inherit;
+        font-size: 85%;
+    }
+
+    .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
+        color: inherit;
+    }
+}
diff --git a/docs/system/_templates/editpage.html b/docs/system/_templates/editpage.html
deleted file mode 100644
index 6586b2e257..0000000000
--- a/docs/system/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/system/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/tools/_templates/editpage.html b/docs/tools/_templates/editpage.html
deleted file mode 100644
index 2a9c8fc92b..0000000000
--- a/docs/tools/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/tools/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/docs/user/_templates/editpage.html b/docs/user/_templates/editpage.html
deleted file mode 100644
index 1f5ee01e60..0000000000
--- a/docs/user/_templates/editpage.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<div id="editpage">
-  <ul>
-    <li><a href="https://gitlab.com/qemu-project/qemu/-/blob/master/docs/user/{{pagename}}.rst">Page source</a></li>
-  </ul>
-</div>
diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
index d63a269aef..88d3bbe5f2 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -39,6 +39,7 @@ ENV PACKAGES \
 	pulseaudio-dev \
 	python3 \
 	py3-sphinx \
+	py3-sphinx_rtd_theme \
 	shadow \
 	snappy-dev \
 	spice-dev \
diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
index d034acbd25..63cf835ec5 100644
--- a/tests/docker/dockerfiles/debian10.docker
+++ b/tests/docker/dockerfiles/debian10.docker
@@ -32,6 +32,7 @@ RUN apt update && \
         psmisc \
         python3 \
         python3-sphinx \
+        python3-sphinx-rtd-theme \
         $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
 
 ENV FEATURES docs
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 915fdc1845..d8fa16372d 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -92,6 +92,7 @@ ENV PACKAGES \
     python3-pillow \
     python3-pip \
     python3-sphinx \
+    python3-sphinx_rtd_theme \
     python3-virtualenv \
     rdma-core-devel \
     SDL2-devel \
diff --git a/tests/docker/dockerfiles/ubuntu.docker b/tests/docker/dockerfiles/ubuntu.docker
index b5ef7a8198..98a527361c 100644
--- a/tests/docker/dockerfiles/ubuntu.docker
+++ b/tests/docker/dockerfiles/ubuntu.docker
@@ -63,6 +63,7 @@ ENV PACKAGES \
     ninja-build \
     python3-yaml \
     python3-sphinx \
+    python3-sphinx-rtd-theme \
     sparse \
     xfslibs-dev
 RUN apt-get update && \
diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker
index 9b0a19ba5e..c0d3642507 100644
--- a/tests/docker/dockerfiles/ubuntu1804.docker
+++ b/tests/docker/dockerfiles/ubuntu1804.docker
@@ -48,6 +48,7 @@ ENV PACKAGES \
     make \
     python3-yaml \
     python3-sphinx \
+    python3-sphinx-rtd-theme \
     ninja-build \
     sparse \
     xfslibs-dev
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 9750016e51..f1e0ebad49 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -58,6 +58,7 @@ ENV PACKAGES flex bison \
     python3-pil \
     python3-pip \
     python3-sphinx \
+    python3-sphinx-rtd-theme \
     python3-venv \
     python3-yaml \
     rpm2cpio \
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 04/10] docs: simplify each section title
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (2 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 03/10] sphinx: adopt kernel readthedoc theme marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 05/10] yank: Remove dependency on qiochannel marcandre.lureau
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Now that we merged into one doc, it makes the nav looks nicer.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210323074704.4078381-1-marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
---
 docs/devel/index.rst   | 4 ++--
 docs/interop/index.rst | 4 ++--
 docs/specs/index.rst   | 4 ++--
 docs/system/index.rst  | 4 ++--
 docs/tools/index.rst   | 4 ++--
 docs/user/index.rst    | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/docs/devel/index.rst b/docs/devel/index.rst
index 7c424ea6d7..60039faa68 100644
--- a/docs/devel/index.rst
+++ b/docs/devel/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'devel' manual.
 
 
-QEMU Developer's Guide
-======================
+Developer Information
+=====================
 
 This manual documents various parts of the internals of QEMU.
 You only need to read it if you are interested in reading or
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
index 95d56495f6..219a5e5fc5 100644
--- a/docs/interop/index.rst
+++ b/docs/interop/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'interop' manual.
 
 
-QEMU System Emulation Management and Interoperability Guide
-===========================================================
+System Emulation Management and Interoperability
+================================================
 
 This manual contains documents and specifications that are useful
 for making QEMU interoperate with other software.
diff --git a/docs/specs/index.rst b/docs/specs/index.rst
index 1b0eb979d5..7b08314d33 100644
--- a/docs/specs/index.rst
+++ b/docs/specs/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'specs' manual
 
 
-QEMU System Emulation Guest Hardware Specifications
-===================================================
+System Emulation Guest Hardware Specifications
+==============================================
 
 
 Contents:
diff --git a/docs/system/index.rst b/docs/system/index.rst
index 6ad9c93806..02d0707181 100644
--- a/docs/system/index.rst
+++ b/docs/system/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'system' manual.
 
 
-QEMU System Emulation User's Guide
-==================================
+System Emulation
+================
 
 This manual is the overall guide for users using QEMU
 for full system emulation (as opposed to user-mode emulation).
diff --git a/docs/tools/index.rst b/docs/tools/index.rst
index 3a5829c17a..d923834a73 100644
--- a/docs/tools/index.rst
+++ b/docs/tools/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'tools' manual
 
 
-QEMU Tools Guide
-================
+Tools
+=====
 
 
 Contents:
diff --git a/docs/user/index.rst b/docs/user/index.rst
index e030dadf65..a5b47459ec 100644
--- a/docs/user/index.rst
+++ b/docs/user/index.rst
@@ -1,8 +1,8 @@
 .. This is the top level page for the 'user' manual.
 
 
-QEMU User Mode Emulation User's Guide
-=====================================
+User Mode Emulation
+===================
 
 This manual is the overall guide for users using QEMU
 for user-mode emulation.  In this mode, QEMU can launch
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 05/10] yank: Remove dependency on qiochannel
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (3 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 04/10] docs: simplify each section title marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 06/10] yank: Always link full yank code marcandre.lureau
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

Remove dependency on qiochannel by removing yank_generic_iochannel and
letting migration and chardev use their own yank function for
iochannel.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20ff143fc2db23e27cd41d38043e481376c9cec1.1616521341.git.lukasstraub2@web.de>
---
 include/qemu/yank.h           | 10 ----------
 migration/yank_functions.h    | 17 +++++++++++++++++
 chardev/char-socket.c         | 21 ++++++++++++++-------
 migration/channel.c           |  6 ++++--
 migration/multifd.c           |  3 ++-
 migration/qemu-file-channel.c |  3 ++-
 migration/yank_functions.c    | 20 ++++++++++++++++++++
 stubs/yank.c                  |  6 ------
 util/yank.c                   |  8 --------
 MAINTAINERS                   |  1 +
 migration/meson.build         |  1 +
 11 files changed, 61 insertions(+), 35 deletions(-)
 create mode 100644 migration/yank_functions.h
 create mode 100644 migration/yank_functions.c

diff --git a/include/qemu/yank.h b/include/qemu/yank.h
index 5b93c70cbf..5375a1f195 100644
--- a/include/qemu/yank.h
+++ b/include/qemu/yank.h
@@ -73,16 +73,6 @@ void yank_unregister_function(const YankInstance *instance,
                               YankFn *func,
                               void *opaque);
 
-/**
- * yank_generic_iochannel: Generic yank function for iochannel
- *
- * This is a generic yank function which will call qio_channel_shutdown on the
- * provided QIOChannel.
- *
- * @opaque: QIOChannel to shutdown
- */
-void yank_generic_iochannel(void *opaque);
-
 #define BLOCKDEV_YANK_INSTANCE(the_node_name) (&(YankInstance) { \
         .type = YANK_INSTANCE_TYPE_BLOCK_NODE, \
         .u.block_node.node_name = (the_node_name) })
diff --git a/migration/yank_functions.h b/migration/yank_functions.h
new file mode 100644
index 0000000000..055ea22523
--- /dev/null
+++ b/migration/yank_functions.h
@@ -0,0 +1,17 @@
+/*
+ * migration yank functions
+ *
+ * Copyright (c) Lukas Straub <lukasstraub2@web.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+/**
+ * migration_yank_iochannel: yank function for iochannel
+ *
+ * This yank function will call qio_channel_shutdown on the provided QIOChannel.
+ *
+ * @opaque: QIOChannel to shutdown
+ */
+void migration_yank_iochannel(void *opaque);
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index f618bdec28..1d455ecca4 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -402,6 +402,13 @@ static void remove_hup_source(SocketChardev *s)
     }
 }
 
+static void char_socket_yank_iochannel(void *opaque)
+{
+    QIOChannel *ioc = QIO_CHANNEL(opaque);
+
+    qio_channel_shutdown(ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
+}
+
 static void tcp_chr_free_connection(Chardev *chr)
 {
     SocketChardev *s = SOCKET_CHARDEV(chr);
@@ -424,7 +431,7 @@ static void tcp_chr_free_connection(Chardev *chr)
         (s->state == TCP_CHARDEV_STATE_CONNECTING
         || s->state == TCP_CHARDEV_STATE_CONNECTED)) {
         yank_unregister_function(CHARDEV_YANK_INSTANCE(chr->label),
-                                 yank_generic_iochannel,
+                                 char_socket_yank_iochannel,
                                  QIO_CHANNEL(s->sioc));
     }
     object_unref(OBJECT(s->sioc));
@@ -946,7 +953,7 @@ static int tcp_chr_add_client(Chardev *chr, int fd)
     tcp_chr_set_client_ioc_name(chr, sioc);
     if (s->registered_yank) {
         yank_register_function(CHARDEV_YANK_INSTANCE(chr->label),
-                               yank_generic_iochannel,
+                               char_socket_yank_iochannel,
                                QIO_CHANNEL(sioc));
     }
     ret = tcp_chr_new_client(chr, sioc);
@@ -965,7 +972,7 @@ static void tcp_chr_accept(QIONetListener *listener,
     tcp_chr_set_client_ioc_name(chr, cioc);
     if (s->registered_yank) {
         yank_register_function(CHARDEV_YANK_INSTANCE(chr->label),
-                               yank_generic_iochannel,
+                               char_socket_yank_iochannel,
                                QIO_CHANNEL(cioc));
     }
     tcp_chr_new_client(chr, cioc);
@@ -985,7 +992,7 @@ static int tcp_chr_connect_client_sync(Chardev *chr, Error **errp)
     }
     if (s->registered_yank) {
         yank_register_function(CHARDEV_YANK_INSTANCE(chr->label),
-                               yank_generic_iochannel,
+                               char_socket_yank_iochannel,
                                QIO_CHANNEL(sioc));
     }
     tcp_chr_new_client(chr, sioc);
@@ -1005,7 +1012,7 @@ static void tcp_chr_accept_server_sync(Chardev *chr)
     tcp_chr_set_client_ioc_name(chr, sioc);
     if (s->registered_yank) {
         yank_register_function(CHARDEV_YANK_INSTANCE(chr->label),
-                               yank_generic_iochannel,
+                               char_socket_yank_iochannel,
                                QIO_CHANNEL(sioc));
     }
     tcp_chr_new_client(chr, sioc);
@@ -1138,7 +1145,7 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
         tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED);
         if (s->registered_yank) {
             yank_unregister_function(CHARDEV_YANK_INSTANCE(chr->label),
-                                     yank_generic_iochannel,
+                                     char_socket_yank_iochannel,
                                      QIO_CHANNEL(sioc));
         }
         check_report_connect_error(chr, err);
@@ -1176,7 +1183,7 @@ static void tcp_chr_connect_client_async(Chardev *chr)
     tcp_chr_set_client_ioc_name(chr, sioc);
     if (s->registered_yank) {
         yank_register_function(CHARDEV_YANK_INSTANCE(chr->label),
-                               yank_generic_iochannel,
+                               char_socket_yank_iochannel,
                                QIO_CHANNEL(sioc));
     }
     /*
diff --git a/migration/channel.c b/migration/channel.c
index 35fe234e9c..c9ee902021 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -20,6 +20,7 @@
 #include "io/channel-tls.h"
 #include "io/channel-socket.h"
 #include "qemu/yank.h"
+#include "yank_functions.h"
 
 /**
  * @migration_channel_process_incoming - Create new incoming migration channel
@@ -38,7 +39,8 @@ void migration_channel_process_incoming(QIOChannel *ioc)
         ioc, object_get_typename(OBJECT(ioc)));
 
     if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
-        yank_register_function(MIGRATION_YANK_INSTANCE, yank_generic_iochannel,
+        yank_register_function(MIGRATION_YANK_INSTANCE,
+                               migration_yank_iochannel,
                                QIO_CHANNEL(ioc));
     }
 
@@ -76,7 +78,7 @@ void migration_channel_connect(MigrationState *s,
     if (!error) {
         if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) {
             yank_register_function(MIGRATION_YANK_INSTANCE,
-                                   yank_generic_iochannel,
+                                   migration_yank_iochannel,
                                    QIO_CHANNEL(ioc));
         }
 
diff --git a/migration/multifd.c b/migration/multifd.c
index 03527c564c..a6677c45c8 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -27,6 +27,7 @@
 
 #include "qemu/yank.h"
 #include "io/channel-socket.h"
+#include "yank_functions.h"
 
 /* Multiple fd's */
 
@@ -989,7 +990,7 @@ int multifd_load_cleanup(Error **errp)
         if (object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET)
             && OBJECT(p->c)->ref == 1) {
             yank_unregister_function(MIGRATION_YANK_INSTANCE,
-                                     yank_generic_iochannel,
+                                     migration_yank_iochannel,
                                      QIO_CHANNEL(p->c));
         }
 
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index afc3a7f642..876d05a540 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -28,6 +28,7 @@
 #include "io/channel-socket.h"
 #include "qemu/iov.h"
 #include "qemu/yank.h"
+#include "yank_functions.h"
 
 
 static ssize_t channel_writev_buffer(void *opaque,
@@ -108,7 +109,7 @@ static int channel_close(void *opaque, Error **errp)
     if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)
         && OBJECT(ioc)->ref == 1) {
         yank_unregister_function(MIGRATION_YANK_INSTANCE,
-                                 yank_generic_iochannel,
+                                 migration_yank_iochannel,
                                  QIO_CHANNEL(ioc));
     }
     object_unref(OBJECT(ioc));
diff --git a/migration/yank_functions.c b/migration/yank_functions.c
new file mode 100644
index 0000000000..96c90e17dc
--- /dev/null
+++ b/migration/yank_functions.c
@@ -0,0 +1,20 @@
+/*
+ * migration yank functions
+ *
+ * Copyright (c) Lukas Straub <lukasstraub2@web.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "io/channel.h"
+#include "yank_functions.h"
+
+void migration_yank_iochannel(void *opaque)
+{
+    QIOChannel *ioc = QIO_CHANNEL(opaque);
+
+    qio_channel_shutdown(ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
+}
diff --git a/stubs/yank.c b/stubs/yank.c
index 6090416065..11b24fc057 100644
--- a/stubs/yank.c
+++ b/stubs/yank.c
@@ -21,9 +21,3 @@ void yank_unregister_function(const YankInstance *instance,
                               void *opaque)
 {
 }
-
-void yank_generic_iochannel(void *opaque)
-{
-}
-
-
diff --git a/util/yank.c b/util/yank.c
index fc08f65209..abf47c346d 100644
--- a/util/yank.c
+++ b/util/yank.c
@@ -15,7 +15,6 @@
 #include "qapi/qapi-commands-yank.h"
 #include "qapi/qapi-visit-yank.h"
 #include "qapi/clone-visitor.h"
-#include "io/channel.h"
 #include "qemu/yank.h"
 
 struct YankFuncAndParam {
@@ -151,13 +150,6 @@ void yank_unregister_function(const YankInstance *instance,
     abort();
 }
 
-void yank_generic_iochannel(void *opaque)
-{
-    QIOChannel *ioc = QIO_CHANNEL(opaque);
-
-    qio_channel_shutdown(ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL);
-}
-
 void qmp_yank(YankInstanceList *instances,
               Error **errp)
 {
diff --git a/MAINTAINERS b/MAINTAINERS
index 554be84b32..12c28feb35 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2823,6 +2823,7 @@ M: Lukas Straub <lukasstraub2@web.de>
 S: Odd fixes
 F: util/yank.c
 F: stubs/yank.c
+F: migration/yank_functions*
 F: include/qemu/yank.h
 F: qapi/yank.json
 
diff --git a/migration/meson.build b/migration/meson.build
index 9645f44005..2cfa8eed72 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -6,6 +6,7 @@ migration_files = files(
   'vmstate.c',
   'qemu-file-channel.c',
   'qemu-file.c',
+  'yank_functions.c',
 )
 softmmu_ss.add(migration_files)
 
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 06/10] yank: Always link full yank code
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (4 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 05/10] yank: Remove dependency on qiochannel marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 07/10] chardev/char.c: Move object_property_try_add_child out of chardev_new marcandre.lureau
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

Yank now only depends on util and can be always linked in. Also remove
the stubs as they are not needed anymore.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <997aa12a28c555d8a3b7a363b3bda5c3cf1821ba.1616521341.git.lukasstraub2@web.de>
---
 stubs/yank.c      | 23 -----------------------
 MAINTAINERS       |  1 -
 stubs/meson.build |  1 -
 util/meson.build  |  2 +-
 4 files changed, 1 insertion(+), 26 deletions(-)
 delete mode 100644 stubs/yank.c

diff --git a/stubs/yank.c b/stubs/yank.c
deleted file mode 100644
index 11b24fc057..0000000000
--- a/stubs/yank.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/yank.h"
-
-bool yank_register_instance(const YankInstance *instance, Error **errp)
-{
-    return true;
-}
-
-void yank_unregister_instance(const YankInstance *instance)
-{
-}
-
-void yank_register_function(const YankInstance *instance,
-                            YankFn *func,
-                            void *opaque)
-{
-}
-
-void yank_unregister_function(const YankInstance *instance,
-                              YankFn *func,
-                              void *opaque)
-{
-}
diff --git a/MAINTAINERS b/MAINTAINERS
index 12c28feb35..dcab656e62 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2822,7 +2822,6 @@ Yank feature
 M: Lukas Straub <lukasstraub2@web.de>
 S: Odd fixes
 F: util/yank.c
-F: stubs/yank.c
 F: migration/yank_functions*
 F: include/qemu/yank.h
 F: qapi/yank.json
diff --git a/stubs/meson.build b/stubs/meson.build
index 8a3e804cf0..be6f6d609e 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -46,7 +46,6 @@ stub_ss.add(files('vm-stop.c'))
 stub_ss.add(files('win32-kbd-hook.c'))
 stub_ss.add(files('cpu-synchronize-state.c'))
 if have_block
-  stub_ss.add(files('yank.c'))
   stub_ss.add(files('replay-tools.c'))
 endif
 if have_system
diff --git a/util/meson.build b/util/meson.build
index 984fba965f..510765cde4 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -43,6 +43,7 @@ util_ss.add(files('stats64.c'))
 util_ss.add(files('systemd.c'))
 util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c'))
 util_ss.add(files('guest-random.c'))
+util_ss.add(files('yank.c'))
 
 if have_user
   util_ss.add(files('selfmap.c'))
@@ -51,7 +52,6 @@ endif
 if have_system
   util_ss.add(files('crc-ccitt.c'))
   util_ss.add(when: 'CONFIG_GIO', if_true: [files('dbus.c'), gio])
-  util_ss.add(files('yank.c'))
   util_ss.add(when: 'CONFIG_LINUX', if_true: files('userfaultfd.c'))
 endif
 
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 07/10] chardev/char.c: Move object_property_try_add_child out of chardev_new
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (5 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 06/10] yank: Always link full yank code marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 08/10] chardev/char.c: Always pass id to chardev_new marcandre.lureau
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

Move object_property_try_add_child out of chardev_new into it's
callers. This is a preparation for the next patches to fix yank
with the chardev-change case.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Li Zhang <li.zhang@cloud.ionos.com>
Message-Id: <b2a5092ec681737bc3a21ea16f3c00848b277521.1616794852.git.lukasstraub2@web.de>
---
 chardev/char.c | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/chardev/char.c b/chardev/char.c
index 140d6d9d36..48f321b3e1 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -975,7 +975,9 @@ static Chardev *chardev_new(const char *id, const char *typename,
 
     qemu_char_open(chr, backend, &be_opened, &local_err);
     if (local_err) {
-        goto end;
+        error_propagate(errp, local_err);
+        object_unref(obj);
+        return NULL;
     }
 
     if (!chr->filename) {
@@ -985,22 +987,6 @@ static Chardev *chardev_new(const char *id, const char *typename,
         qemu_chr_be_event(chr, CHR_EVENT_OPENED);
     }
 
-    if (id) {
-        object_property_try_add_child(get_chardevs_root(), id, obj,
-                                      &local_err);
-        if (local_err) {
-            goto end;
-        }
-        object_unref(obj);
-    }
-
-end:
-    if (local_err) {
-        error_propagate(errp, local_err);
-        object_unref(obj);
-        return NULL;
-    }
-
     return chr;
 }
 
@@ -1009,6 +995,7 @@ Chardev *qemu_chardev_new(const char *id, const char *typename,
                           GMainContext *gcontext,
                           Error **errp)
 {
+    Chardev *chr;
     g_autofree char *genid = NULL;
 
     if (!id) {
@@ -1016,7 +1003,19 @@ Chardev *qemu_chardev_new(const char *id, const char *typename,
         id = genid;
     }
 
-    return chardev_new(id, typename, backend, gcontext, errp);
+    chr = chardev_new(id, typename, backend, gcontext, errp);
+    if (!chr) {
+        return NULL;
+    }
+
+    if (!object_property_try_add_child(get_chardevs_root(), id, OBJECT(chr),
+                                       errp)) {
+        object_unref(OBJECT(chr));
+        return NULL;
+    }
+    object_unref(OBJECT(chr));
+
+    return chr;
 }
 
 ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
@@ -1037,6 +1036,13 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
         return NULL;
     }
 
+    if (!object_property_try_add_child(get_chardevs_root(), id, OBJECT(chr),
+                                       errp)) {
+        object_unref(OBJECT(chr));
+        return NULL;
+    }
+    object_unref(OBJECT(chr));
+
     ret = g_new0(ChardevReturn, 1);
     if (CHARDEV_IS_PTY(chr)) {
         ret->pty = g_strdup(chr->filename + 4);
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 08/10] chardev/char.c: Always pass id to chardev_new
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (6 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 07/10] chardev/char.c: Move object_property_try_add_child out of chardev_new marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 09/10] chardev: Fix yank with the chardev-change case marcandre.lureau
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

Always pass the id to chardev_new, since it is needed to register
the yank instance for the chardev. Also, after checking that
nothing calls chardev_new with id=NULL, assert() that id!=NULL.

This fixes a crash when using chardev-change to change a chardev
to chardev-socket, which attempts to register a yank instance.
This in turn tries to dereference the NULL-pointer.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Li Zhang <li.zhang@cloud.ionos.com>
Message-Id: <3e669b6c160aa7278e37c4d95e0445574f96c7b7.1616794852.git.lukasstraub2@web.de>
---
 chardev/char.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/chardev/char.c b/chardev/char.c
index 48f321b3e1..75993f903f 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -967,6 +967,7 @@ static Chardev *chardev_new(const char *id, const char *typename,
     bool be_opened = true;
 
     assert(g_str_has_prefix(typename, "chardev-"));
+    assert(id);
 
     obj = object_new(typename);
     chr = CHARDEV(obj);
@@ -1095,12 +1096,11 @@ ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend,
         return NULL;
     }
 
-    chr_new = chardev_new(NULL, object_class_get_name(OBJECT_CLASS(cc)),
+    chr_new = chardev_new(id, object_class_get_name(OBJECT_CLASS(cc)),
                           backend, chr->gcontext, errp);
     if (!chr_new) {
         return NULL;
     }
-    chr_new->label = g_strdup(id);
 
     if (chr->be_open && !chr_new->be_open) {
         qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 09/10] chardev: Fix yank with the chardev-change case
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (7 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 08/10] chardev/char.c: Always pass id to chardev_new marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 18:45 ` [PULL 10/10] tests: Add tests for " marcandre.lureau
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

When changing from chardev-socket (which supports yank) to
chardev-socket again, it fails, because the new chardev attempts
to register a new yank instance. This in turn fails, as there
still is the yank instance from the current chardev. Also,
the old chardev shouldn't unregister the yank instance when it
is freed.

To fix this, now the new chardev only registers a yank instance if
the current chardev doesn't support yank and thus hasn't registered
one already. Also, when the old chardev is freed, it now only
unregisters the yank instance if the new chardev doesn't need it.

If the initialization of the new chardev fails, it still has
chr->handover_yank_instance set and won't unregister the yank
instance when it is freed.

s->registered_yank is always true here, as chardev-change only works
on user-visible chardevs and those are guraranteed to register a
yank instance as they are initialized via
chardev_new()
 qemu_char_open()
  cc->open() (qmp_chardev_open_socket()).

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Li Zhang <li.zhang@cloud.ionos.com>
Message-Id: <9637888d7591d2971975188478bb707299a1dc04.1616794852.git.lukasstraub2@web.de>
---
 include/chardev/char.h |  3 +++
 chardev/char-socket.c  | 20 +++++++++++++++++---
 chardev/char.c         | 35 ++++++++++++++++++++++++++++-------
 3 files changed, 48 insertions(+), 10 deletions(-)

diff --git a/include/chardev/char.h b/include/chardev/char.h
index 4181a2784a..7c0444f90d 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -65,6 +65,8 @@ struct Chardev {
     char *filename;
     int logfd;
     int be_open;
+    /* used to coordinate the chardev-change special-case: */
+    bool handover_yank_instance;
     GSource *gsource;
     GMainContext *gcontext;
     DECLARE_BITMAP(features, QEMU_CHAR_FEATURE_LAST);
@@ -251,6 +253,7 @@ struct ChardevClass {
     ObjectClass parent_class;
 
     bool internal; /* TODO: eventually use TYPE_USER_CREATABLE */
+    bool supports_yank;
     void (*parse)(QemuOpts *opts, ChardevBackend *backend, Error **errp);
 
     void (*open)(Chardev *chr, ChardevBackend *backend,
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 1d455ecca4..daa89fe5d1 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -1126,7 +1126,13 @@ static void char_socket_finalize(Object *obj)
     }
     g_free(s->tls_authz);
     if (s->registered_yank) {
-        yank_unregister_instance(CHARDEV_YANK_INSTANCE(chr->label));
+        /*
+         * In the chardev-change special-case, we shouldn't unregister the yank
+         * instance, as it still may be needed.
+         */
+        if (!chr->handover_yank_instance) {
+            yank_unregister_instance(CHARDEV_YANK_INSTANCE(chr->label));
+        }
     }
 
     qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
@@ -1424,8 +1430,14 @@ static void qmp_chardev_open_socket(Chardev *chr,
         qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_FD_PASS);
     }
 
-    if (!yank_register_instance(CHARDEV_YANK_INSTANCE(chr->label), errp)) {
-        return;
+    /*
+     * In the chardev-change special-case, we shouldn't register a new yank
+     * instance, as there already may be one.
+     */
+    if (!chr->handover_yank_instance) {
+        if (!yank_register_instance(CHARDEV_YANK_INSTANCE(chr->label), errp)) {
+            return;
+        }
     }
     s->registered_yank = true;
 
@@ -1567,6 +1579,8 @@ static void char_socket_class_init(ObjectClass *oc, void *data)
 {
     ChardevClass *cc = CHARDEV_CLASS(oc);
 
+    cc->supports_yank = true;
+
     cc->parse = qemu_chr_parse_socket;
     cc->open = qmp_chardev_open_socket;
     cc->chr_wait_connected = tcp_chr_wait_connected;
diff --git a/chardev/char.c b/chardev/char.c
index 75993f903f..398f09df19 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -39,6 +39,7 @@
 #include "qemu/option.h"
 #include "qemu/id.h"
 #include "qemu/coroutine.h"
+#include "qemu/yank.h"
 
 #include "chardev-internal.h"
 
@@ -266,6 +267,7 @@ static void char_init(Object *obj)
 {
     Chardev *chr = CHARDEV(obj);
 
+    chr->handover_yank_instance = false;
     chr->logfd = -1;
     qemu_mutex_init(&chr->chr_write_lock);
 
@@ -959,6 +961,7 @@ void qemu_chr_set_feature(Chardev *chr,
 static Chardev *chardev_new(const char *id, const char *typename,
                             ChardevBackend *backend,
                             GMainContext *gcontext,
+                            bool handover_yank_instance,
                             Error **errp)
 {
     Object *obj;
@@ -971,6 +974,7 @@ static Chardev *chardev_new(const char *id, const char *typename,
 
     obj = object_new(typename);
     chr = CHARDEV(obj);
+    chr->handover_yank_instance = handover_yank_instance;
     chr->label = g_strdup(id);
     chr->gcontext = gcontext;
 
@@ -1004,7 +1008,7 @@ Chardev *qemu_chardev_new(const char *id, const char *typename,
         id = genid;
     }
 
-    chr = chardev_new(id, typename, backend, gcontext, errp);
+    chr = chardev_new(id, typename, backend, gcontext, false, errp);
     if (!chr) {
         return NULL;
     }
@@ -1032,7 +1036,7 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
     }
 
     chr = chardev_new(id, object_class_get_name(OBJECT_CLASS(cc)),
-                      backend, NULL, errp);
+                      backend, NULL, false, errp);
     if (!chr) {
         return NULL;
     }
@@ -1057,9 +1061,10 @@ ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend,
                                   Error **errp)
 {
     CharBackend *be;
-    const ChardevClass *cc;
+    const ChardevClass *cc, *cc_new;
     Chardev *chr, *chr_new;
     bool closed_sent = false;
+    bool handover_yank_instance;
     ChardevReturn *ret;
 
     chr = qemu_chr_find(id);
@@ -1091,13 +1096,20 @@ ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend,
         return NULL;
     }
 
-    cc = char_get_class(ChardevBackendKind_str(backend->type), errp);
-    if (!cc) {
+    cc = CHARDEV_GET_CLASS(chr);
+    cc_new = char_get_class(ChardevBackendKind_str(backend->type), errp);
+    if (!cc_new) {
         return NULL;
     }
 
-    chr_new = chardev_new(id, object_class_get_name(OBJECT_CLASS(cc)),
-                          backend, chr->gcontext, errp);
+    /*
+     * The new chardev should not register a yank instance if the current
+     * chardev has registered one already.
+     */
+    handover_yank_instance = cc->supports_yank && cc_new->supports_yank;
+
+    chr_new = chardev_new(id, object_class_get_name(OBJECT_CLASS(cc_new)),
+                          backend, chr->gcontext, handover_yank_instance, errp);
     if (!chr_new) {
         return NULL;
     }
@@ -1121,6 +1133,15 @@ ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend,
         return NULL;
     }
 
+    /* change successfull, clean up */
+    chr_new->handover_yank_instance = false;
+
+    /*
+     * When the old chardev is freed, it should not unregister the yank
+     * instance if the new chardev needs it.
+     */
+    chr->handover_yank_instance = handover_yank_instance;
+
     object_unparent(OBJECT(chr));
     object_property_add_child(get_chardevs_root(), chr_new->label,
                               OBJECT(chr_new));
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PULL 10/10] tests: Add tests for yank with the chardev-change case
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (8 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 09/10] chardev: Fix yank with the chardev-change case marcandre.lureau
@ 2021-03-28 18:45 ` marcandre.lureau
  2021-03-28 19:00 ` [PULL 00/10] For 6.0 patches no-reply
  2021-03-29 13:53 ` Peter Maydell
  11 siblings, 0 replies; 21+ messages in thread
From: marcandre.lureau @ 2021-03-28 18:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Lukas Straub

From: Lukas Straub <lukasstraub2@web.de>

Add tests for yank with the chardev-change case.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Li Zhang <li.zhang@cloud.ionos.com>
Message-Id: <7c2f1ddcaa1c97462cb0b834d5aa7368283aa67d.1616794852.git.lukasstraub2@web.de>
---
 tests/unit/test-yank.c | 200 +++++++++++++++++++++++++++++++++++++++++
 MAINTAINERS            |   1 +
 tests/unit/meson.build |   3 +-
 3 files changed, 203 insertions(+), 1 deletion(-)
 create mode 100644 tests/unit/test-yank.c

diff --git a/tests/unit/test-yank.c b/tests/unit/test-yank.c
new file mode 100644
index 0000000000..1596a3b98e
--- /dev/null
+++ b/tests/unit/test-yank.c
@@ -0,0 +1,200 @@
+/*
+ * Tests for QEMU yank feature
+ *
+ * Copyright (c) Lukas Straub <lukasstraub2@web.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include <glib/gstdio.h>
+
+#include "qemu/config-file.h"
+#include "qemu/module.h"
+#include "qemu/option.h"
+#include "chardev/char-fe.h"
+#include "sysemu/sysemu.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-char.h"
+#include "qapi/qapi-types-char.h"
+#include "qapi/qapi-commands-yank.h"
+#include "qapi/qapi-types-yank.h"
+#include "io/channel-socket.h"
+#include "socket-helpers.h"
+
+typedef struct {
+    SocketAddress *addr;
+    bool old_yank;
+    bool new_yank;
+    bool fail;
+} CharChangeTestConfig;
+
+static int chardev_change(void *opaque)
+{
+    return 0;
+}
+
+static bool is_yank_instance_registered(void)
+{
+    YankInstanceList *list;
+    bool ret;
+
+    list = qmp_query_yank(&error_abort);
+
+    ret = !!list;
+
+    qapi_free_YankInstanceList(list);
+
+    return ret;
+}
+
+static void char_change_test(gconstpointer opaque)
+{
+    CharChangeTestConfig *conf = (gpointer) opaque;
+    SocketAddress *addr;
+    Chardev *chr;
+    CharBackend be;
+    ChardevReturn *ret;
+    QIOChannelSocket *ioc;
+
+    /*
+     * Setup a listener socket and determine its address
+     * so we know the TCP port for the client later
+     */
+    ioc = qio_channel_socket_new();
+    g_assert_nonnull(ioc);
+    qio_channel_socket_listen_sync(ioc, conf->addr, 1, &error_abort);
+    addr = qio_channel_socket_get_local_address(ioc, &error_abort);
+    g_assert_nonnull(addr);
+
+    ChardevBackend backend[2] = {
+        /* doesn't support yank */
+        { .type = CHARDEV_BACKEND_KIND_NULL },
+        /* supports yank */
+        {
+            .type = CHARDEV_BACKEND_KIND_SOCKET,
+            .u.socket.data = &(ChardevSocket) {
+                .addr = &(SocketAddressLegacy) {
+                    .type = SOCKET_ADDRESS_LEGACY_KIND_INET,
+                    .u.inet.data = &addr->u.inet
+                },
+                .has_server = true,
+                .server = false
+            }
+        } };
+
+    ChardevBackend fail_backend[2] = {
+        /* doesn't support yank */
+        {
+            .type = CHARDEV_BACKEND_KIND_UDP,
+            .u.udp.data = &(ChardevUdp) {
+                .remote = &(SocketAddressLegacy) {
+                    .type = SOCKET_ADDRESS_LEGACY_KIND_UNIX,
+                    .u.q_unix.data = &(UnixSocketAddress) {
+                        .path = (char *)""
+                    }
+                }
+            }
+        },
+        /* supports yank */
+        {
+            .type = CHARDEV_BACKEND_KIND_SOCKET,
+            .u.socket.data = &(ChardevSocket) {
+                .addr = &(SocketAddressLegacy) {
+                    .type = SOCKET_ADDRESS_LEGACY_KIND_INET,
+                    .u.inet.data = &(InetSocketAddress) {
+                        .host = (char *)"127.0.0.1",
+                        .port = (char *)"0"
+                    }
+                },
+                .has_server = true,
+                .server = false
+            }
+        } };
+
+    g_assert(!is_yank_instance_registered());
+
+    ret = qmp_chardev_add("chardev", &backend[conf->old_yank], &error_abort);
+    qapi_free_ChardevReturn(ret);
+    chr = qemu_chr_find("chardev");
+    g_assert_nonnull(chr);
+
+    g_assert(is_yank_instance_registered() == conf->old_yank);
+
+    qemu_chr_wait_connected(chr, &error_abort);
+    qemu_chr_fe_init(&be, chr, &error_abort);
+    /* allow chardev-change */
+    qemu_chr_fe_set_handlers(&be, NULL, NULL,
+                             NULL, chardev_change, NULL, NULL, true);
+
+    if (conf->fail) {
+        g_setenv("QTEST_SILENT_ERRORS", "1", 1);
+        ret = qmp_chardev_change("chardev", &fail_backend[conf->new_yank],
+                                 NULL);
+        g_assert_null(ret);
+        g_assert(be.chr == chr);
+        g_assert(is_yank_instance_registered() == conf->old_yank);
+        g_unsetenv("QTEST_SILENT_ERRORS");
+    } else {
+        ret = qmp_chardev_change("chardev", &backend[conf->new_yank],
+                                 &error_abort);
+        g_assert_nonnull(ret);
+        g_assert(be.chr != chr);
+        g_assert(is_yank_instance_registered() == conf->new_yank);
+    }
+
+    object_unparent(OBJECT(be.chr));
+    object_unref(OBJECT(ioc));
+    qapi_free_ChardevReturn(ret);
+    qapi_free_SocketAddress(addr);
+}
+
+static SocketAddress tcpaddr = {
+    .type = SOCKET_ADDRESS_TYPE_INET,
+    .u.inet.host = (char *)"127.0.0.1",
+    .u.inet.port = (char *)"0",
+};
+
+int main(int argc, char **argv)
+{
+    bool has_ipv4, has_ipv6;
+
+    qemu_init_main_loop(&error_abort);
+    socket_init();
+
+    g_test_init(&argc, &argv, NULL);
+
+    if (socket_check_protocol_support(&has_ipv4, &has_ipv6) < 0) {
+        g_printerr("socket_check_protocol_support() failed\n");
+        goto end;
+    }
+
+    if (!has_ipv4) {
+        goto end;
+    }
+
+    module_call_init(MODULE_INIT_QOM);
+    qemu_add_opts(&qemu_chardev_opts);
+
+#define CHAR_CHANGE_TEST(name, _old_yank, _new_yank)                           \
+        g_test_add_data_func("/yank/char_change/success/" # name,              \
+                             &(CharChangeTestConfig) { .addr = &tcpaddr,       \
+                                                       .old_yank = (_old_yank),\
+                                                       .new_yank = (_new_yank),\
+                                                       .fail = false },        \
+                             char_change_test);                                \
+        g_test_add_data_func("/yank/char_change/fail/" # name,                 \
+                             &(CharChangeTestConfig) { .addr = &tcpaddr,       \
+                                                       .old_yank = (_old_yank),\
+                                                       .new_yank = (_new_yank),\
+                                                       .fail = true },         \
+                             char_change_test);
+
+    CHAR_CHANGE_TEST(to_yank, false, true);
+    CHAR_CHANGE_TEST(yank_to_yank, true, true);
+    CHAR_CHANGE_TEST(from_yank, true, false);
+
+end:
+    return g_test_run();
+}
diff --git a/MAINTAINERS b/MAINTAINERS
index dcab656e62..aa894767dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2823,6 +2823,7 @@ M: Lukas Straub <lukasstraub2@web.de>
 S: Odd fixes
 F: util/yank.c
 F: migration/yank_functions*
+F: tests/unit/test-yank.c
 F: include/qemu/yank.h
 F: qapi/yank.json
 
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 4bfe4627ba..b3bc2109da 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -123,7 +123,8 @@ if have_system
     'test-util-sockets': ['socket-helpers.c'],
     'test-base64': [],
     'test-bufferiszero': [],
-    'test-vmstate': [migration, io]
+    'test-vmstate': [migration, io],
+    'test-yank': ['socket-helpers.c', qom, io, chardev]
   }
   if 'CONFIG_INOTIFY1' in config_host
     tests += {'test-util-filemonitor': []}
-- 
2.29.0



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (9 preceding siblings ...)
  2021-03-28 18:45 ` [PULL 10/10] tests: Add tests for " marcandre.lureau
@ 2021-03-28 19:00 ` no-reply
  2021-03-29 13:53 ` Peter Maydell
  11 siblings, 0 replies; 21+ messages in thread
From: no-reply @ 2021-03-28 19:00 UTC (permalink / raw)
  To: marcandre.lureau; +Cc: peter.maydell, qemu-devel, marcandre.lureau

Patchew URL: https://patchew.org/QEMU/20210328184533.752840-1-marcandre.lureau@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210328184533.752840-1-marcandre.lureau@redhat.com
Subject: [PULL 00/10] For 6.0 patches

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210328184533.752840-1-marcandre.lureau@redhat.com -> patchew/20210328184533.752840-1-marcandre.lureau@redhat.com
Switched to a new branch 'test'
cd52ca9 tests: Add tests for yank with the chardev-change case
442c7e4 chardev: Fix yank with the chardev-change case
fa90829 chardev/char.c: Always pass id to chardev_new
0ee1fbc chardev/char.c: Move object_property_try_add_child out of chardev_new
0bb8f82 yank: Always link full yank code
6bcc10f yank: Remove dependency on qiochannel
a15a59f docs: simplify each section title
cfd08be sphinx: adopt kernel readthedoc theme
0295885 dbus-vmstate: Increase the size of input stream buffer used during load
8e43270 util: fix use-after-free in module_load_one

=== OUTPUT BEGIN ===
1/10 Checking commit 8e43270ef1f8 (util: fix use-after-free in module_load_one)
2/10 Checking commit 029588549aba (dbus-vmstate: Increase the size of input stream buffer used during load)
3/10 Checking commit cfd08be5e0ab (sphinx: adopt kernel readthedoc theme)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#44: 
deleted file mode 100644

total: 0 errors, 1 warnings, 283 lines checked

Patch 3/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/10 Checking commit a15a59f66a52 (docs: simplify each section title)
5/10 Checking commit 6bcc10f20e5a (yank: Remove dependency on qiochannel)
6/10 Checking commit 0bb8f82e839a (yank: Always link full yank code)
7/10 Checking commit 0ee1fbce3458 (chardev/char.c: Move object_property_try_add_child out of chardev_new)
8/10 Checking commit fa9082938228 (chardev/char.c: Always pass id to chardev_new)
9/10 Checking commit 442c7e4ebee8 (chardev: Fix yank with the chardev-change case)
10/10 Checking commit cd52ca9c1c1d (tests: Add tests for yank with the chardev-change case)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#231: FILE: tests/unit/test-yank.c:180:
+#define CHAR_CHANGE_TEST(name, _old_yank, _new_yank)                           \
+        g_test_add_data_func("/yank/char_change/success/" # name,              \
+                             &(CharChangeTestConfig) { .addr = &tcpaddr,       \
+                                                       .old_yank = (_old_yank),\
+                                                       .new_yank = (_new_yank),\
+                                                       .fail = false },        \
+                             char_change_test);                                \
+        g_test_add_data_func("/yank/char_change/fail/" # name,                 \
+                             &(CharChangeTestConfig) { .addr = &tcpaddr,       \
+                                                       .old_yank = (_old_yank),\
+                                                       .new_yank = (_new_yank),\
+                                                       .fail = true },         \
+                             char_change_test);

total: 1 errors, 0 warnings, 216 lines checked

Patch 10/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210328184533.752840-1-marcandre.lureau@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
                   ` (10 preceding siblings ...)
  2021-03-28 19:00 ` [PULL 00/10] For 6.0 patches no-reply
@ 2021-03-29 13:53 ` Peter Maydell
  2021-03-29 14:16   ` Marc-André Lureau
  11 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-03-29 13:53 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: QEMU Developers

On Sun, 28 Mar 2021 at 19:45, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The following changes since commit 7b9a3c9f94bcac23c534bc9f42a9e914b433b299:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/fixes-20210326-pull-request' into staging (2021-03-26 12:58:58 +0000)
>
> are available in the Git repository at:
>
>   git@gitlab.com:marcandre.lureau/qemu.git tags/for-6.0-pull-request
>
> for you to fetch changes up to f57d44b452e11d8b7c9743476c30a8d0f80926de:
>
>   tests: Add tests for yank with the chardev-change case (2021-03-27 13:57:40 +0400)
>
> ----------------------------------------------------------------
> For 6.0 misc patches under my radar.
>
> Peter, let me know if you would rather split that PR.
>
> ----------------------------------------------------------------

This produces a backtrace from sphinx-build which nonetheless doesn't
cause a build failure:


Program sphinx-build found: YES
../docs/meson.build:30: WARNING: /usr/bin/sphinx-build:
Configuration error:
There is a programable error in your configuration file:

Traceback (most recent call last):
  File "conf.py", line 154, in <module>
    import sphinx_rtd_theme
ModuleNotFoundError: No module named 'sphinx_rtd_theme'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/config.py", line 157, in __init__
    execfile_(filename, config)
  File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line
150, in execfile_
    exec_(code, _globals)
  File "conf.py", line 157, in <module>
    'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
sphinx.errors.ConfigError: The Sphinx 'sphinx_rtd_theme' HTML theme
was not found.



Program python3 found: YES (/usr/bin/python3)


In particular I see that on all the BSD VMs. If we're going to
require rtd that means we need to ensure it's present on all
the VM configs, docker configs, everything the CI uses, etc.
You should also flag up new build-deps in the pullreq cover
letter.

I dunno if we can get the error message neater (I know sphinx-build,
especially older versions, is a bit unhelpful about what it lets us
report.)

The test-yank stuff also failed on OSX:

Unexpected error in inet_connect_addr() at ../../util/qemu-sockets.c:380:
Failed to connect to '127.0.0.1:63820': Operation timed out
ERROR test-yank - too few tests run (expected 6, got 1)


thanks
-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 13:53 ` Peter Maydell
@ 2021-03-29 14:16   ` Marc-André Lureau
  2021-03-29 15:56     ` Peter Maydell
  2021-03-29 16:26     ` Lukas Straub
  0 siblings, 2 replies; 21+ messages in thread
From: Marc-André Lureau @ 2021-03-29 14:16 UTC (permalink / raw)
  To: Peter Maydell, Lukas Straub; +Cc: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 3373 bytes --]

Hi

On Mon, Mar 29, 2021 at 5:54 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Sun, 28 Mar 2021 at 19:45, <marcandre.lureau@redhat.com> wrote:
> >
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > The following changes since commit
> 7b9a3c9f94bcac23c534bc9f42a9e914b433b299:
> >
> >   Merge remote-tracking branch
> 'remotes/kraxel/tags/fixes-20210326-pull-request' into staging (2021-03-26
> 12:58:58 +0000)
> >
> > are available in the Git repository at:
> >
> >   git@gitlab.com:marcandre.lureau/qemu.git tags/for-6.0-pull-request
> >
> > for you to fetch changes up to f57d44b452e11d8b7c9743476c30a8d0f80926de:
> >
> >   tests: Add tests for yank with the chardev-change case (2021-03-27
> 13:57:40 +0400)
> >
> > ----------------------------------------------------------------
> > For 6.0 misc patches under my radar.
> >
> > Peter, let me know if you would rather split that PR.
> >
> > ----------------------------------------------------------------
>
> This produces a backtrace from sphinx-build which nonetheless doesn't
> cause a build failure:
>
>
> Program sphinx-build found: YES
> ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build:
> Configuration error:
> There is a programable error in your configuration file:
>
> Traceback (most recent call last):
>   File "conf.py", line 154, in <module>
>     import sphinx_rtd_theme
> ModuleNotFoundError: No module named 'sphinx_rtd_theme'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/sphinx/config.py", line 157, in
> __init__
>     execfile_(filename, config)
>   File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line
> 150, in execfile_
>     exec_(code, _globals)
>   File "conf.py", line 157, in <module>
>     'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
> sphinx.errors.ConfigError: The Sphinx 'sphinx_rtd_theme' HTML theme
> was not found.
>
>

../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
Configuration error:
The Sphinx 'sphinx_rtd_theme' HTML theme was not found.

../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3
version of python-sphinx and the readthedoc theme

It's only fatal if you explicitely enabled docs. Otherwise, it just prints
a warning and disable it (just like sphinx 3.6 version requirement).


>
>
> Program python3 found: YES (/usr/bin/python3)
>
>
> In particular I see that on all the BSD VMs. If we're going to
> require rtd that means we need to ensure it's present on all
> the VM configs, docker configs, everything the CI uses, etc.
> You should also flag up new build-deps in the pullreq cover
> letter.
>

I updated all docker configs. We don't have sphinx in the BSD VMs
apparently, am I wrong?


> I dunno if we can get the error message neater (I know sphinx-build,
> especially older versions, is a bit unhelpful about what it lets us
> report.)
>
> The test-yank stuff also failed on OSX:
>
> Unexpected error in inet_connect_addr() at ../../util/qemu-sockets.c:380:
> Failed to connect to '127.0.0.1:63820': Operation timed out
> ERROR test-yank - too few tests run (expected 6, got 1)
>
>
Lukas, can you have a look too?

thanks

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 4727 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 14:16   ` Marc-André Lureau
@ 2021-03-29 15:56     ` Peter Maydell
  2021-03-29 16:30       ` Marc-André Lureau
  2021-03-29 16:26     ` Lukas Straub
  1 sibling, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-03-29 15:56 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Lukas Straub, QEMU Developers

On Mon, 29 Mar 2021 at 15:17, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Mon, Mar 29, 2021 at 5:54 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> This produces a backtrace from sphinx-build which nonetheless doesn't
>> cause a build failure:
>>
>>
>> Program sphinx-build found: YES
>> ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build:
>> Configuration error:
>> There is a programable error in your configuration file:
>>
>> Traceback (most recent call last):
>>   File "conf.py", line 154, in <module>
>>     import sphinx_rtd_theme
>> ModuleNotFoundError: No module named 'sphinx_rtd_theme'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/usr/lib/python3/dist-packages/sphinx/config.py", line 157, in __init__
>>     execfile_(filename, config)
>>   File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line
>> 150, in execfile_
>>     exec_(code, _globals)
>>   File "conf.py", line 157, in <module>
>>     'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
>> sphinx.errors.ConfigError: The Sphinx 'sphinx_rtd_theme' HTML theme
>> was not found.
>>
>
>
> ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
> Configuration error:
> The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
>
> ../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3 version of python-sphinx and the readthedoc theme


So why do you get that message, and I see the above? Older
sphinx-build ?

Also, if this isn't fatal (the build does continue), meson
shouldn't print ERROR here, ideally.

>> Program python3 found: YES (/usr/bin/python3)
>>
>>
>> In particular I see that on all the BSD VMs. If we're going to
>> require rtd that means we need to ensure it's present on all
>> the VM configs, docker configs, everything the CI uses, etc.
>> You should also flag up new build-deps in the pullreq cover
>> letter.
>
>
> I updated all docker configs. We don't have sphinx in the BSD VMs apparently, am I wrong?

We must do, because trying to build this merge in the VMs produces
errors from sphinx-build...

-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 14:16   ` Marc-André Lureau
  2021-03-29 15:56     ` Peter Maydell
@ 2021-03-29 16:26     ` Lukas Straub
  1 sibling, 0 replies; 21+ messages in thread
From: Lukas Straub @ 2021-03-29 16:26 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Peter Maydell, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

On Mon, 29 Mar 2021 18:16:59 +0400
Marc-André Lureau <marcandre.lureau@gmail.com> wrote:

> Hi
> 
> On Mon, Mar 29, 2021 at 5:54 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
> > [...]
> >
> > I dunno if we can get the error message neater (I know sphinx-build,
> > especially older versions, is a bit unhelpful about what it lets us
> > report.)
> >
> > The test-yank stuff also failed on OSX:
> >
> > Unexpected error in inet_connect_addr() at ../../util/qemu-sockets.c:380:
> > Failed to connect to '127.0.0.1:63820': Operation timed out
> > ERROR test-yank - too few tests run (expected 6, got 1)
> >
> >  
> Lukas, can you have a look too?

I guess OSX is waiting for a accept() from the other side (I have no OSX here
to test though). I'll fix it.

Regards,
Lukas Straub

-- 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 15:56     ` Peter Maydell
@ 2021-03-29 16:30       ` Marc-André Lureau
  2021-03-29 17:54         ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Marc-André Lureau @ 2021-03-29 16:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Lukas Straub, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]

Hi

On Mon, Mar 29, 2021 at 7:56 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Mon, 29 Mar 2021 at 15:17, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> >
> > Hi
> >
> > On Mon, Mar 29, 2021 at 5:54 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >>
> >> This produces a backtrace from sphinx-build which nonetheless doesn't
> >> cause a build failure:
> >>
> >>
> >> Program sphinx-build found: YES
> >> ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build:
> >> Configuration error:
> >> There is a programable error in your configuration file:
> >>
> >> Traceback (most recent call last):
> >>   File "conf.py", line 154, in <module>
> >>     import sphinx_rtd_theme
> >> ModuleNotFoundError: No module named 'sphinx_rtd_theme'
> >>
> >> During handling of the above exception, another exception occurred:
> >>
> >> Traceback (most recent call last):
> >>   File "/usr/lib/python3/dist-packages/sphinx/config.py", line 157, in
> __init__
> >>     execfile_(filename, config)
> >>   File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line
> >> 150, in execfile_
> >>     exec_(code, _globals)
> >>   File "conf.py", line 157, in <module>
> >>     'The Sphinx \'sphinx_rtd_theme\' HTML theme was not found.\n'
> >> sphinx.errors.ConfigError: The Sphinx 'sphinx_rtd_theme' HTML theme
> >> was not found.
> >>
> >
> >
> > ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
> > Configuration error:
> > The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
> >
> > ../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3
> version of python-sphinx and the readthedoc theme
>
>
> So why do you get that message, and I see the above? Older
> sphinx-build ?
>


It's strange, it's like ModuleNotFoundError was not catched by the "except
ImportError".

What's the version of python?


> Also, if this isn't fatal (the build does continue), meson
> shouldn't print ERROR here, ideally.
>

Something is again unexpected here.

If you have the meson error, it should stop the build there with an error.
And the error is only raised when docs is enabled.

For me it doesn't continue:
$ make
...
../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3
version of python-sphinx and the readthedoc theme

A full log can be found at
/home/elmarco/src/qemu/build/meson-logs/meson-log.txt
ninja: error: rebuilding 'build.ninja': subcommand failed
FAILED: build.ninja
/usr/bin/meson --internal regenerate /home/elmarco/src/qemu
/home/elmarco/src/qemu/build --backend ninja
make: *** [Makefile:152: run-ninja] Error 1



> >> Program python3 found: YES (/usr/bin/python3)
> >>
> >>
> >> In particular I see that on all the BSD VMs. If we're going to
> >> require rtd that means we need to ensure it's present on all
> >> the VM configs, docker configs, everything the CI uses, etc.
> >> You should also flag up new build-deps in the pullreq cover
> >> letter.
> >
> >
> > I updated all docker configs. We don't have sphinx in the BSD VMs
> apparently, am I wrong?
>
> We must do, because trying to build this merge in the VMs produces
> errors from sphinx-build...
>
>
I am trying to reproduce.. I tried with  vm-build-openbsd, but it reaches
console read timeout error... Now trying with freebsd (looking for a mirror
for iso, because 40kb/s atm for me)

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 5003 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 16:30       ` Marc-André Lureau
@ 2021-03-29 17:54         ` Peter Maydell
  2021-03-30  8:29           ` Marc-André Lureau
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-03-29 17:54 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Lukas Straub, QEMU Developers

On Mon, 29 Mar 2021 at 17:30, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Mon, Mar 29, 2021 at 7:56 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On Mon, 29 Mar 2021 at 15:17, Marc-André Lureau
>> <marcandre.lureau@gmail.com> wrote:
>> > ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
>> > Configuration error:
>> > The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
>> >
>> > ../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3 version of python-sphinx and the readthedoc theme
>>
>>
>> So why do you get that message, and I see the above? Older
>> sphinx-build ?
>
>
>
> It's strange, it's like ModuleNotFoundError was not catched by the "except ImportError".
>
> What's the version of python?

It's whatever's in the BSD VMs. I also saw the same error on the
aarch64 CI machine, which has python 3.8.5 and sphinx-build 1.8.5.
My guess is that it might be the sphinx-build version here. I vaguely
recall that Sphinx is kind of picky about exceptions within the conf
file but that there was a change in what it allowed at some point.
It's possible we just can't do much with the old versions.

I'm inclined to suggest we should postpone switching to the rtd theme
until after the 6.0 release -- there isn't a strong need to get it
in this release, is there ?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-29 17:54         ` Peter Maydell
@ 2021-03-30  8:29           ` Marc-André Lureau
  2021-03-30 12:11             ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Marc-André Lureau @ 2021-03-30  8:29 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Lukas Straub, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]

Hi

On Mon, Mar 29, 2021 at 9:54 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Mon, 29 Mar 2021 at 17:30, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> >
> > Hi
> >
> > On Mon, Mar 29, 2021 at 7:56 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >>
> >> On Mon, 29 Mar 2021 at 15:17, Marc-André Lureau
> >> <marcandre.lureau@gmail.com> wrote:
> >> > ../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
> >> > Configuration error:
> >> > The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
> >> >
> >> > ../docs/meson.build:32:6: ERROR: Problem encountered: Install a
> Python 3 version of python-sphinx and the readthedoc theme
> >>
> >>
> >> So why do you get that message, and I see the above? Older
> >> sphinx-build ?
> >
> >
> >
> > It's strange, it's like ModuleNotFoundError was not catched by the
> "except ImportError".
> >
> > What's the version of python?
>
> It's whatever's in the BSD VMs. I also saw the same error on the
>

I built successfully with  vm-build-openbsd, vm-build-freebsd, and
vm-build-netbsd. None have sphinx installed, thus simply print:
Program sphinx-build-3 sphinx-build found: NO

Am I missing something?

aarch64 CI machine, which has python 3.8.5 and sphinx-build 1.8.5.
> My guess is that it might be the sphinx-build version here. I vaguely
> recall that Sphinx is kind of picky about exceptions within the conf
> file but that there was a change in what it allowed at some point.
> It's possible we just can't do much with the old versions.
>

How do you run the build? Running make from an existing configured or build
state? If so, I have seen sphinx errors that don't stop the build (and
actually building the docs without sphinx-rtd). I don't know why this
happens, "regenerate"/reconfigure errors should stop the build.

It seems like a minor issue to me. A clean build will error correctly.


> I'm inclined to suggest we should postpone switching to the rtd theme
> until after the 6.0 release -- there isn't a strong need to get it
> in this release, is there ?
>
>
There is no hurry, but let's try to make some progress. If it's ready, I'll
let you decide if this is acceptable during freeze period or not.

Now I am not sure what should be fixed... I will try to find the cause of
the non-fatal error on incremental build.

thanks

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 3726 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-30  8:29           ` Marc-André Lureau
@ 2021-03-30 12:11             ` Peter Maydell
  2021-03-30 14:36               ` Marc-André Lureau
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2021-03-30 12:11 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Lukas Straub, QEMU Developers

On Tue, 30 Mar 2021 at 09:29, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Mon, Mar 29, 2021 at 9:54 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>> aarch64 CI machine, which has python 3.8.5 and sphinx-build 1.8.5.
>> My guess is that it might be the sphinx-build version here. I vaguely
>> recall that Sphinx is kind of picky about exceptions within the conf
>> file but that there was a change in what it allowed at some point.
>> It's possible we just can't do much with the old versions.
>
>
> How do you run the build? Running make from an existing configured or build state? If so, I have seen sphinx errors that don't stop the build (and actually building the docs without sphinx-rtd). I don't know why this happens, "regenerate"/reconfigure errors should stop the build.

On that machine, yes, it's an incremental build.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PULL 00/10] For 6.0 patches
  2021-03-30 12:11             ` Peter Maydell
@ 2021-03-30 14:36               ` Marc-André Lureau
  0 siblings, 0 replies; 21+ messages in thread
From: Marc-André Lureau @ 2021-03-30 14:36 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Lukas Straub, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]

Hi

On Tue, Mar 30, 2021 at 4:12 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Tue, 30 Mar 2021 at 09:29, Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> >
> > Hi
> >
> > On Mon, Mar 29, 2021 at 9:54 PM Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >> aarch64 CI machine, which has python 3.8.5 and sphinx-build 1.8.5.
> >> My guess is that it might be the sphinx-build version here. I vaguely
> >> recall that Sphinx is kind of picky about exceptions within the conf
> >> file but that there was a change in what it allowed at some point.
> >> It's possible we just can't do much with the old versions.
> >
> >
> > How do you run the build? Running make from an existing configured or
> build state? If so, I have seen sphinx errors that don't stop the build
> (and actually building the docs without sphinx-rtd). I don't know why this
> happens, "regenerate"/reconfigure errors should stop the build.
>
> On that machine, yes, it's an incremental build.
>
>
Could you check if --enable-docs was enabled? It turns out I wasn't always
checking things properly, and it works as expected for me. Without the rtd
theme installed and:

- Without --enable-docs,

./docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
Configuration error:
The Sphinx 'sphinx_rtd_theme' HTML theme was not found.

On incremental build, extra warnings and the build continues, disabling
docs as necessary.

- With --enable-docs,

../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
Configuration error:
The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3
version of python-sphinx and the readthedoc theme

A full log can be found at
/home/elmarco/src/qemu/build/meson-logs/meson-log.txt

ERROR: meson setup failed



On incremental build, it correctly stops:

../docs/meson.build:30: WARNING: /usr/bin/sphinx-build-3:
Configuration error:
The Sphinx 'sphinx_rtd_theme' HTML theme was not found.
../docs/meson.build:32:6: ERROR: Problem encountered: Install a Python 3
version of python-sphinx and the readthedoc theme
A full log can be found at
/home/elmarco/src/qemu/build/meson-logs/meson-log.txt
ninja: error: FAILED: build.ninja
/usr/bin/meson --internal regenerate /home/elmarco/src/qemu
/home/elmarco/src/qemu/build --backend ninja
rebuilding 'build.ninja': subcommand failed
make: *** [Makefile:152: run-ninja] Error 1


-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 3409 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-03-30 14:41 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 18:45 [PULL 00/10] For 6.0 patches marcandre.lureau
2021-03-28 18:45 ` [PULL 01/10] util: fix use-after-free in module_load_one marcandre.lureau
2021-03-28 18:45 ` [PULL 02/10] dbus-vmstate: Increase the size of input stream buffer used during load marcandre.lureau
2021-03-28 18:45 ` [PULL 03/10] sphinx: adopt kernel readthedoc theme marcandre.lureau
2021-03-28 18:45 ` [PULL 04/10] docs: simplify each section title marcandre.lureau
2021-03-28 18:45 ` [PULL 05/10] yank: Remove dependency on qiochannel marcandre.lureau
2021-03-28 18:45 ` [PULL 06/10] yank: Always link full yank code marcandre.lureau
2021-03-28 18:45 ` [PULL 07/10] chardev/char.c: Move object_property_try_add_child out of chardev_new marcandre.lureau
2021-03-28 18:45 ` [PULL 08/10] chardev/char.c: Always pass id to chardev_new marcandre.lureau
2021-03-28 18:45 ` [PULL 09/10] chardev: Fix yank with the chardev-change case marcandre.lureau
2021-03-28 18:45 ` [PULL 10/10] tests: Add tests for " marcandre.lureau
2021-03-28 19:00 ` [PULL 00/10] For 6.0 patches no-reply
2021-03-29 13:53 ` Peter Maydell
2021-03-29 14:16   ` Marc-André Lureau
2021-03-29 15:56     ` Peter Maydell
2021-03-29 16:30       ` Marc-André Lureau
2021-03-29 17:54         ` Peter Maydell
2021-03-30  8:29           ` Marc-André Lureau
2021-03-30 12:11             ` Peter Maydell
2021-03-30 14:36               ` Marc-André Lureau
2021-03-29 16:26     ` Lukas Straub

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.