mirror_qemu/include/sysemu
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
..
accel.h accel: Improve selection of the default accelerator 2019-01-11 13:57:23 +01:00
arch_init.h qapi: make query-cpu-definitions depend on specific targets 2019-02-18 14:44:05 +01:00
balloon.h avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
block-backend.h block: Add bdrv_get_request_alignment() 2019-04-01 08:46:52 -05:00
blockdev.h blockdev: Convert drive_new() to Error 2018-10-19 14:51:34 +02:00
bt.h hw/bt: Remove HCIInfo from "qemu/typedefs.h" 2019-01-22 05:14:32 +01:00
cpus.h migration: Mark CPU states dirty before incoming migration/loadvm 2017-06-06 08:53:24 +10:00
cryptodev-vhost-user.h cryptodev-vhost-user: set the key length 2018-03-01 18:26:17 +02:00
cryptodev-vhost.h cryptodev: add vhost-user as a new cryptodev backend 2018-03-01 18:26:17 +02:00
cryptodev.h cryptodev: add vhost support 2018-03-01 18:26:17 +02:00
device_tree.h device_tree: Add qemu_fdt_node_unit_path 2018-06-29 15:11:01 +01:00
dma.h Make address_space_access_valid() take a MemTxAttrs argument 2018-05-31 16:32:35 +01:00
dump-arch.h dump: allow target to set the physical base 2016-01-15 14:40:25 +00:00
dump.h qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
hax.h hax: Support guest RAM sizes of 4GB or more 2018-02-13 11:44:13 +01:00
hostmem.h hostmem: use object id for memory region name with >= 4.0 2019-01-07 16:18:42 +04:00
hvf.h i386: hvf: Remove hvf_disabled 2018-10-19 13:44:12 +02:00
hw_accel.h Add the WHPX acceleration enlightenments 2018-02-07 14:09:26 +01:00
iothread.h iothread: create the gcontext unconditionally 2019-03-08 10:16:15 +00:00
kvm.h qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
kvm_int.h kvm: Delete the slot if and only if the KVM_MEM_READONLY flag is changed 2018-06-28 19:05:31 +02:00
memory_mapping.h qemu/queue.h: simplify reverse access to QTAILQ 2019-01-11 15:46:55 +01:00
numa.h numa: Match struct to typedef name 2018-12-11 15:45:22 -02:00
os-posix.h util: drop old utimensat() compat code 2017-05-25 10:30:14 +02:00
os-win32.h log: Add locking to large logging blocks 2016-11-01 10:29:03 -06:00
qtest.h include: Clean up includes 2016-02-23 12:43:05 +00:00
replay.h replay: pass raw icount value to replay_save_clock 2018-10-19 13:44:15 +02:00
reset.h hw: move reset handlers from vl.c to hw/core 2017-01-16 17:52:35 +01:00
rng-random.h rng-random: rename RndRandom to RngRandom 2016-05-23 12:18:43 +05:30
rng.h qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
seccomp.h sandbox: disable -sandbox if CONFIG_SECCOMP undefined 2018-06-01 13:44:15 +02:00
sev.h kvm: introduce memory encryption APIs 2018-03-13 12:04:03 +01:00
sysemu.h Revert "migration: move only_migratable to MigrationState" 2019-04-02 13:38:05 +02:00
tpm.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
tpm_backend.h Drop superfluous includes of qapi-types.h and test-qapi-types.h 2018-02-09 05:05:11 +01:00
watchdog.h Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
whpx.h Clean up includes 2018-12-20 10:29:08 +01:00
xen-mapcache.h xen/hvm: correct reporting of modified memory under physmap during migration 2018-05-31 12:04:54 -07:00