qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 9cf2ba: migration/rdma: Fix race on source


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9cf2ba: migration/rdma: Fix race on source
Date: Wed, 19 Jul 2017 05:43:16 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9cf2bab2edca1e651eef49f2417f8f67bdfe49bb
      
https://github.com/qemu/qemu/commit/9cf2bab2edca1e651eef49f2417f8f67bdfe49bb
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Fix race on source

Fix a race where the destination might try and send the source a
WRID_READY before the source has done a post-recv for it.

rdma_post_recv has to happen after the qp exists, and we're
OK since we've already called qemu_rdma_source_init that calls
qemu_alloc_qp.

This corresponds to:
https://bugzilla.redhat.com/show_bug.cgi?id=1285044

The race can be triggered by adding a few ms wait before this
post_recv_control (which was originally due to me turning on loads of
debug).

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


  Commit: 3a0f2ceaedcf70ff79b671f7fb3b7ec8e71f6e1e
      
https://github.com/qemu/qemu/commit/3a0f2ceaedcf70ff79b671f7fb3b7ec8e71f6e1e
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: Close file on failed migration load

Closing the file before exit on a failure allows
the source to cleanup better, especially with RDMA.

Partial fix for https://bugs.launchpad.net/qemu/+bug/1545052

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


  Commit: 0b3c15f09715acd78063e720444cc86ac357bab4
      
https://github.com/qemu/qemu/commit/0b3c15f09715acd78063e720444cc86ac357bab4
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: fix qemu_rdma_block_for_wrid error paths

The two places that 'goto err_block_for_wrid' weren't setting ret
and so would end up returning 0 even though we've failed.

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


  Commit: 9c98cfbe72b21d9d84b9ea8d231bde103b9fb7ae
      
https://github.com/qemu/qemu/commit/9c98cfbe72b21d9d84b9ea8d231bde103b9fb7ae
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Allow cancelling while waiting for wrid

When waiting for a WRID, if the other side dies we end up waiting
for ever with no way to cancel the migration.
Cure this by poll()ing the fd first with a timeout and checking
error flags and migration state.

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


  Commit: 482a33c53cbc9d2b0c47d4df03b659bf50258c21
      
https://github.com/qemu/qemu/commit/482a33c53cbc9d2b0c47d4df03b659bf50258c21
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Safely convert control types

control_desc[] is an array of strings that correspond to a
series of message types; they're used only for error messages, but if
the message type is seriously broken then we could go off the end of
the array.

Convert the array to a function control_desc() that bound checks.

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


  Commit: 32bce196344772df8d68ab40e2dd1dd57be1aa7c
      
https://github.com/qemu/qemu/commit/32bce196344772df8d68ab40e2dd1dd57be1aa7c
  Author: Dr. David Alan Gilbert <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: Send error during cancelling

When we issue a cancel and clean up the RDMA channel
send a CONTROL_ERROR to get the destination to quit.

The rdma_cleanup code waits for the event to come back
from the rdma_disconnect; but that wont happen until the
destination quits and there's currently nothing to force
it.

Note this makes the case of a cancel work while the destination
is alive, and it already works if the destination is
truly dead.  Note it doesn't fix the case where the destination
is hung (we get stuck waiting for the rdma_disconnect event).

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


  Commit: 07d1d063d3235c02f60dc92ec174d419e6f8a750
      
https://github.com/qemu/qemu/commit/07d1d063d3235c02f60dc92ec174d419e6f8a750
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M hw/core/qdev-properties.c
    M include/hw/qdev-properties.h

  Log Message:
  -----------
  qdev: provide DEFINE_PROP_INT64()

We have nearly all the stuff, but this one is missing. Add it in.

Am going to use this new helper for MigrationParameters fields, since
most of them are int64_t.

CC: Markus Armbruster <address@hidden>
CC: Eduardo Habkost <address@hidden>
CC: Marc-André Lureau <address@hidden>
CC: Peter Xu <address@hidden>
CC: Juan Quintela <address@hidden>
CC: Marcel Apfelbaum <address@hidden>
CC: Eric Blake <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 89632fafdc64927647b6f45416307cd3d4c746db
      
https://github.com/qemu/qemu/commit/89632fafdc64927647b6f45416307cd3d4c746db
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: export parameters to props

Export migration parameters to qdev properties. Then we can use, for
example:

  -global migration.x-cpu-throttle-initial=xxx

To specify migration parameters during init.

Prefix "x-" is appended for each parameter exported to show that this is
not a stable interface, and only for debugging/testing purpose.

Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 2081475841fe80f2832677b6cc851cbe79ce44d6
      
https://github.com/qemu/qemu/commit/2081475841fe80f2832677b6cc851cbe79ce44d6
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: export capabilities to props

Do the same thing to migration capabilities, just like what we did in
previous patch for migration parameters.

Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 16d063bc2a8baeb5466bc5b0fa9b0dbb59b3b08b
      
https://github.com/qemu/qemu/commit/16d063bc2a8baeb5466bc5b0fa9b0dbb59b3b08b
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: introduce migrate_params_check()

Helper to check the parameters. Abstracted from
qmp_migrate_set_parameters().

Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 476c72aa918d583a5c9c105bf764f0bec650fbc9
      
https://github.com/qemu/qemu/commit/476c72aa918d583a5c9c105bf764f0bec650fbc9
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: provide migrate_params_apply()

Abstracted from qmp_migrate_set_parameters().

Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 8b0b29dcec59730e6b21b253a6b43271cb3d831b
      
https://github.com/qemu/qemu/commit/8b0b29dcec59730e6b21b253a6b43271cb3d831b
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: check global params for validity

Adding validity check for the migration parameters passed in via global
properties.

Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: fd198f9002a9e1f070c82b04d3229c18d9a49471
      
https://github.com/qemu/qemu/commit/fd198f9002a9e1f070c82b04d3229c18d9a49471
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

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

  Log Message:
  -----------
  migration: remove check against colo support

Since commit a15215f3 ("build: remove --enable-colo/--disable-colo"),
colo is always supported. We don't need any colo_supported() now since
it is always true. Removing any extra code that depends on it.

CC: Paolo Bonzini <address@hidden>
CC: Hailiang Zhang <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Reviewed-by: Zhang Chen<address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 4a84214ebe1695405f58e5c6272d63d6084edfa5
      
https://github.com/qemu/qemu/commit/4a84214ebe1695405f58e5c6272d63d6084edfa5
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: provide migrate_caps_check()

Abstract helper function to check migration capabilities (from the old
qmp_migrate_set_capabilities).  Prepare to be used somewhere else.

There is side effect on the change: when applying the capabilities, we
were skipping the invalid ones, but still applying the valid ones (if
they are provided in the same QMP request). After this refactoring,
we'll ignore all the capabilities if we detected invalid setup along the
way. However, I don't think it is a problem since general users should
not provide anything invalid after all.

Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 4e4a3d3aa691aee305f07abaf7f0a125baa585c6
      
https://github.com/qemu/qemu/commit/4e4a3d3aa691aee305f07abaf7f0a125baa585c6
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: provide migrate_cap_add()

Abstracted from migrate_set_block_enabled() to allocate
MigrationCapabilityStatusList properly.

Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 6b19a7d91c8de9904c67b87203a46e55db4181ab
      
https://github.com/qemu/qemu/commit/6b19a7d91c8de9904c67b87203a46e55db4181ab
  Author: Peter Xu <address@hidden>
  Date:   2017-07-18 (Tue, 18 Jul 2017)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: check global caps for validity

Checks validity for all the capabilities that we enabled with command
line.

Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>


  Commit: 988879b66ed8dfd1055492d36188f6c10c268644
      
https://github.com/qemu/qemu/commit/988879b66ed8dfd1055492d36188f6c10c268644
  Author: Peter Maydell <address@hidden>
  Date:   2017-07-19 (Wed, 19 Jul 2017)

  Changed paths:
    M hw/core/qdev-properties.c
    M include/hw/qdev-properties.h
    M include/migration/colo.h
    M migration/colo.c
    M migration/migration.c
    M migration/rdma.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170718' 
into staging

migration/next for 20170718

# gpg: Signature made Tue 18 Jul 2017 16:39:33 BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <address@hidden>"
# gpg:                 aka "Juan Quintela <address@hidden>"
# 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

* remotes/juanquintela/tags/migration/20170718:
  migration: check global caps for validity
  migration: provide migrate_cap_add()
  migration: provide migrate_caps_check()
  migration: remove check against colo support
  migration: check global params for validity
  migration: provide migrate_params_apply()
  migration: introduce migrate_params_check()
  migration: export capabilities to props
  migration: export parameters to props
  qdev: provide DEFINE_PROP_INT64()
  migration/rdma: Send error during cancelling
  migration/rdma: Safely convert control types
  migration/rdma: Allow cancelling while waiting for wrid
  migration/rdma: fix qemu_rdma_block_for_wrid error paths
  migration: Close file on failed migration load
  migration/rdma: Fix race on source

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


Compare: https://github.com/qemu/qemu/compare/f1a46e888515...988879b66ed8

reply via email to

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