qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] eb2ca5: runstate: add runstate_get()


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] eb2ca5: runstate: add runstate_get()
Date: Tue, 30 May 2023 06:21:10 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: eb2ca51994663ac445548c43358fd0c5268f1206
      
https://github.com/qemu/qemu/commit/eb2ca51994663ac445548c43358fd0c5268f1206
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M include/sysemu/runstate.h
    M softmmu/runstate.c

  Log Message:
  -----------
  runstate: add runstate_get()

It's necessary to restore the state after failed/cancelled migration in
further commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-2-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 77b3e6d3fec1484d25ff57962f47e9cc91abd589
      
https://github.com/qemu/qemu/commit/77b3e6d3fec1484d25ff57962f47e9cc91abd589
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M include/migration/global_state.h
    M migration/global_state.c
    M migration/migration.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: never fail in global_state_store()

Actually global_state_store() can never fail. Let's get rid of extra
error paths.

To make things clear, use new runstate_get() and use same approach for
global_state_store() and global_state_store_running().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-3-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: e4343ec6ac28f110089b7c9299ba65baedf9fbb2
      
https://github.com/qemu/qemu/commit/e4343ec6ac28f110089b7c9299ba65baedf9fbb2
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M include/sysemu/runstate.h
    M softmmu/runstate.c

  Log Message:
  -----------
  runstate: drop unused runstate_store()

The function is unused since previous commit. Drop it.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-4-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 5f61f9a4942728c3a82a5666a16d17586495aa16
      
https://github.com/qemu/qemu/commit/5f61f9a4942728c3a82a5666a16d17586495aa16
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

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

  Log Message:
  -----------
  migration: switch from .vm_was_running to .vm_old_state

No logic change here, only refactoring. That's a preparation for next
commit where we finally restore the stopped vm state on migration
failure or cancellation.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-5-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 983ec2235ca47b0a28ca8cd82ea50dc046d32c43
      
https://github.com/qemu/qemu/commit/983ec2235ca47b0a28ca8cd82ea50dc046d32c43
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M migration/migration.c
    M softmmu/runstate.c

  Log Message:
  -----------
  migration: restore vmstate on migration failure

1. Otherwise failed migration just drops guest-panicked state, which is
   not good for management software.

2. We do keep different paused states like guest-panicked during
   migration with help of global_state state.

3. We do restore running state on source when migration is cancelled or
   failed.

4. "postmigrate" state is documented as "guest is paused following a
   successful 'migrate'", so originally it's only for successful path
   and we never documented current behavior.

Let's restore paused states like guest-panicked in case of cancel or
fail too. Allow same transitions like for inmigrate state.

This commit changes the behavior that was introduced by commit
42da5550d6 "migration: set state to post-migrate on failure" and
provides a bit different fix on related
  https://bugzilla.redhat.com/show_bug.cgi?id=1355683

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-6-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>


  Commit: 479a2ad409a625da458649652e605947eb721112
      
https://github.com/qemu/qemu/commit/479a2ad409a625da458649652e605947eb721112
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

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

  Log Message:
  -----------
  migration: Don't abuse qemu_file transferred for RDMA

Just create a variable for it, the same way that multifd does.  This
way it is safe to use for other thread, etc, etc.

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-11-quintela@redhat.com>


  Commit: 51c353ab33ee9a6366e646877384a35e592e8ea2
      
https://github.com/qemu/qemu/commit/51c353ab33ee9a6366e646877384a35e592e8ea2
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/RDMA: It is accounting for zero/normal pages in two places

Remove the one in control_save_page().

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-12-quintela@redhat.com>


  Commit: c1fbf411dfb26e8015f0046abb39f185faaea5a3
      
https://github.com/qemu/qemu/commit/c1fbf411dfb26e8015f0046abb39f185faaea5a3
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Remove QEMUFile parameter when not used

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-13-quintela@redhat.com>


  Commit: af62826fd67fb17f48f623721325bc9d87e2f17b
      
https://github.com/qemu/qemu/commit/af62826fd67fb17f48f623721325bc9d87e2f17b
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

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

  Log Message:
  -----------
  migration/rdma: Don't use imaginary transfers

RDMA protocol is completely asynchronous, so in qemu_rdma_save_page()
they "invent" that a byte has been transferred.  And then they call
qemu_file_credit_transfer() and ram_transferred_add() with that byte.
Just remove that calls as nothing has been sent.

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-14-quintela@redhat.com>


  Commit: 400d034ea3f44d1ec55bf9132d0e25bcaa208b67
      
https://github.com/qemu/qemu/commit/400d034ea3f44d1ec55bf9132d0e25bcaa208b67
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

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

  Log Message:
  -----------
  migration: Remove unused qemu_file_credit_transfer()

After this change, nothing abuses QEMUFile to account for data
transferrefd during migration.

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-15-quintela@redhat.com>


  Commit: 34ea361e80a490fc8948de2f798b893edd625f91
      
https://github.com/qemu/qemu/commit/34ea361e80a490fc8948de2f798b893edd625f91
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 2023)

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

  Log Message:
  -----------
  migration/rdma: Simplify the function that saves a page

When we sent a page through QEMUFile hooks (RDMA) there are three
posiblities:
- We are not using RDMA. return RAM_SAVE_CONTROL_DELAYED and
  control_save_page() returns false to let anything else to proceed.
- There is one error but we are using RDMA.  Then we return a negative
  value, control_save_page() needs to return true.
- Everything goes well and RDMA start the sent of the page
  asynchronously.  It returns RAM_SAVE_CONTROL_DELAYED and we need to
  return 1 for ram_save_page_legacy.

Clear?

I know, I know, the interface is as bad as it gets.  I think that now
it is a bit clearer, but this needs to be done some other way.

Reviewed-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230515195709.63843-16-quintela@redhat.com>


  Commit: 9399cf2b5a0f53da5ec0d7591ee435207ab39e9b
      
https://github.com/qemu/qemu/commit/9399cf2b5a0f53da5ec0d7591ee435207ab39e9b
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-2-quintela@redhat.com>


  Commit: 654bcfbcd2c16ca69e559a3b8557adfc7fac6228
      
https://github.com/qemu/qemu/commit/654bcfbcd2c16ca69e559a3b8557adfc7fac6228
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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()

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-3-quintela@redhat.com>


  Commit: 233947692b61dbba5dc51a168cc634a490759278
      
https://github.com/qemu/qemu/commit/233947692b61dbba5dc51a168cc634a490759278
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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()

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-4-quintela@redhat.com>


  Commit: 05aa178d4408186025e2cd2c086c7d60bfc5cea8
      
https://github.com/qemu/qemu/commit/05aa178d4408186025e2cd2c086c7d60bfc5cea8
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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 trhough ram_control_load_hook(), call
qemu_rdma_registration_handle() directly.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-5-quintela@redhat.com>


  Commit: 07bd317df0e5445670f15bc7ba5f505725ddfce3
      
https://github.com/qemu/qemu/commit/07bd317df0e5445670f15bc7ba5f505725ddfce3
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-6-quintela@redhat.com>


  Commit: af934232749e64081ed4a1d29f5cb6d25f6784f6
      
https://github.com/qemu/qemu/commit/af934232749e64081ed4a1d29f5cb6d25f6784f6
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-7-quintela@redhat.com>


  Commit: 8df59e55c6f28835dd6474dd4bd93805653d6abd
      
https://github.com/qemu/qemu/commit/8df59e55c6f28835dd6474dd4bd93805653d6abd
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-8-quintela@redhat.com>


  Commit: 918d120b9cffe6191d57c43f73577df5cc06e06d
      
https://github.com/qemu/qemu/commit/918d120b9cffe6191d57c43f73577df5cc06e06d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-9-quintela@redhat.com>


  Commit: aed056dbbfaed8b7e3c934f6b6cbbc04046d393d
      
https://github.com/qemu/qemu/commit/aed056dbbfaed8b7e3c934f6b6cbbc04046d393d
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-10-quintela@redhat.com>


  Commit: d83da4626ebc1462e8f0065d446f97aece681d90
      
https://github.com/qemu/qemu/commit/d83da4626ebc1462e8f0065d446f97aece681d90
  Author: Juan Quintela <quintela@redhat.com>
  Date:   2023-05-30 (Tue, 30 May 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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230509120700.78359-11-quintela@redhat.com>


  Commit: a4423a37859caa951fc170048763d1d0d80eae6e
      
https://github.com/qemu/qemu/commit/a4423a37859caa951fc170048763d1d0d80eae6e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-05-30 (Tue, 30 May 2023)

  Changed paths:
    M include/migration/global_state.h
    M include/sysemu/runstate.h
    M migration/global_state.c
    M migration/migration-stats.c
    M migration/migration-stats.h
    M migration/migration.c
    M migration/migration.h
    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 softmmu/runstate.c

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

Migration 20230530 Pull request

Hi

On this PULL request:

- Set vmstate migration failure right (vladimir)
- Migration QEMUFileHook removal (juan)
- Migration Atomic counters (juan)

Please apply.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmR14+wACgkQ9IfvGFhy
# 1yNNCg/9EjKE4RGPdHxSxNudnLCkR2M3+XAJ0REw88+K2rbJgEU2iok3Ya+BzBes
# 6dbzCJ6mEFnGGmtAWCoPvrWdlaXCwiGzHMGTrrS2tHoV9REujG1nmdHhHW0M81x4
# RdWoRpOvirPYk1ZumlK8RBEBiEGvzSYxtEc+B3GW9WGs/SFhRVZPCU8rDK01U1pS
# ZjnD/Cg6IsAuJdK3nmdDpqaAqZNTtsRO3bquPSUrQqGGSAnZiuZAY2OUz04qBWA8
# DH7tmg1pLooyHyibn9XvsROKmmaEECVMUwndg3U6610weXJNtJUKcOSSRKEkxRrQ
# mYS2iRJTFhgML8E1Jzn8PK2Ojhr2i4IT6jxFOjVX30bDJamLT3uplzdeciMJnPtX
# qFDMva/hjhH4Dr385G167peIAzX3c3STeP2RWKET4iOUqqLsMa+BLB+2Ca21HixE
# tOx/W6Fj+d3OQ0K0NF57tQWV6Sc+Dr372oWGYqClqqQBzTUqYQ4t1L6HDZapF2em
# 8khrkVjDxcYK3pZa6i3eA6i120+AeT2e5Ox9Ow37pgphucZA3lT/E701e8h+VHk8
# ONp/Vmwby4troOU3LIkGFWHyEsCnf735ttXSJ3MCszPzabTh04U4tGNSUmppqEFI
# tADbIm/J2P0azf5pqONVeXVfuCYAWsEzUHq2KCtYk0OfxysMDes=
# =fdBo
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 30 May 2023 04:54:20 AM PDT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [undefined]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20230530-pull-request' of 
https://gitlab.com/juan.quintela/qemu: (21 commits)
  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()
  migration/rdma: Unfold hook_ram_load()
  migration/rdma: Remove all uses of RAM_CONTROL_HOOK
  migration/rdma: Unfold ram_control_after_iterate()
  migration/rdma: Unfold ram_control_before_iterate()
  migration: Create migrate_rdma()
  migration/rdma: Simplify the function that saves a page
  migration: Remove unused qemu_file_credit_transfer()
  migration/rdma: Don't use imaginary transfers
  migration/rdma: Remove QEMUFile parameter when not used
  migration/RDMA: It is accounting for zero/normal pages in two places
  migration: Don't abuse qemu_file transferred for RDMA
  migration: restore vmstate on migration failure
  migration: switch from .vm_was_running to .vm_old_state
  runstate: drop unused runstate_store()
  migration: never fail in global_state_store()
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/aa9bbd865502...a4423a37859c



reply via email to

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