qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 605a16: virtio: Add shared memory capability


From: Alex Bennée
Subject: [Qemu-commits] [qemu/qemu] 605a16: virtio: Add shared memory capability
Date: Tue, 17 Oct 2023 12:04:15 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 605a16a7621c139f7e112538d7773bb60108cef7
      
https://github.com/qemu/qemu/commit/605a16a7621c139f7e112538d7773bb60108cef7
  Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/virtio/virtio-pci.c
    M include/hw/virtio/virtio-pci.h

  Log Message:
  -----------
  virtio: Add shared memory capability

Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow
defining shared memory regions with sizes and offsets of 2^32 and more.
Multiple instances of the capability are allowed and distinguished
by a device-specific 'id'.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Huang Rui <ray.huang@amd.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: 17b98f46b97037d7390057bc0dc5d2c579599c12
      
https://github.com/qemu/qemu/commit/17b98f46b97037d7390057bc0dc5d2c579599c12
  Author: Antonio Caggiano <antonio.caggiano@collabora.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/display/virtio-gpu-base.c
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  virtio-gpu: CONTEXT_INIT feature

The feature can be enabled when a backend wants it.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Huang Rui <ray.huang@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: ba62dfa7075c72ec9506ea461a41e8e2a545c692
      
https://github.com/qemu/qemu/commit/ba62dfa7075c72ec9506ea461a41e8e2a545c692
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/display/virtio-gpu-pci.c
    M hw/display/virtio-gpu.c
    M hw/display/virtio-vga.c
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  virtio-gpu: hostmem

Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Huang Rui <ray.huang@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: 49a8b659324fe105aaa8ed6d83c742ebace9b932
      
https://github.com/qemu/qemu/commit/49a8b659324fe105aaa8ed6d83c742ebace9b932
  Author: Antonio Caggiano <antonio.caggiano@collabora.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/display/virtio-gpu.c
    M include/hw/virtio/virtio-gpu-bswap.h
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  virtio-gpu: blob prep

This adds preparatory functions needed to:

     - decode blob cmds
     - tracking iovecs

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Huang Rui <ray.huang@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: ac8767c7436b1328a4173b032d61f1f53f369d9b
      
https://github.com/qemu/qemu/commit/ac8767c7436b1328a4173b032d61f1f53f369d9b
  Author: Gurchetan Singh <gurchetansingh@chromium.org>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  gfxstream + rutabaga prep: added need defintions, fields, and options

This modifies the common virtio-gpu.h file have the fields and
defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: 1dcc6adbc168366ece9b7fa3b68a96b475ed4ba8
      
https://github.com/qemu/qemu/commit/1dcc6adbc168366ece9b7fa3b68a96b475ed4ba8
  Author: Gurchetan Singh <gurchetansingh@chromium.org>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    A hw/display/virtio-gpu-pci-rutabaga.c
    A hw/display/virtio-gpu-rutabaga.c
    A hw/display/virtio-vga-rutabaga.c

  Log Message:
  -----------
  gfxstream + rutabaga: add initial support for gfxstream

This adds initial support for gfxstream and cross-domain.  Both
features rely on virtio-gpu blob resources and context types, which
are also implemented in this patch.

gfxstream has a long and illustrious history in Android graphics
paravirtualization.  It has been powering graphics in the Android
Studio Emulator for more than a decade, which is the main developer
platform.

Originally conceived by Jesse Hall, it was first known as "EmuGL" [a].
The key design characteristic was a 1:1 threading model and
auto-generation, which fit nicely with the OpenGLES spec.  It also
allowed easy layering with ANGLE on the host, which provides the GLES
implementations on Windows or MacOS enviroments.

gfxstream has traditionally been maintained by a single engineer, and
between 2015 to 2021, the goldfish throne passed to Frank Yang.
Historians often remark this glorious reign ("pax gfxstreama" is the
academic term) was comparable to that of Augustus and both Queen
Elizabeths.  Just to name a few accomplishments in a resplendent
panoply: higher versions of GLES, address space graphics, snapshot
support and CTS compliant Vulkan [b].

One major drawback was the use of out-of-tree goldfish drivers.
Android engineers didn't know much about DRM/KMS and especially TTM so
a simple guest to host pipe was conceived.

Luckily, virtio-gpu 3D started to emerge in 2016 due to the work of
the Mesa/virglrenderer communities.  In 2018, the initial virtio-gpu
port of gfxstream was done by Cuttlefish enthusiast Alistair Delva.
It was a symbol compatible replacement of virglrenderer [c] and named
"AVDVirglrenderer".  This implementation forms the basis of the
current gfxstream host implementation still in use today.

cross-domain support follows a similar arc.  Originally conceived by
Wayland aficionado David Reveman and crosvm enjoyer Zach Reizner in
2018, it initially relied on the downstream "virtio-wl" device.

In 2020 and 2021, virtio-gpu was extended to include blob resources
and multiple timelines by yours truly, features gfxstream/cross-domain
both require to function correctly.

Right now, we stand at the precipice of a truly fantastic possibility:
the Android Emulator powered by upstream QEMU and upstream Linux
kernel.  gfxstream will then be packaged properfully, and app
developers can even fix gfxstream bugs on their own if they encounter
them.

It's been quite the ride, my friends.  Where will gfxstream head next,
nobody really knows.  I wouldn't be surprised if it's around for
another decade, maintained by a new generation of Android graphics
enthusiasts.

Technical details:
  - Very simple initial display integration: just used Pixman
  - Largely, 1:1 mapping of virtio-gpu hypercalls to rutabaga function
    calls

Next steps for Android VMs:
  - The next step would be improving display integration and UI interfaces
    with the goal of the QEMU upstream graphics being in an emulator
    release [d].

Next steps for Linux VMs for display virtualization:
  - For widespread distribution, someone needs to package Sommelier or the
    wayland-proxy-virtwl [e] ideally into Debian main. In addition, newer
    versions of the Linux kernel come with DRM_VIRTIO_GPU_KMS option,
    which allows disabling KMS hypercalls.  If anyone cares enough, it'll
    probably be possible to build a custom VM variant that uses this display
    virtualization strategy.

[a] https://android-review.googlesource.com/c/platform/development/+/34470
[b] 
https://android-review.googlesource.com/q/topic:%22vulkan-hostconnection-start%22
[c] 
https://android-review.googlesource.com/c/device/generic/goldfish-opengl/+/761927
[d] https://developer.android.com/studio/releases/emulator
[e] https://github.com/talex5/wayland-proxy-virtwl

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: cd9adbefcc6fd9bf61dcebc20dbc2507bfaebc08
      
https://github.com/qemu/qemu/commit/cd9adbefcc6fd9bf61dcebc20dbc2507bfaebc08
  Author: Gurchetan Singh <gurchetansingh@chromium.org>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/display/meson.build
    M meson.build
    M meson_options.txt
    M scripts/meson-buildoptions.sh

  Log Message:
  -----------
  gfxstream + rutabaga: meson support

- Add meson detection of rutabaga_gfx
- Build virtio-gpu-rutabaga.c + associated vga/pci files when
  present

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: 8e7b21ca16cb1109faff5cbc6a12dc5f7f4e09c1
      
https://github.com/qemu/qemu/commit/8e7b21ca16cb1109faff5cbc6a12dc5f7f4e09c1
  Author: Gurchetan Singh <gurchetansingh@chromium.org>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M hw/display/virtio-gpu-base.c
    M hw/display/virtio-gpu.c
    M system/qdev-monitor.c
    M system/vl.c

  Log Message:
  -----------
  gfxstream + rutabaga: enable rutabaga

This change enables rutabaga to receive virtio-gpu-3d hypercalls
when it is active.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: 773f61e997d4f12cacb715bf8ec01bf0a40e8755
      
https://github.com/qemu/qemu/commit/773f61e997d4f12cacb715bf8ec01bf0a40e8755
  Author: Gurchetan Singh <gurchetansingh@chromium.org>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M docs/system/device-emulation.rst
    A docs/system/devices/virtio-gpu.rst

  Log Message:
  -----------
  docs/system: add basic virtio-gpu documentation

This adds basic documentation for virtio-gpu.

Suggested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Antonio Caggiano <quic_acaggian@quicinc.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>


  Commit: d7f5a04320187b94664539fc3aa9a87c9381a025
      
https://github.com/qemu/qemu/commit/d7f5a04320187b94664539fc3aa9a87c9381a025
  Author: Wei Wang <wei.w.wang@intel.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: refactor migration_completion

Current migration_completion function is a bit long. Refactor the long
implementation into different subfunctions:
- migration_completion_precopy: completion code related to precopy
- migration_completion_postcopy: completion code related to postcopy

Rename await_return_path_close_on_source to
close_return_path_on_source: It is renamed to match with
open_return_path_on_source.

This improves readability and is easier for future updates (e.g. add new
subfunctions when completion code related to new features are needed). No
functional changes intended.

Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230804093053.5037-1-wei.w.wang@intel.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 1a36e4c9d040cb053efa10721eb4e45dcf6a321d
      
https://github.com/qemu/qemu/commit/1a36e4c9d040cb053efa10721eb4e45dcf6a321d
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Use g_autofree to simplify ram_dirty_bitmap_reload()

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011023627.86691-1-philmd@linaro.org>


  Commit: 8b2395970aa3beab91b98dda89c7ed471e65ad25
      
https://github.com/qemu/qemu/commit/8b2395970aa3beab91b98dda89c7ed471e65ad25
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/migration-hmp-cmds.c
    M migration/migration.c
    M migration/migration.h
    M migration/options.c
    M migration/options.h
    M migration/trace-events
    M qapi/migration.json

  Log Message:
  -----------
  migration: Allow user to specify available switchover bandwidth

Migration bandwidth is a very important value to live migration.  It's
because it's one of the major factors that we'll make decision on when to
switchover to destination in a precopy process.

This value is currently estimated by QEMU during the whole live migration
process by monitoring how fast we were sending the data.  This can be the
most accurate bandwidth if in the ideal world, where we're always feeding
unlimited data to the migration channel, and then it'll be limited to the
bandwidth that is available.

However in reality it may be very different, e.g., over a 10Gbps network we
can see query-migrate showing migration bandwidth of only a few tens of
MB/s just because there are plenty of other things the migration thread
might be doing.  For example, the migration thread can be busy scanning
zero pages, or it can be fetching dirty bitmap from other external dirty
sources (like vhost or KVM).  It means we may not be pushing data as much
as possible to migration channel, so the bandwidth estimated from "how many
data we sent in the channel" can be dramatically inaccurate sometimes.

With that, the decision to switchover will be affected, by assuming that we
may not be able to switchover at all with such a low bandwidth, but in
reality we can.

The migration may not even converge at all with the downtime specified,
with that wrong estimation of bandwidth, keeping iterations forever with a
low estimation of bandwidth.

The issue is QEMU itself may not be able to avoid those uncertainties on
measuing the real "available migration bandwidth".  At least not something
I can think of so far.

One way to fix this is when the user is fully aware of the available
bandwidth, then we can allow the user to help providing an accurate value.

For example, if the user has a dedicated channel of 10Gbps for migration
for this specific VM, the user can specify this bandwidth so QEMU can
always do the calculation based on this fact, trusting the user as long as
specified.  It may not be the exact bandwidth when switching over (in which
case qemu will push migration data as fast as possible), but much better
than QEMU trying to wildly guess, especially when very wrong.

A new parameter "avail-switchover-bandwidth" is introduced just for this.
So when the user specified this parameter, instead of trusting the
estimated value from QEMU itself (based on the QEMUFile send speed), it
trusts the user more by using this value to decide when to switchover,
assuming that we'll have such bandwidth available then.

Note that specifying this value will not throttle the bandwidth for
switchover yet, so QEMU will always use the full bandwidth possible for
sending switchover data, assuming that should always be the most important
way to use the network at that time.

This can resolve issues like "unconvergence migration" which is caused by
hilarious low "migration bandwidth" detected for whatever reason.

Reported-by: Zhiyi Guo <zhguo@redhat.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231010221922.40638-1-peterx@redhat.com>


  Commit: f75ed59f40bed3ce94adad4b3ebbb7bfacfdf4ab
      
https://github.com/qemu/qemu/commit/f75ed59f40bed3ce94adad4b3ebbb7bfacfdf4ab
  Author: Dmitry Frolov <frolov@swemel.ru>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: fix RAMBlock add NULL check

qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o
check. Usualy return value is checked for this function.
Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231010104851.802947-1-frolov@swemel.ru>


  Commit: 2aae1eb8da6560cf58fa14f6bb65d00e0304f0e0
      
https://github.com/qemu/qemu/commit/2aae1eb8da6560cf58fa14f6bb65d00e0304f0e0
  Author: Nikolay Borisov <nborisov@suse.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/migration.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: Add the configuration vmstate to the json writer

Make the migration json writer part of MigrationState struct, allowing
the 'configuration' object be serialized to json.

This will facilitate the parsing of the 'configuration' object in the
next patch that fixes analyze-migration.py for arm.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-2-farosas@suse.de>


  Commit: c36c31c86b48ff4c10734ffdacf0a5712bdac216
      
https://github.com/qemu/qemu/commit/c36c31c86b48ff4c10734ffdacf0a5712bdac216
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M scripts/analyze-migration.py

  Log Message:
  -----------
  migration: Fix analyze-migration.py 'configuration' parsing

The 'configuration' state subsections are currently not being parsed
and the script fails when analyzing an aarch64 stream:

Traceback (most recent call last):
  File "./scripts/analyze-migration.py", line 625, in <module>
    dump.read(dump_memory = args.memory)
  File "./scripts/analyze-migration.py", line 571, in read
    raise Exception("Unknown section type: %d" % section_type)
Exception: Unknown section type: 5

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-3-farosas@suse.de>


  Commit: 31499a9dc1910d695d7df4145a30e3b9ddedf8fe
      
https://github.com/qemu/qemu/commit/31499a9dc1910d695d7df4145a30e3b9ddedf8fe
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M scripts/analyze-migration.py

  Log Message:
  -----------
  migration: Add capability parsing to analyze-migration.py

The script is broken when the configuration/capabilities section is
present. Add support for parsing the capabilities so we can fix it in
the next patch.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-4-farosas@suse.de>


  Commit: ff40c7f0b787f47cf767b39a3226a113c06930f2
      
https://github.com/qemu/qemu/commit/ff40c7f0b787f47cf767b39a3226a113c06930f2
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M scripts/analyze-migration.py

  Log Message:
  -----------
  migration: Fix analyze-migration.py when ignore-shared is used

The script is currently broken when the x-ignore-shared capability is
used:

Traceback (most recent call last):
  File "./scripts/analyze-migration.py", line 656, in <module>
    dump.read(dump_memory = args.memory)
  File "./scripts/analyze-migration.py", line 593, in read
    section.read()
  File "./scripts/analyze-migration.py", line 163, in read
    self.name = self.file.readstr(len = namelen)
  File "./scripts/analyze-migration.py", line 53, in readstr
    return self.readvar(len).decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 55: 
invalid start byte

We're currently adding data to the middle of the ram section depending
on the presence of the capability. As a consequence, any code loading
the ram section needs to know about capabilities so it can interpret
the stream.

Skip the byte that's added when x-ignore-shared is used to fix the
script.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-5-farosas@suse.de>


  Commit: caea03279e11dfcb0e5a567b81fe7f02ee80af02
      
https://github.com/qemu/qemu/commit/caea03279e11dfcb0e5a567b81fe7f02ee80af02
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M scripts/analyze-migration.py

  Log Message:
  -----------
  migration: Fix analyze-migration read operation signedness

The migration code uses unsigned values for 16, 32 and 64-bit
operations. Fix the script to do the same.

This was causing an issue when parsing the migration stream generated
on the ppc64 target because one of instance_ids was larger than the
32bit signed maximum:

Traceback (most recent call last):
  File "/home/fabiano/kvm/qemu/build/scripts/analyze-migration.py", line 658, 
in <module>
    dump.read(dump_memory = args.memory)
  File "/home/fabiano/kvm/qemu/build/scripts/analyze-migration.py", line 592, 
in read
    classdesc = self.section_classes[section_key]
KeyError: ('spapr_iommu', -2147483648)

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-6-farosas@suse.de>


  Commit: d864756e8734b22a9e7825c0fa46c7459a7ad105
      
https://github.com/qemu/qemu/commit/d864756e8734b22a9e7825c0fa46c7459a7ad105
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M tests/qtest/meson.build
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  tests/qtest/migration: Add a test for the analyze-migration script

Add a smoke test that migrates to a file and gives it to the
script. It should catch the most annoying errors such as changes in
the ram flags.

After code has been merged it becomes way harder to figure out what is
causing the script to fail, the person making the change is the most
likely to know right away what the problem is.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Acked-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-7-farosas@suse.de>


  Commit: 3dc35470c888b21eba4ebd22e51ff376eb4fbdbf
      
https://github.com/qemu/qemu/commit/3dc35470c888b21eba4ebd22e51ff376eb4fbdbf
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  tests/qtest: migration-test: Add tests for file-based migration

Add basic tests for file-based migration.

Note that we cannot use test_precopy_common because that routine
expects it to be possible to run the migration live. With the file
transport there is no live migration because we must wait for the
source to finish writing the migration data to the file before the
destination can start reading. Add a new migration function
specifically to handle the file migration.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230712190742.22294-7-farosas@suse.de>


  Commit: 930e239d11e28a3e8c01bae6c38f8894cfe66eb3
      
https://github.com/qemu/qemu/commit/930e239d11e28a3e8c01bae6c38f8894cfe66eb3
  Author: Fiona Ebner <f.ebner@proxmox.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M include/migration/register.h
    M migration/block-dirty-bitmap.c
    M migration/block.c
    M migration/migration.c
    M migration/ram.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: hold the BQL during setup

This is intended to be a semantic revert of commit 9b09503752
("migration: run setup callbacks out of big lock"). There have been so
many changes since that commit (e.g. a new setup callback
dirty_bitmap_save_setup() that also needs to be adapted now), it's
easier to do the revert manually.

For snapshots, the bdrv_writev_vmstate() function is used during setup
(in QIOChannelBlock backing the QEMUFile), but not holding the BQL
while calling it could lead to an assertion failure. To understand
how, first note the following:

1. Generated coroutine wrappers for block layer functions spawn the
coroutine and use AIO_WAIT_WHILE()/aio_poll() to wait for it.
2. If the host OS switches threads at an inconvenient time, it can
happen that a bottom half scheduled for the main thread's AioContext
is executed as part of a vCPU thread's aio_poll().

An example leading to the assertion failure is as follows:

main thread:
1. A snapshot-save QMP command gets issued.
2. snapshot_save_job_bh() is scheduled.

vCPU thread:
3. aio_poll() for the main thread's AioContext is called (e.g. when
the guest writes to a pflash device, as part of blk_pwrite which is a
generated coroutine wrapper).
4. snapshot_save_job_bh() is executed as part of aio_poll().
3. qemu_savevm_state() is called.
4. qemu_mutex_unlock_iothread() is called. Now
qemu_get_current_aio_context() returns 0x0.
5. bdrv_writev_vmstate() is executed during the usual savevm setup
via qemu_fflush(). But this function is a generated coroutine wrapper,
so it uses AIO_WAIT_WHILE. There, the assertion
assert(qemu_get_current_aio_context() == qemu_get_aio_context());
will fail.

To fix it, ensure that the BQL is held during setup. While it would
only be needed for snapshots, adapting migration too avoids additional
logic for conditional locking/unlocking in the setup callbacks.
Writing the header could (in theory) also trigger qemu_fflush() and
thus bdrv_writev_vmstate(), so the locked section also covers the
qemu_savevm_state_header() call, even for migration for consistency.

The section around multifd_send_sync_main() needs to be unlocked to
avoid a deadlock. In particular, the multifd_save_setup() function calls
socket_send_channel_create() using multifd_new_send_channel_async() as a
callback and then waits for the callback to signal via the
channels_ready semaphore. The connection happens via
qio_task_run_in_thread(), but the callback is only executed via
qio_task_thread_result() which is scheduled for the main event loop.
Without unlocking the section, the main thread would never get to
process the task result and the callback meaning there would be no
signal via the channels_ready semaphore.

The comment in ram_init_bitmaps() was introduced by 4987783400
("migration: fix incorrect memory_global_dirty_log_start outside BQL")
and is removed, because it referred to the qemu_mutex_lock_iothread()
call.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231013105839.415989-1-f.ebner@proxmox.com>


  Commit: d4f34485ca8a077c98fc2303451e9bece9200dd7
      
https://github.com/qemu/qemu/commit/d4f34485ca8a077c98fc2303451e9bece9200dd7
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Non multifd migration don't care about multifd flushes

RDMA was having trouble because
migrate_multifd_flush_after_each_section() can only be true or false,
but we don't want to send any flush when we are not in multifd
migration.

CC: Fabiano Rosas <farosas@suse.de
Fixes: 294e5a4034e81 ("multifd: Only flush once each full round of memory")

Reported-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011205548.10571-2-quintela@redhat.com>


  Commit: 27fd25b0fbcbcf2546fb2cb13fd9c8fe840eef02
      
https://github.com/qemu/qemu/commit/27fd25b0fbcbcf2546fb2cb13fd9c8fe840eef02
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/migration.c
    M migration/migration.h
    M migration/options.c
    M migration/options.h
    M migration/rdma.c

  Log Message:
  -----------
  migration: Create migrate_rdma()

Helper to say if we are doing a migration over rdma.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-2-quintela@redhat.com>


  Commit: 48408174a7ec7bfdc18c6d9886d0eeb20520a349
      
https://github.com/qemu/qemu/commit/48408174a7ec7bfdc18c6d9886d0eeb20520a349
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Unfold ram_control_before_iterate()

Once there:
- Remove unused data parameter
- unfold it in its callers.
- change all callers to call qemu_rdma_registration_start()
- We need to call QIO_CHANNEL_RDMA() after we check for migrate_rdma()

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-3-quintela@redhat.com>


  Commit: 5f5b8858dc1c11916000a5a2038044dec31640d6
      
https://github.com/qemu/qemu/commit/5f5b8858dc1c11916000a5a2038044dec31640d6
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Unfold ram_control_after_iterate()

Once there:
- Remove unused data parameter
- unfold it in its callers
- change all callers to call qemu_rdma_registration_stop()
- We need to call QIO_CHANNEL_RDMA() after we check for migrate_rdma()

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-4-quintela@redhat.com>


  Commit: f6d6c089b78a6492416408b93a799edecfd736d6
      
https://github.com/qemu/qemu/commit/f6d6c089b78a6492416408b93a799edecfd736d6
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Remove all uses of RAM_CONTROL_HOOK

Instead of going through ram_control_load_hook(), call
qemu_rdma_registration_handle() directly.

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-5-quintela@redhat.com>


  Commit: a6323300e879558055948cb16ba6da52a9836869
      
https://github.com/qemu/qemu/commit/a6323300e879558055948cb16ba6da52a9836869
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Unfold hook_ram_load()

There is only one flag called with: RAM_CONTROL_BLOCK_REG.

Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-6-quintela@redhat.com>


  Commit: e493008d504b3513e64f90e87924fd4b4a2f0751
      
https://github.com/qemu/qemu/commit/e493008d504b3513e64f90e87924fd4b4a2f0751
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Create rdma_control_save_page()

The only user of ram_control_save_page() and save_page() hook was
rdma. Just move the function to rdma.c, rename it to
rdma_control_save_page().

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-7-quintela@redhat.com>


  Commit: 8b670f48ed40e0086b01fe9f603fa2f7470e9148
      
https://github.com/qemu/qemu/commit/8b670f48ed40e0086b01fe9f603fa2f7470e9148
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/rdma.c

  Log Message:
  -----------
  qemu-file: Remove QEMUFileHooks

The only user was rdma, and its use is gone.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-8-quintela@redhat.com>


  Commit: 10cb3336b11edeabae324148cbf924dfb7464bfa
      
https://github.com/qemu/qemu/commit/10cb3336b11edeabae324148cbf924dfb7464bfa
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.h

  Log Message:
  -----------
  migration/rdma: Move rdma constants from qemu-file.h to rdma.h

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-9-quintela@redhat.com>


  Commit: b1b383872211a80a2011313969cb26e2ec43fa24
      
https://github.com/qemu/qemu/commit/b1b383872211a80a2011313969cb26e2ec43fa24
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h
    M migration/trace-events

  Log Message:
  -----------
  migration/rdma: Remove qemu_ prefix from exported functions

Functions are long enough even without this.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-10-quintela@redhat.com>


  Commit: a4832d299ddefb3bbcf8561d9444a17addb1076c
      
https://github.com/qemu/qemu/commit/a4832d299ddefb3bbcf8561d9444a17addb1076c
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Check sooner if we are in postcopy for save_page()

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-11-quintela@redhat.com>


  Commit: ebdb85f9d13237287a165f1097e68206a7d5181b
      
https://github.com/qemu/qemu/commit/ebdb85f9d13237287a165f1097e68206a7d5181b
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Use i as for index instead of idx

Once there, all the uses are local to the for, so declare the variable
inside the for statement.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-12-quintela@redhat.com>


  Commit: 14e2fcbbf80fc3c25c182f6624207daf64de9d88
      
https://github.com/qemu/qemu/commit/14e2fcbbf80fc3c25c182f6624207daf64de9d88
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Declare for index variables local

Declare all variables that are only used inside a for loop inside the
for statement.

This makes clear that they are not used outside of the for loop.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-13-quintela@redhat.com>


  Commit: 8f5a7faa4e60e93cf4f014ed100efa4206f6d7ae
      
https://github.com/qemu/qemu/commit/8f5a7faa4e60e93cf4f014ed100efa4206f6d7ae
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Remove all "ret" variables that are used only once

Change code that is:

int ret;
...

ret = foo();
if (ret[ < 0]?) {

to:

if (foo()[ < 0]) {

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011203527.9061-14-quintela@redhat.com>


  Commit: e4ceec292fcdcae390eee539b79fbb6107f402e9
      
https://github.com/qemu/qemu/commit/e4ceec292fcdcae390eee539b79fbb6107f402e9
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M qapi/migration.json

  Log Message:
  -----------
  migration: Improve json and formatting

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231013104736.31722-2-quintela@redhat.com>


  Commit: 60c7981aa3e84eb6d926fd4f7bb4aca4d2edf7cc
      
https://github.com/qemu/qemu/commit/60c7981aa3e84eb6d926fd4f7bb4aca4d2edf7cc
  Author: Elena Ufimtseva <elena.ufimtseva@oracle.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/migration-stats.c

  Log Message:
  -----------
  migration: check for rate_limit_max for RATE_LIMIT_DISABLED

In migration rate limiting atomic operations are used
to read the rate limit variables and transferred bytes and
they are expensive. Check first if rate_limit_max is equal
to RATE_LIMIT_DISABLED and return false immediately if so.

Note that with this patch we will also will stop flushing
by not calling qemu_fflush() from migration_transferred_bytes()
if the migration rate is not exceeded.
This should be fine since migration thread calls in the loop
migration_update_counters from migration_rate_limit() that
calls the migration_transferred_bytes() and flushes there.

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184358.97349-2-elena.ufimtseva@oracle.com>


  Commit: 68b6e000484c6df34d5cd097e5ae94e9612f5df7
      
https://github.com/qemu/qemu/commit/68b6e000484c6df34d5cd097e5ae94e9612f5df7
  Author: Elena Ufimtseva <elena.ufimtseva@oracle.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: fix counters in multifd_send_thread

Previous commit cbec7eb76879d419e7dbf531ee2506ec0722e825
"migration/multifd: Compute transferred bytes correctly"
removed accounting for packet_len in non-rdma
case, but the next_packet_size only accounts for pages, not for
the header packet (normal_pages * PAGE_SIZE) that is being sent
as iov[0]. The packet_len part should be added to account for
the size of MultiFDPacket and the array of the offsets.

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184358.97349-4-elena.ufimtseva@oracle.com>


  Commit: 1618f5522145b3cab4d9eb154b921417b577dc2c
      
https://github.com/qemu/qemu/commit/1618f5522145b3cab4d9eb154b921417b577dc2c
  Author: Elena Ufimtseva <elena.ufimtseva@oracle.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  multifd: reset next_packet_len after sending pages

Sometimes multifd sends just sync packet with no pages
(normal_num is 0). In this case the old value is being
preserved and being accounted for while only packet_len
is being transferred.
Reset it to 0 after sending and accounting for.

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184358.97349-5-elena.ufimtseva@oracle.com>


  Commit: 2f5ced5b93720218509fbf7278b5c651d3bbd806
      
https://github.com/qemu/qemu/commit/2f5ced5b93720218509fbf7278b5c651d3bbd806
  Author: Nikolay Borisov <nborisov@suse.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: Refactor precopy ram loading code

Extract the ramblock parsing code into a routine that operates on the
sequence of headers from the stream and another the parses the
individual ramblock. This makes ram_load_precopy() easier to
comprehend.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-3-farosas@suse.de>


  Commit: 8f47d4ee434ea23fac81b33d7200367f05220495
      
https://github.com/qemu/qemu/commit/8f47d4ee434ea23fac81b33d7200367f05220495
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: Remove RAMState from xbzrle_cache_zero_page

'rs' is not used in that function. It's a leftover from commit
9360447d34 ("ram: Use MigrationStats for statistics").

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-4-farosas@suse.de>


  Commit: 1e43f165d0810cdd015ade9c37c93b2c2e720d5c
      
https://github.com/qemu/qemu/commit/1e43f165d0810cdd015ade9c37c93b2c2e720d5c
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: Stop passing QEMUFile around in save_zero_page

We don't need the QEMUFile when we're already passing the
PageSearchStatus.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-5-farosas@suse.de>


  Commit: ccc09db87c7e5e6d52cdde320540f3dc0ee8b147
      
https://github.com/qemu/qemu/commit/ccc09db87c7e5e6d52cdde320540f3dc0ee8b147
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: Move xbzrle zero page handling into save_zero_page

It makes a bit more sense to have the zero page handling of xbzrle
right where we save the zero page.

Also invert the exit condition to remove one level of indentation
which makes the next patch easier to grasp.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-6-farosas@suse.de>


  Commit: 8697eb8577692d16317655c2efa11a7edf9c02aa
      
https://github.com/qemu/qemu/commit/8697eb8577692d16317655c2efa11a7edf9c02aa
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/ram: Merge save_zero_page functions

We don't need to do this in two pieces. One single function makes it
easier to grasp, specially since it removes the indirection on the
return value handling.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231011184604.32364-7-farosas@suse.de>


  Commit: 0e92f6444834a84aefab8f31b4f6a04c0dfed801
      
https://github.com/qemu/qemu/commit/0e92f6444834a84aefab8f31b4f6a04c0dfed801
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  migration/multifd: Remove direct "socket" references

We're about to enable support for other transports in multifd, so
remove direct references to sockets.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231012134343.23757-2-farosas@suse.de>


  Commit: ee8a7c9c46b8f06969a975ac3fd3fd30491611a7
      
https://github.com/qemu/qemu/commit/ee8a7c9c46b8f06969a975ac3fd3fd30491611a7
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/multifd.c

  Log Message:
  -----------
  migration/multifd: Unify multifd_send_thread error paths

The preferred usage of the Error type is to always set both the return
code and the error when a failure happens. As all code called from the
send thread follows this pattern, we'll always have the return code
and the error set at the same time.

Aside from the convention, in this piece of code this must be the
case, otherwise the if (ret != 0) would be exiting the thread without
calling multifd_send_terminate_threads() which is incorrect.

Unify both paths to make it clear that both are taken when there's an
error.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231012134343.23757-3-farosas@suse.de>


  Commit: 967e3889874b1116090a60c0cb43157130bdbd16
      
https://github.com/qemu/qemu/commit/967e3889874b1116090a60c0cb43157130bdbd16
  Author: Fabiano Rosas <farosas@suse.de>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M migration/multifd.c
    M migration/trace-events

  Log Message:
  -----------
  migration/multifd: Clarify Error usage in multifd_channel_connect

The function is currently called from two sites, one always gives it a
NULL Error and the other always gives it a non-NULL Error.

In the non-NULL case, all it does it trace the error and return. One
of the callers already have tracing, add a tracepoint to the other and
stop passing the error into the function.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231012134343.23757-4-farosas@suse.de>


  Commit: 0193b3bc05fe45860849b11958431e53feec7516
      
https://github.com/qemu/qemu/commit/0193b3bc05fe45860849b11958431e53feec7516
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M docs/system/device-emulation.rst
    A docs/system/devices/virtio-gpu.rst
    M hw/display/meson.build
    M hw/display/virtio-gpu-base.c
    A hw/display/virtio-gpu-pci-rutabaga.c
    M hw/display/virtio-gpu-pci.c
    A hw/display/virtio-gpu-rutabaga.c
    M hw/display/virtio-gpu.c
    A hw/display/virtio-vga-rutabaga.c
    M hw/display/virtio-vga.c
    M hw/virtio/virtio-pci.c
    M include/hw/virtio/virtio-gpu-bswap.h
    M include/hw/virtio/virtio-gpu.h
    M include/hw/virtio/virtio-pci.h
    M meson.build
    M meson_options.txt
    M scripts/meson-buildoptions.sh
    M system/qdev-monitor.c
    M system/vl.c

  Log Message:
  -----------
  Merge tag 'gpu-pull-request' of https://gitlab.com/marcandre.lureau/qemu into 
staging

virtio-gpu rutabaga support

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmUtP5YcHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5X9CD/4s1n/GZyDr9bh04V03
# otAqtq2CSyuUOviqBrqxYgraCosUD1AuX8WkDy5cCPtnKC4FxRjgVlm9s7K/yxOW
# xZ78e4oVgB1F3voOq6LgtKK6BRG/BPqNzq9kuGcayCHQbSxg7zZVwa702Y18r2ZD
# pjOhbZCrJTSfASL7C3e/rm7798Wk/hzSrClGR56fbRAVgQ6Lww2L97/g0nHyDsWK
# DrCBrdqFtKjpLeUHmcqqS4AwdpG2SyCgqE7RehH/wOhvGTxh/JQvHbLGWK2mDC3j
# Qvs8mClC5bUlyNQuUz7lZtXYpzCW6VGMWlz8bIu+ncgSt6RK1TRbdEfDJPGoS4w9
# ZCGgcTxTG/6BEO76J/VpydfTWDo1FwQCQ0Vv7EussGoRTLrFC3ZRFgDWpqCw85yi
# AjPtc0C49FHBZhK0l1CoJGV4gGTDtD9jTYN0ffsd+aQesOjcsgivAWBaCOOQWUc8
# KOv9sr4kLLxcnuCnP7p/PuVRQD4eg0TmpdS8bXfnCzLSH8fCm+n76LuJEpGxEBey
# 3KPJPj/1BNBgVgew+znSLD/EYM6YhdK2gF5SNrYsdR6UcFdrPED/xmdhzFBeVym/
# xbBWqicDw4HLn5YrJ4tzqXje5XUz5pmJoT5zrRMXTHiu4pjBkEXO/lOdAoFwSy8M
# WNOtmSyB69uCrbyLw6xE2/YX8Q==
# =5a/Z
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 16 Oct 2023 09:50:14 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" 
[full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" 
[full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'gpu-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  docs/system: add basic virtio-gpu documentation
  gfxstream + rutabaga: enable rutabaga
  gfxstream + rutabaga: meson support
  gfxstream + rutabaga: add initial support for gfxstream
  gfxstream + rutabaga prep: added need defintions, fields, and options
  virtio-gpu: blob prep
  virtio-gpu: hostmem
  virtio-gpu: CONTEXT_INIT feature
  virtio: Add shared memory capability

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: ec6f9f135d5e5596ab0258da2ddd048f1fd8c359
      
https://github.com/qemu/qemu/commit/ec6f9f135d5e5596ab0258da2ddd048f1fd8c359
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M include/migration/register.h
    M migration/block-dirty-bitmap.c
    M migration/block.c
    M migration/migration-hmp-cmds.c
    M migration/migration-stats.c
    M migration/migration.c
    M migration/migration.h
    M migration/multifd.c
    M migration/options.c
    M migration/options.h
    M migration/qemu-file.c
    M migration/qemu-file.h
    M migration/ram.c
    M migration/rdma.c
    M migration/rdma.h
    M migration/savevm.c
    M migration/trace-events
    M qapi/migration.json
    M scripts/analyze-migration.py
    M tests/qtest/meson.build
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  Merge tag 'migration-20231017-pull-request' of 
https://gitlab.com/juan.quintela/qemu into staging

Migration Pull request (20231017)

Hi

Same that yesterday one, except:
- rebased to latest (clean rebase)
- fixed 64 bits read on big endian host

CI: https://gitlab.com/juan.quintela/qemu/-/pipelines/1039214198

Please, apply.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmUuReUACgkQ9IfvGFhy
# 1yO+FQ/+Nx2botbrUVJb3vLeG6f+x5xeWJjB0boOqhk7227cKmAA33Oqwx5l4UtL
# oLOHA6P4ThqacpaluGOMMp44BSr/jOMDC/HUDVJtSplTD+droPiklIIGUfYScLbA
# oYx6lXfSB2jMpSuSU19STbjwBRvd4bjJix3zDGwEIgXYqYt0tY0FY/nnGTmImnM1
# KDjRerf1lg4Rt0vvwg7I0onIDvh3CKX26Sj5a3wSRaLoocUe3jpsuBNH7MMqroHs
# WpocBIsLiBAf/CbeLZsQlhbVeOi1R+kSAR5hDPvvJCPWHIrd2wf8+3NXjcFepb7d
# M4wE2jLjCvHhzwYwSc0ir4n74jwD22IirEPQs8ONHrjLCb5VoBKYV5bqsFUHF55N
# SbFvcZIzJFiOm2anEWiiqiNTLtYAdQCKtUvbyJ7Mq4ck6icIInLdX9zrm4voofYJ
# 02lX/IIGlT3C3dGSz09LBoJ6E82zmQWNHmov8A90+3RYvMF9uSpxi0z40lhj6jWC
# 6Q2AHxrJJ040ZboeOfJQG78BtvZ/9PQ2ORhJ3ceRDND4kSTDtfe/TSNAZ3thM33y
# Sv99o+F/HaqrKnxK8eTJrvIEWxojDu3lnqJERWAm2AOxTnQ+6mgGtsCfLEdrv5D1
# xVsY2QczB1quRjaU2ml/7Cxe4Q1urTtfl82IEXGded6UL+cmF/I=
# =br93
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 17 Oct 2023 04:29:25 EDT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20231017-pull-request' of 
https://gitlab.com/juan.quintela/qemu: (38 commits)
  migration/multifd: Clarify Error usage in multifd_channel_connect
  migration/multifd: Unify multifd_send_thread error paths
  migration/multifd: Remove direct "socket" references
  migration/ram: Merge save_zero_page functions
  migration/ram: Move xbzrle zero page handling into save_zero_page
  migration/ram: Stop passing QEMUFile around in save_zero_page
  migration/ram: Remove RAMState from xbzrle_cache_zero_page
  migration/ram: Refactor precopy ram loading code
  multifd: reset next_packet_len after sending pages
  multifd: fix counters in multifd_send_thread
  migration: check for rate_limit_max for RATE_LIMIT_DISABLED
  migration: Improve json and formatting
  migration/rdma: Remove all "ret" variables that are used only once
  migration/rdma: Declare for index variables local
  migration/rdma: Use i as for index instead of idx
  migration/rdma: Check sooner if we are in postcopy for save_page()
  migration/rdma: Remove qemu_ prefix from exported functions
  migration/rdma: Move rdma constants from qemu-file.h to rdma.h
  qemu-file: Remove QEMUFileHooks
  migration/rdma: Create rdma_control_save_page()
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


Compare: https://github.com/qemu/qemu/compare/800485762e65...ec6f9f135d5e



reply via email to

[Prev in Thread] Current Thread [Next in Thread]