Miscellaneous patches for 2019-04-02

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJco01zAAoJEDhwtADrkYZTzJkP/1izIRaWBMOwhwwDORgdxIro
 Qgd8cgXSiC2WAPtagEdaQQRtYdEwlBTCcnRBqXQixWnJ52FnaijwRdUx2cwTXP2x
 rX0G0inhS7xE7P9Zr9sPhTMafLN5kUyFsm5WsZZbLDcimXMZtAYm7vZAdvneMfMj
 MjOu7FXLtlwvU2Gg1z8Kog3+ShkafHsUm1lQnAp2YQSsSCHRIazTuyyqIpqZEyUt
 ie7zI7GMA0arIJfNQSfrgLiquD4Rj+Cn4RHp4RnKeGTExhNrZJcSk3+IUz25MJIK
 O+Rlftr+iHk/FzoAa0NeASaNuI+cUjbxTEJwvz+sbulSVLBX58pP22vxh4wauslm
 VjrHzj5xRo6w6RKPmkJn0CgJnIAGc7Ulzyt/gpVT+Qm2SRY5EnV3KoEtYcU7xtHw
 uK8YRWThadkG+nHc2LOR8DjjT/h+JitpjwvPadt2NZpoGZkrvGuKZAJ4TKf8Yv0z
 eiyfxV4trZisCEInIcMOVa7cAhO7i7/eUO1/IFNrD+X++/BTWFAlW3cqj41PUl+E
 exGWHHP+Z08TFV2kKobmee1xrv1RRhdFYk8BcWHS83fxqHNGCoPHE/dfB/kJGCMr
 96JE6LTDVIRmMHQjzs0nMHtTZPfaONvdjHuv9kuQj6wnbjYAE8z0ZlcnEa9sSZZQ
 CcaSZLqGJstkoUJwRZQx
 =yOO7
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-04-02' into staging

Miscellaneous patches for 2019-04-02

# gpg: Signature made Tue 02 Apr 2019 12:54:27 BST
# gpg:                using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-misc-2019-04-02:
  accel: Unbreak accelerator fallback
  vl: Document dependencies hiding in global and compat props
  migration: Support adding migration blockers earlier
  Revert "migration: move only_migratable to MigrationState"
  Revert "vl: Fix to create migration object before block backends again"
  qapi/migration.json: Rename COLOStatus last_mode to last-mode
  qapi/migration.json: Fix ColoStatus member last_mode's version
  vl: Fix error location of positional arguments

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-04-02 16:13:59 +01:00
commit 37301a8d0f
7 changed files with 44 additions and 27 deletions

View File

@ -65,8 +65,9 @@ static int accel_init_machine(AccelClass *acc, MachineState *ms)
ms->accelerator = NULL;
*(acc->allowed) = false;
object_unref(OBJECT(accel));
} else {
object_set_accelerator_compat_props(acc->compat_props);
}
object_set_accelerator_compat_props(acc->compat_props);
return ret;
}

View File

@ -14,6 +14,7 @@
/* vl.c */
extern const char *bios_name;
extern int only_migratable;
extern const char *qemu_name;
extern QemuUUID qemu_uuid;
extern bool qemu_uuid_set;

View File

@ -1646,7 +1646,11 @@ bool migration_in_postcopy_after_devices(MigrationState *s)
bool migration_is_idle(void)
{
MigrationState *s = migrate_get_current();
MigrationState *s = current_migration;
if (!s) {
return true;
}
switch (s->state) {
case MIGRATION_STATUS_NONE:
@ -1707,7 +1711,7 @@ static GSList *migration_blockers;
int migrate_add_blocker(Error *reason, Error **errp)
{
if (migrate_get_current()->only_migratable) {
if (only_migratable) {
error_propagate_prepend(errp, error_copy(reason),
"disallowing migration blocker "
"(--only_migratable) for: ");
@ -3337,7 +3341,7 @@ void migration_global_dump(Monitor *mon)
monitor_printf(mon, "store-global-state: %s\n",
ms->store_global_state ? "on" : "off");
monitor_printf(mon, "only-migratable: %s\n",
ms->only_migratable ? "on" : "off");
only_migratable ? "on" : "off");
monitor_printf(mon, "send-configuration: %s\n",
ms->send_configuration ? "on" : "off");
monitor_printf(mon, "send-section-footer: %s\n",
@ -3352,7 +3356,6 @@ void migration_global_dump(Monitor *mon)
static Property migration_properties[] = {
DEFINE_PROP_BOOL("store-global-state", MigrationState,
store_global_state, true),
DEFINE_PROP_BOOL("only-migratable", MigrationState, only_migratable, false),
DEFINE_PROP_BOOL("send-configuration", MigrationState,
send_configuration, true),
DEFINE_PROP_BOOL("send-section-footer", MigrationState,

View File

@ -219,9 +219,6 @@ struct MigrationState
*/
bool store_global_state;
/* Whether the VM is only allowing for migratable devices */
bool only_migratable;
/* Whether we send QEMU_VM_CONFIGURATION during migration */
bool send_configuration;
/* Whether we send section footer during migration */

View File

@ -2844,7 +2844,7 @@ void vmstate_register_ram_global(MemoryRegion *mr)
bool vmstate_check_only_migratable(const VMStateDescription *vmsd)
{
/* check needed if --only-migratable is specified */
if (!migrate_get_current()->only_migratable) {
if (!only_migratable) {
return true;
}

View File

@ -1380,16 +1380,16 @@
# @mode: COLO running mode. If COLO is running, this field will return
# 'primary' or 'secondary'.
#
# @last_mode: COLO last running mode. If COLO is running, this field
# @last-mode: COLO last running mode. If COLO is running, this field
# will return same like mode field, after failover we can
# use this field to get last colo mode. (since 4.1)
# use this field to get last colo mode. (since 4.0)
#
# @reason: describes the reason for the COLO exit.
#
# Since: 3.1
##
{ 'struct': 'COLOStatus',
'data': { 'mode': 'COLOMode', 'last_mode': 'COLOMode',
'data': { 'mode': 'COLOMode', 'last-mode': 'COLOMode',
'reason': 'COLOExitReason' } }
##

45
vl.c
View File

@ -185,6 +185,7 @@ const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
bool boot_strict;
uint8_t *boot_splash_filedata;
int only_migratable; /* turn it off unless user states otherwise */
bool wakeup_suspend_enabled;
int icount_align_option;
@ -3119,6 +3120,7 @@ int main(int argc, char **argv, char **envp)
if (optind >= argc)
break;
if (argv[optind][0] != '-') {
loc_set_cmdline(argv, optind, 1);
drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
} else {
const QEMUOption *popt;
@ -3799,13 +3801,7 @@ int main(int argc, char **argv, char **envp)
incoming = optarg;
break;
case QEMU_OPTION_only_migratable:
/*
* TODO: we can remove this option one day, and we
* should all use:
*
* "-global migration.only-migratable=true"
*/
qemu_global_option("migration.only-migratable=true");
only_migratable = 1;
break;
case QEMU_OPTION_nodefaults:
has_defaults = 0;
@ -4276,17 +4272,10 @@ int main(int argc, char **argv, char **envp)
exit(0);
}
/*
* Migration object can only be created after global properties
* are applied correctly.
*/
migration_object_init();
/*
* Note: we need to create block backends before
* machine_set_property(), so machine properties can refer to
* them, and after migration_object_init(), so we can create
* migration blockers.
* them.
*/
configure_blockdev(&bdo_queue, machine_class, snapshot);
@ -4297,13 +4286,39 @@ int main(int argc, char **argv, char **envp)
current_machine->maxram_size = maxram_size;
current_machine->ram_slots = ram_slots;
/*
* Note: uses machine properties such as kernel-irqchip, must run
* after machine_set_property().
*/
configure_accelerator(current_machine, argv[0]);
/*
* Beware, QOM objects created before this point miss global and
* compat properties.
*
* Global properties get set up by qdev_prop_register_global(),
* called from user_register_global_props(), and certain option
* desugaring. Also in CPU feature desugaring (buried in
* parse_cpu_model()), which happens below this point, but may
* only target the CPU type, which can only be created after
* parse_cpu_model() returned the type.
*
* Machine compat properties: object_set_machine_compat_props().
* Accelerator compat props: object_set_accelerator_compat_props(),
* called from configure_accelerator().
*/
if (!qtest_enabled() && machine_class->deprecation_reason) {
error_report("Machine type '%s' is deprecated: %s",
machine_class->name, machine_class->deprecation_reason);
}
/*
* Note: creates a QOM object, must run only after global and
* compat properties have been set up.
*/
migration_object_init();
if (qtest_chrdev) {
qtest_init(qtest_chrdev, qtest_log, &error_fatal);
}