Skip to content
Snippets Groups Projects
  1. Apr 20, 2023
  2. Apr 19, 2023
  3. Apr 13, 2023
    • Peter Maydell's avatar
      7dbd6f8a
    • Peter Maydell's avatar
      Merge tag 'migration-20230412-pull-request' of https://gitlab.com/juan.quintela/qemu into staging · c38b2ca7
      Peter Maydell authored
      Migration Pull request for 8.0
      
      Last patches found:
      - peter xu preempt channel fixes.
        needed for backward compatibility with old machine types.
      - lukas fix to get compress working again.
      
      - fix ram on s390x.  Get back to the old code, even when it shouldn't
        be needed, but as it fails on s390x, just revert.
      
      Later, Juan.
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmQ3HgQACgkQ9IfvGFhy
      # 1yPXGQ/+Pf6HepNUlIr7naYOcpRriXPQF+q1zqo74F9fy2vrGcwJOI6qmRTjsX4E
      # 9KgXipOz7+b5wSemF7PDKcnBiwyt6UHCH+XXe0h4TpyuORbtABKRgtOhA1/sa84D
      # HnKp0TwImpAO26tzPa7u49aau/EEVBKAzFVcyn4w56S9qiDWicOpd5kG0CJBIsMJ
      # Mnvy5fXaqQRewnKiwFoJGWfyhzEToDO6Z/SkT5xYON94P+eiM2xMwXOC5WcGfmY7
      # wFGDB+SuyEP8TTn7mV0mmnlFjYe4G07hVARHSDFX3ho4b6q5F+WzfW095G6QKiu9
      # n3Pzr7IBGX3sgetPtYwOwGsE9JrfHMFzBRxQZZwq5GSmjk7+agkbXmV7RyV82EYs
      # KYOhuNF91ca0qvCrGA/eGbbJqVrd7SR5FhS4SQ7oKd5n2au/ZHoKwAgm5lBdcvES
      # 2TB0MBN1s0JPh6KMV8tPB2miZyqPRa++oA8qIX7Asoe1X4xVT1FwiDaFL8TO8i2A
      # 7uBis3KLZqOHC6dAiXlCDtaADAWgQxjcdoS1l8jTF6MgBSe+zQhXG+pcIDuSiV9N
      # WfDiUPY97iqPTvpzdz3Is+LbBax2uY5ZR05KSdmCBpIgfvSWMqXtwRydclt6G5h7
      # ZiOcTwrgMpXdbhdsFZTqVWAJG2sTkj4TA+IezVpXzPeQNLZ+T8k=
      # =kW3P
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Wed 12 Apr 2023 22:09:24 BST
      # 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-20230412-pull-request' of https://gitlab.com/juan.quintela/qemu
      
      :
        migration: fix ram_state_pending_exact()
        migration/ram.c: Fix migration with compress enabled
        migration: Recover behavior of preempt channel creation for pre-7.2
        migration: Fix potential race on postcopy_qemufile_src
        io: tls: Inherit QIO_CHANNEL_FEATURE_SHUTDOWN on server side
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c38b2ca7
    • David Woodhouse's avatar
      hw/xen: Fix double-free in xen_console store_con_info() · 69d4e746
      David Woodhouse authored
      
      Coverity spotted a double-free (CID 1508254); we g_string_free(path) and
      then for some reason immediately call free(path) too.
      
      We should just use g_autoptr() for it anyway, which simplifies the code
      a bit.
      
      Fixes: 7a8a749d ("hw/xen: Move xenstore_store_pv_console_info to xen_console.c")
      Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      69d4e746
  4. Apr 12, 2023
    • Juan Quintela's avatar
      migration: fix ram_state_pending_exact() · 28ef5339
      Juan Quintela authored
      
      I removed that bit on commit:
      
      commit c8df4a7a
      Author: Juan Quintela <quintela@redhat.com>
      Date:   Mon Oct 3 02:00:03 2022 +0200
      
          migration: Split save_live_pending() into state_pending_*
      
      Fixes: c8df4a7a
      Suggested-by: default avatarNina Schoetterl-Glausch <nsg@linux.ibm.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      28ef5339
    • Lukas Straub's avatar
      migration/ram.c: Fix migration with compress enabled · 37502df3
      Lukas Straub authored
      
      Since ec6f3ab9, migration with compress enabled was broken, because
      the compress threads use a dummy QEMUFile which just acts as a
      buffer and that commit accidentally changed it to use the outgoing
      migration channel instead.
      
      Fix this by using the dummy file again in the compress threads.
      
      Signed-off-by: default avatarLukas Straub <lukasstraub2@web.de>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      37502df3
    • Peter Xu's avatar
      migration: Recover behavior of preempt channel creation for pre-7.2 · 06064a67
      Peter Xu authored
      
      In 8.0 devel window we reworked preempt channel creation, so that there'll
      be no race condition when the migration channel and preempt channel got
      established in the wrong order in commit 5655aab0.
      
      However no one noticed that the change will also be not compatible with
      older qemus, majorly 7.1/7.2 versions where preempt mode started to be
      supported.
      
      Leverage the same pre-7.2 flag introduced in the previous patch to recover
      the behavior hopefully before 8.0 releases, so we don't break migration
      when we migrate from 8.0 to older qemu binaries.
      
      Fixes: 5655aab0 ("migration: Postpone postcopy preempt channel to be after main")
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      06064a67
    • Peter Xu's avatar
      migration: Fix potential race on postcopy_qemufile_src · 6621883f
      Peter Xu authored
      
      postcopy_qemufile_src object should be owned by one thread, either the main
      thread (e.g. when at the beginning, or at the end of migration), or by the
      return path thread (when during a preempt enabled postcopy migration).  If
      that's not the case the access to the object might be racy.
      
      postcopy_preempt_shutdown_file() can be potentially racy, because it's
      called at the end phase of migration on the main thread, however during
      which the return path thread hasn't yet been recycled; the recycle happens
      in await_return_path_close_on_source() which is after this point.
      
      It means, logically it's posslbe the main thread and the return path thread
      are both operating on the same qemufile.  While I don't think qemufile is
      thread safe at all.
      
      postcopy_preempt_shutdown_file() used to be needed because that's where we
      send EOS to dest so that dest can safely shutdown the preempt thread.
      
      To avoid the possible race, remove this only place that a race can happen.
      Instead we figure out another way to safely close the preempt thread on
      dest.
      
      The core idea during postcopy on deciding "when to stop" is that dest will
      send a postcopy SHUT message to src, telling src that all data is there.
      Hence to shut the dest preempt thread maybe better to do it directly on
      dest node.
      
      This patch proposed such a way that we change postcopy_prio_thread_created
      into PreemptThreadStatus, so that we kick the preempt thread on dest qemu
      by a sequence of:
      
        mis->preempt_thread_status = PREEMPT_THREAD_QUIT;
        qemu_file_shutdown(mis->postcopy_qemufile_dst);
      
      While here shutdown() is probably so far the easiest way to kick preempt
      thread from a blocked qemu_get_be64().  Then it reads preempt_thread_status
      to make sure it's not a network failure but a willingness to quit the
      thread.
      
      We could have avoided that extra status but just rely on migration status.
      The problem is postcopy_ram_incoming_cleanup() is just called early enough
      so we're still during POSTCOPY_ACTIVE no matter what.. So just make it
      simple to have the status introduced.
      
      One flag x-preempt-pre-7-2 is added to keep old pre-7.2 behaviors of
      postcopy preempt.
      
      Fixes: 93589827 ("migration: Send requested page directly in rp-return thread")
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      6621883f
    • Peter Xu's avatar
      io: tls: Inherit QIO_CHANNEL_FEATURE_SHUTDOWN on server side · 86d063fa
      Peter Xu authored
      
      TLS iochannel will inherit io_shutdown() from the master ioc, however we
      missed to do that on the server side.
      
      This will e.g. allow qemu_file_shutdown() to work on dest QEMU too for
      migration.
      
      Acked-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
      Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
      86d063fa
    • Peter Maydell's avatar
      Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging · 9d177b7f
      Peter Maydell authored
      Fix NFS driver issue.
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmQ22+MUHHBib256aW5p
      # QHJlZGhhdC5jb20ACgkQv/vSX3jHroOYfwgAm3K121ALsF2kDplg+nDA/H69DbCi
      # HG0iozJc//MmqF+15dgmClcBn+567U7evSesATv0Bx/UBVN8XtUoS/Krf+QSHd80
      # Ycxw1TBgD2Ddc1MmVuYPZetvs8j2a+cYEQIW3ZP5o7Ng88o2BEYiyU1CXA/opfXy
      # Lz1lQd3OHK7p00h0uHlqG41XZEuMkj5I6uorqvyDoqVkojtq2agbA7YWEsuiKyzj
      # owztvajmh4v0vDSMVuFGr721VIiAm2sFh7JoL69E4EOig47QD3mPPDm8wX48O0dM
      # ISKztYKlsSIcGFqpMPsjXioQOiMfp/StfsS1kr6X4B0q4r7UXrpQQ+TMkA==
      # =sStc
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Wed 12 Apr 2023 17:27:15 BST
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * tag 'for-upstream' of https://gitlab.com/bonzini/qemu
      
      :
        block/nfs: do not poll within a coroutine
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9d177b7f
    • Paolo Bonzini's avatar
      block/nfs: do not poll within a coroutine · 3fe64abc
      Paolo Bonzini authored
      
      Since the former nfs_get_allocated_file_size is now a coroutine
      function, it must suspend rather than poll.  Switch BDRV_POLL_WHILE()
      to a qemu_coroutine_yield() loop and schedule nfs_co_generic_bh_cb()
      in place of the call to bdrv_wakeup().
      
      Fixes: 82618d7b ("block: Convert bdrv_get_allocated_file_size() to co_wrapper", 2023-02-01)
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-Id: <20230412112606.80983-1-pbonzini@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3fe64abc
    • Peter Maydell's avatar
      Merge tag 'coverity-fixes-pull-request' of git://git.infradead.org/qemu-nvme into staging · 77a87a07
      Peter Maydell authored
      hw/nvme coverity fixes
      
      Fix two issues reported by coverity (CID 1451080 and 1451082).
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQEzBAABCgAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmQ2gfEACgkQTeGvMW1P
      # DemcEQf/V+arKs9OFhfqu3OtKQu5R4F2i2Tq3aRulrbZr/dPGkkLjSQjgGdkbg0F
      # 8TZQYezFGZdg45QqxfxpVxPf8hrlGX6c/cbVZp9BnIGGXForLLHfrvNQpVVg5Ldm
      # 8fA5zBccbnH2ER4nf12xf56WzjKWIpv5Xt/+hqOSoghThKfUxjIowR58fxoZySy6
      # zl0cr6+FMnMZkLxGN0EslckNzYzpX5aXfJLMZKPG3G07EVmTgcGfJxjw0pWkzbq6
      # ictMeP8BTbOU4IGLC2SIRppkiWEr3rUCL4aPhlPg90rIyXDU4onYP8dr0Y5ZI0gY
      # QFtaZpTYEeRw84AJhgyR4U6h37UE/g==
      # =kGwj
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Wed 12 Apr 2023 11:03:29 BST
      # gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
      # gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [full]
      # gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [full]
      # Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
      #      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9
      
      * tag 'coverity-fixes-pull-request' of git://git.infradead.org/qemu-nvme
      
      :
        hw/nvme: fix memory leak in nvme_dsm
        hw/nvme: fix memory leak in fdp ruhid parsing
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      77a87a07
    • Klaus Jensen's avatar
      hw/nvme: fix memory leak in nvme_dsm · 4b32319c
      Klaus Jensen authored
      
      The iocb (and the allocated memory to hold LBA ranges) leaks if reading
      the LBA ranges fails.
      
      Fix this by adding a free and an unref of the iocb.
      
      Reported-by: Coverity (CID 1508281)
      Fixes: d7d1474f ("hw/nvme: reimplement dsm to allow cancellation")
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
      4b32319c
    • Klaus Jensen's avatar
      hw/nvme: fix memory leak in fdp ruhid parsing · cb16e5c7
      Klaus Jensen authored
      
      Coverity reports a memory leak of memory when parsing ruhids at
      namespace initialization. Since this is just working memory, not needed
      beyond the scope of the functions, fix this by adding a g_autofree
      annotation.
      
      Reported-by: Coverity (CID 1507979)
      Fixes: 73064edf ("hw/nvme: flexible data placement emulation")
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarKlaus Jensen <k.jensen@samsung.com>
      cb16e5c7
  5. Apr 11, 2023
Loading