qemu-e2k/migration
Markus Armbruster 811f865271 Revert "migration: move only_migratable to MigrationState"
This reverts commit 3df663e575.
This reverts commit b605c47b57.

Command line option --only-migratable is for disallowing any
configuration that can block migration.

Initially, --only-migratable set global variable @only_migratable.

Commit 3df663e575 "migration: move only_migratable to MigrationState"
replaced it by MigrationState member @only_migratable.  That was a
mistake.

First, it doesn't make sense on the design level.  MigrationState
captures the state of an individual migration, but --only-migratable
isn't a property of an individual migration, it's a restriction on
QEMU configuration.  With fault tolerance, we could have several
migrations at once.  --only-migratable would certainly protect all of
them.  Storing it in MigrationState feels inappropriate.

Second, it contributes to a dependency cycle that manifests itself as
a bug now.

Putting @only_migratable into MigrationState means its available only
after migration_object_init().

We can't set it before migration_object_init(), so we delay setting it
with a global property (this is fixup commit b605c47b57 "migration:
fix handling for --only-migratable").

We can't get it before migration_object_init(), so anything that uses
it can only run afterwards.

Since migrate_add_blocker() needs to obey --only-migratable, any code
adding migration blockers can run only afterwards.  This contributes
to the following dependency cycle:

* configure_blockdev() must run before machine_set_property()
  so machine properties can refer to block backends

* machine_set_property() before configure_accelerator()
  so machine properties like kvm-irqchip get applied

* configure_accelerator() before migration_object_init()
  so that Xen's accelerator compat properties get applied.

* migration_object_init() before configure_blockdev()
  so configure_blockdev() can add migration blockers

The cycle was closed when recent commit cda4aa9a5a "Create block
backends before setting machine properties" added the first
dependency, and satisfied it by violating the last one.  Broke block
backends that add migration blockers.

Moving @only_migratable into MigrationState was a mistake.  Revert it.

This doesn't quite break the "migration_object_init() before
configure_blockdev() dependency, since migrate_add_blocker() still has
another dependency on migration_object_init().  To be addressed the
next commit.

Note that the reverted commit made -only-migratable sugar for -global
migration.only-migratable=on below the hood.  Documentation has only
ever mentioned -only-migratable.  This commit removes the arcane &
undocumented alternative to -only-migratable again.  Nobody should be
using it.

Conflicts:
	include/migration/misc.h
	migration/migration.c
	migration/migration.h
	vl.c

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190401090827.20793-3-armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2019-04-02 13:38:05 +02:00
..
Makefile.objs COLO: Remove colo_state migration struct 2018-10-19 11:15:03 +08:00
block-dirty-bitmap.c bitmaps: Fix typo in function name 2019-03-12 12:05:49 -04:00
block.c migration/block: use qemu_iovec_init_buf 2019-02-22 09:42:13 +00:00
block.h migration: disable auto-converge during bulk block migration 2017-09-27 11:27:14 +01:00
channel.c migration: fix the multifd code when receiving less channels 2019-01-23 15:02:07 +00:00
channel.h migration: Route errors down through migration_channel_connect 2018-02-06 10:55:12 +00:00
colo-failover.c qapi/migration.json: Rename COLO unknown mode to none mode. 2018-10-19 11:15:03 +08:00
colo.c Migration/colo.c: Make user obtain the last COLO mode info after failover 2019-03-25 18:45:46 +01:00
exec.c migration: unify incoming processing 2018-07-10 12:48:53 +01:00
exec.h migration: Export exec.c functions in its own file 2017-06-01 18:49:22 +02:00
fd.c migration: unify incoming processing 2018-07-10 12:48:53 +01:00
fd.h migration: Export fd.c functions in its own file 2017-06-01 18:49:22 +02:00
global_state.c migration: Use strnlen() for fixed-size string 2019-01-17 21:10:57 -05:00
migration.c Revert "migration: move only_migratable to MigrationState" 2019-04-02 13:38:05 +02:00
migration.h Revert "migration: move only_migratable to MigrationState" 2019-04-02 13:38:05 +02:00
page_cache.c migration: use local path for local headers 2018-06-01 19:20:38 +03:00
page_cache.h migration: Make cache_init() take an error parameter 2017-10-23 18:03:25 +02:00
postcopy-ram.c migration: Add an ability to ignore shared RAM blocks 2019-03-06 10:49:17 +00:00
postcopy-ram.h postcopy: drop ram_pages parameter from postcopy_ram_incoming_init() 2018-06-27 13:28:31 +02:00
qemu-file-channel.c migration: invoke qio_channel_yield only when qemu_in_coroutine() 2018-08-22 12:13:59 +02:00
qemu-file-channel.h migration: Export qemu-file-channel.c functions in its own file 2017-05-18 19:20:50 +02:00
qemu-file.c migration: disable RDMA WRITE after postcopy started 2018-08-22 12:12:07 +02:00
qemu-file.h slirp: use libslirp migration code 2019-03-07 12:46:31 +01:00
qjson.c qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
qjson.h typedefs: add QJSON 2018-06-15 14:40:56 +01:00
ram.c multifd: Add some padding 2019-03-25 18:13:44 +01:00
ram.h migration: multifd_save_cleanup() can't fail, simplify 2019-01-23 15:02:07 +00:00
rdma.c migration/rdma: Check qemu_rdma_init_one_block 2019-03-25 18:45:10 +01:00
rdma.h migration: Export rdma.c functions in its own file 2017-06-01 18:49:23 +02:00
savevm.c Revert "migration: move only_migratable to MigrationState" 2019-04-02 13:38:05 +02:00
savevm.h savevm: split the process of different stages for loadvm/savevm 2018-10-19 11:15:03 +08:00
socket.c migration: fix memory leak 2019-03-12 15:18:40 +01:00
socket.h migration: Export functions to create send channels 2018-05-15 20:24:27 +02:00
tls.c migration: add support for a "tls-authz" migration parameter 2019-03-25 18:13:47 +01:00
tls.h migration: Export tls.c functions in its own file 2017-06-01 18:49:23 +02:00
trace-events Pull request 2019-03-25 18:15:43 +00:00
vmstate-types.c vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
vmstate.c migration: Add post_save function to VMStateDescription 2019-01-21 10:38:55 +00:00
xbzrle.c migration: Create migration/xbzrle.h 2017-05-18 18:04:54 +02:00
xbzrle.h migration: Create migration/xbzrle.h 2017-05-18 18:04:54 +02:00