qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 8f8d52: migration: use migration_is_active to


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 8f8d52: migration: use migration_is_active to represent ac...
Date: Mon, 14 Oct 2019 09:08:21 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 8f8d528e73144c063deafc534df0a04c67f6f98e
      
https://github.com/qemu/qemu/commit/8f8d528e73144c063deafc534df0a04c67f6f98e
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

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

  Log Message:
  -----------
  migration: use migration_is_active to represent active state

Wrap the check into a function to make it easy to read.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 5626f8c6d46832b02ce4fdc0bd109516bc812043
      
https://github.com/qemu/qemu/commit/5626f8c6d46832b02ce4fdc0bd109516bc812043
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M docs/devel/rcu.txt
    M include/qemu/rcu.h

  Log Message:
  -----------
  rcu: Add automatically released rcu_read_lock variants

RCU_READ_LOCK_GUARD() takes the rcu_read_lock and then uses glib's
g_auto infrastructure (and thus whatever the compiler's hooks are) to
release it on all exits of the block.

WITH_RCU_READ_LOCK_GUARD() is similar but is used as a wrapper for the
lock, i.e.:

   WITH_RCU_READ_LOCK_GUARD() {
       stuff under lock
   }

Note the 'unused' attribute is needed to work around clang bug:
  https://bugs.llvm.org/show_bug.cgi?id=43482

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 0e6ebd487743b1c79ad8d8a9005ce989bbaddb6c
      
https://github.com/qemu/qemu/commit/0e6ebd487743b1c79ad8d8a9005ce989bbaddb6c
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Fix missing rcu_read_unlock

Use the automatic rcu_read unlocker to fix a missing unlock.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 89ac5a1d2a32e9cc520ed5a8a2ff217e11a962eb
      
https://github.com/qemu/qemu/commit/89ac5a1d2a32e9cc520ed5a8a2ff217e11a962eb
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration: Use automatic rcu_read unlock in ram.c

Use the automatic read unlocker in migration/ram.c

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 987ab2a54927fe43b93787b7a49734c9f59d3264
      
https://github.com/qemu/qemu/commit/987ab2a54927fe43b93787b7a49734c9f59d3264
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration: Use automatic rcu_read unlock in rdma.c

Use the automatic read unlocker in migration/rdma.c.

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 694ea274d9236cada361282960e3a0aba660dee5
      
https://github.com/qemu/qemu/commit/694ea274d9236cada361282960e3a0aba660dee5
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M exec.c
    M include/exec/ram_addr.h
    M memory.c

  Log Message:
  -----------
  rcu: Use automatic rc_read unlock in core memory/exec code

Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: fb14a42ade228e2d6123af56c0015262fd83250d
      
https://github.com/qemu/qemu/commit/fb14a42ade228e2d6123af56c0015262fd83250d
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: Don't try and recover return path in non-postcopy

In normal precopy we can't do reconnection recovery - but we also
don't need to, since you can just rerun migration.
At the moment if the 'return-path' capability is on, we use
the return path in precopy to give a positive 'OK' to the end
of migration; however if migration fails then we fall into
the postcopy recovery path and hang.  This fixes it by only
running the return path in the postcopy case.

Reported-by: Greg Kurz <address@hidden>
Tested-by: Greg Kurz <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 3414322a83be11b86166d2a53432615092bdcbb8
      
https://github.com/qemu/qemu/commit/3414322a83be11b86166d2a53432615092bdcbb8
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/postcopy-ram.c
    M migration/postcopy-ram.h
    M migration/ram.c

  Log Message:
  -----------
  migration/postcopy: allocate tmp_page in setup stage

During migration, a tmp page is allocated so that we could place a whole
host page during postcopy.

Currently the page is allocated during load stage, this is a little bit
late. And more important, if we failed to allocate it, the error is not
checked properly. Even it is NULL, we would still use it.

This patch moves the allocation to setup stage and if failed error
message would be printed and caller would notice it.

Signed-off-by: Wei Yang <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 6629890d55e8faca765c7dba29c659ad7d9efae9
      
https://github.com/qemu/qemu/commit/6629890d55e8faca765c7dba29c659ad7d9efae9
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/postcopy-ram.c

  Log Message:
  -----------
  migration/postcopy: map large zero page in postcopy_ram_incoming_setup()

postcopy_ram_incoming_setup() and postcopy_ram_incoming_cleanup() are
counterpart. It is reasonable to map/unmap large zero page in these two
functions respectively.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: da1725d3f9723668a61a3b83f1bf94ce14fc4e4b
      
https://github.com/qemu/qemu/commit/da1725d3f9723668a61a3b83f1bf94ce14fc4e4b
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/postcopy-ram.c

  Log Message:
  -----------
  migration/postcopy: fix typo in mark_postcopy_blocktime_begin's comment

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 17d9351bf2415fb66500575665a22fac15b80d10
      
https://github.com/qemu/qemu/commit/17d9351bf2415fb66500575665a22fac15b80d10
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: pass in_postcopy instead of check state again

Not necessary to do the check again.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 4991f3091ede9d05312447c12e914481032185c0
      
https://github.com/qemu/qemu/commit/4991f3091ede9d05312447c12e914481032185c0
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration: report SaveStateEntry id and name on failure

This provides helpful information on which entry failed.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 2a461c2467bb58e034c857e47a4a530bdca22227
      
https://github.com/qemu/qemu/commit/2a461c2467bb58e034c857e47a4a530bdca22227
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration/postcopy: mis->have_listen_thread check will never be touched

If mis->have_listen_thread is true, this means current PostcopyState
must be LISTENING or RUNNING. While the check at the beginning of the
function makes sure the state transaction happens when its previous
PostcopyState is ADVISE or DISCARD.

This means we would never touch this check.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 2d49bacda00876736c746ce1fcea006a128bef6b
      
https://github.com/qemu/qemu/commit/2d49bacda00876736c746ce1fcea006a128bef6b
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/postcopy-ram.c
    M migration/savevm.c

  Log Message:
  -----------
  migration/postcopy: postpone setting PostcopyState to END

There are two places to call function postcopy_ram_incoming_cleanup()

    postcopy_ram_listen_thread on migration success
    loadvm_postcopy_handle_listen one setup failure

On success, the vm will never accept another migration. On failure,
PostcopyState is transited from LISTENING to END and would be checked in
qemu_loadvm_state_main(). If PostcopyState is RUNNING, migration would
be paused and retried.

Currently PostcopyState is set to END in function
postcopy_ram_incoming_cleanup(). With above analysis, we can take this
step out and postpone this till the end of listen thread to indicate the
listen thread is done.

This is a preparation patch for later cleanup.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
  Fixed up in merge to the 1 parameter postcopy_state_set


  Commit: 2a7eb14844c1b71df58aa980f7253bddc6f11676
      
https://github.com/qemu/qemu/commit/2a7eb14844c1b71df58aa980f7253bddc6f11676
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/postcopy-ram.c
    M migration/postcopy-ram.h
    M migration/savevm.c

  Log Message:
  -----------
  migration/postcopy: rename postcopy_ram_enable_notify to 
postcopy_ram_incoming_setup

Function postcopy_ram_incoming_setup and postcopy_ram_incoming_cleanup
is a pair. Rename to make it clear for audience.

Signed-off-by: Wei Yang <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 0197d89025d768f3a2505ea50816fbc6b161b992
      
https://github.com/qemu/qemu/commit/0197d89025d768f3a2505ea50816fbc6b161b992
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/savevm.c

  Log Message:
  -----------
  migration/postcopy: check PostcopyState before setting to 
POSTCOPY_INCOMING_RUNNING

Currently, we set PostcopyState blindly to RUNNING, even we found the
previous state is not LISTENING. This will lead to a corner case.

First let's look at the code flow:

qemu_loadvm_state_main()
    ret = loadvm_process_command()
        loadvm_postcopy_handle_run()
            return -1;
    if (ret < 0) {
        if (postcopy_state_get() == POSTCOPY_INCOMING_RUNNING)
            ...
    }

>From above snippet, the corner case is loadvm_postcopy_handle_run()
always sets state to RUNNING. And then it checks the previous state. If
the previous state is not LISTENING, it will return -1. But at this
moment, PostcopyState is already been set to RUNNING.

Then ret is checked in qemu_loadvm_state_main(), when it is -1
PostcopyState is checked. Current logic would pause postcopy and retry
if PostcopyState is RUNNING. This is not what we expect, because
postcopy is not active yet.

This patch makes sure state is set to RUNNING only previous state is
LISTENING by checking the state first.

Signed-off-by: Wei Yang <address@hidden>
Suggested by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: d884e77bfe384000a56ea13f448df314add84889
      
https://github.com/qemu/qemu/commit/d884e77bfe384000a56ea13f448df314add84889
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/multifd: fix a typo in comment of multifd_recv_unfill_packet()

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: f2148c4c793f67e24ff97ddf12c8eeccdba9fb8e
      
https://github.com/qemu/qemu/commit/f2148c4c793f67e24ff97ddf12c8eeccdba9fb8e
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/multifd: use pages->allocated instead of the static max

multifd_send_fill_packet() prepares meta data for following pages to
transfer. It would be more proper to fill pages->allocated instead of
static max value, especially we want to support flexible packet size.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 9985e1f48db7449421dafdc22d275551072f0a06
      
https://github.com/qemu/qemu/commit/9985e1f48db7449421dafdc22d275551072f0a06
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/multifd: initialize packet->magic/version once at setup stage

MultiFDPacket_t's magic and version field never changes during
migration, so move these two fields in setup stage.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: aff66d2ef024372a27761959b46a306a6ab92f47
      
https://github.com/qemu/qemu/commit/aff66d2ef024372a27761959b46a306a6ab92f47
  Author: Wei Yang <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M migration/ram.c

  Log Message:
  -----------
  migration/multifd: pages->used would be cleared when attach to 
multifd_send_state

When we found an available channel in multifd_send_pages(), its
pages->used is cleared and then attached to multifd_send_state.

It is not necessary to do this twice.

Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>


  Commit: 9a85e4b8f672016adbf7b7d5beaab2a99b9b5615
      
https://github.com/qemu/qemu/commit/9a85e4b8f672016adbf7b7d5beaab2a99b9b5615
  Author: Eric Auger <address@hidden>
  Date:   2019-10-11 (Fri, 11 Oct 2019)

  Changed paths:
    M include/migration/vmstate.h
    M migration/trace-events
    M migration/vmstate-types.c
    M tests/test-vmstate.c

  Log Message:
  -----------
  migration: Support gtree migration

Introduce support for GTree migration. A custom save/restore
is implemented. Each item is made of a key and a data.

If the key is a pointer to an object, 2 VMSDs are passed into
the GTree VMStateField.

When putting the items, the tree is traversed in sorted order by
g_tree_foreach.

On the get() path, gtrees must be allocated using the proper
key compare, key destroy and value destroy. This must be handled
beforehand, for example in a pre_load method.

Tests are added to test save/dump of structs containing gtrees
including the virtio-iommu domain/mappings scenario.

Signed-off-by: Eric Auger <address@hidden>

Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
  uintptr_t fixup for test on 32bit


  Commit: c760cb77e511eb05094df67c1b30029a952efa35
      
https://github.com/qemu/qemu/commit/c760cb77e511eb05094df67c1b30029a952efa35
  Author: Peter Maydell <address@hidden>
  Date:   2019-10-14 (Mon, 14 Oct 2019)

  Changed paths:
    M docs/devel/rcu.txt
    M exec.c
    M include/exec/ram_addr.h
    M include/migration/misc.h
    M include/migration/vmstate.h
    M include/qemu/rcu.h
    M memory.c
    M migration/migration.c
    M migration/postcopy-ram.c
    M migration/postcopy-ram.h
    M migration/ram.c
    M migration/rdma.c
    M migration/savevm.c
    M migration/trace-events
    M migration/vmstate-types.c
    M tests/test-vmstate.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20191011a' 
into staging

Migration pull 2019-10-11

Mostly cleanups and minor fixes

[Note I'm seeing a hang on the aarch64 hosted x86-64 tcg migration
test in xbzrle; but I'm seeing that on current head as well]

# gpg: Signature made Fri 11 Oct 2019 20:14:31 BST
# gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <address@hidden>" 
[full]
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert/tags/pull-migration-20191011a: (21 commits)
  migration: Support gtree migration
  migration/multifd: pages->used would be cleared when attach to 
multifd_send_state
  migration/multifd: initialize packet->magic/version once at setup stage
  migration/multifd: use pages->allocated instead of the static max
  migration/multifd: fix a typo in comment of multifd_recv_unfill_packet()
  migration/postcopy: check PostcopyState before setting to 
POSTCOPY_INCOMING_RUNNING
  migration/postcopy: rename postcopy_ram_enable_notify to 
postcopy_ram_incoming_setup
  migration/postcopy: postpone setting PostcopyState to END
  migration/postcopy: mis->have_listen_thread check will never be touched
  migration: report SaveStateEntry id and name on failure
  migration: pass in_postcopy instead of check state again
  migration/postcopy: fix typo in mark_postcopy_blocktime_begin's comment
  migration/postcopy: map large zero page in postcopy_ram_incoming_setup()
  migration/postcopy: allocate tmp_page in setup stage
  migration: Don't try and recover return path in non-postcopy
  rcu: Use automatic rc_read unlock in core memory/exec code
  migration: Use automatic rcu_read unlock in rdma.c
  migration: Use automatic rcu_read unlock in ram.c
  migration: Fix missing rcu_read_unlock
  rcu: Add automatically released rcu_read_lock variants
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/22dbfdecc3c5...c760cb77e511



reply via email to

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