Merge branch 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable

* 'queue/qmp' of git://repo.or.cz/qemu/qmp-unstable:
  migration: go to paused state after finishing incoming migration with -S
  qmp: handle stop/cont in INMIGRATE state
  hmp: fix info cpus for sparc targets
This commit is contained in:
Aurelien Jarno 2012-10-29 14:55:51 +01:00
commit 3f4331bfd1
6 changed files with 32 additions and 26 deletions

1
hmp.c
View file

@ -254,7 +254,6 @@ void hmp_info_cpus(Monitor *mon)
monitor_printf(mon, " nip=0x%016" PRIx64, cpu->value->nip); monitor_printf(mon, " nip=0x%016" PRIx64, cpu->value->nip);
} }
if (cpu->value->has_npc) { if (cpu->value->has_npc) {
monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc);
monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->npc); monitor_printf(mon, " npc=0x%016" PRIx64, cpu->value->npc);
} }
if (cpu->value->has_PC) { if (cpu->value->has_PC) {

View file

@ -99,7 +99,7 @@ void process_incoming_migration(QEMUFile *f)
if (autostart) { if (autostart) {
vm_start(); vm_start();
} else { } else {
runstate_set(RUN_STATE_PRELAUNCH); runstate_set(RUN_STATE_PAUSED);
} }
} }

View file

@ -22,15 +22,11 @@
# @KVMMissingCap: the requested operation can't be fulfilled because a # @KVMMissingCap: the requested operation can't be fulfilled because a
# required KVM capability is missing # required KVM capability is missing
# #
# @MigrationExpected: the requested operation can't be fulfilled because a
# migration process is expected
#
# Since: 1.2 # Since: 1.2
## ##
{ 'enum': 'ErrorClass', { 'enum': 'ErrorClass',
'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted', 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap', 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
'MigrationExpected' ] }
## ##
# @add_client # @add_client
@ -149,7 +145,11 @@
# #
# @finish-migrate: guest is paused to finish the migration process # @finish-migrate: guest is paused to finish the migration process
# #
# @inmigrate: guest is paused waiting for an incoming migration # @inmigrate: guest is paused waiting for an incoming migration. Note
# that this state does not tell whether the machine will start at the
# end of the migration. This depends on the command-line -S option and
# any invocation of 'stop' or 'cont' that has happened since QEMU was
# started.
# #
# @internal-error: An internal error that prevents further guest execution # @internal-error: An internal error that prevents further guest execution
# has occurred # has occurred
@ -1210,7 +1210,9 @@
# Since: 0.14.0 # Since: 0.14.0
# #
# Notes: This function will succeed even if the guest is already in the stopped # Notes: This function will succeed even if the guest is already in the stopped
# state # state. In "inmigrate" state, it will ensure that the guest
# remains paused once migration finishes, as if the -S option was
# passed on the command line.
## ##
{ 'command': 'stop' } { 'command': 'stop' }
@ -1299,11 +1301,14 @@
# Since: 0.14.0 # Since: 0.14.0
# #
# Returns: If successful, nothing # Returns: If successful, nothing
# If the QEMU is waiting for an incoming migration, MigrationExpected
# If QEMU was started with an encrypted block device and a key has # If QEMU was started with an encrypted block device and a key has
# not yet been set, DeviceEncrypted. # not yet been set, DeviceEncrypted.
# #
# Notes: This command will succeed if the guest is currently running. # Notes: This command will succeed if the guest is currently running. It
# will also succeed if the guest is in the "inmigrate" state; in
# this case, the effect of the command is to make sure the guest
# starts once migration finishes, removing the effect of the -S
# command line option if it was passed.
## ##
{ 'command': 'cont' } { 'command': 'cont' }

View file

@ -165,9 +165,6 @@ void assert_no_error(Error *err);
#define QERR_MIGRATION_NOT_SUPPORTED \ #define QERR_MIGRATION_NOT_SUPPORTED \
ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'" ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'"
#define QERR_MIGRATION_EXPECTED \
ERROR_CLASS_MIGRATION_EXPECTED, "An incoming migration is expected before this command can be executed"
#define QERR_MISSING_PARAMETER \ #define QERR_MISSING_PARAMETER \
ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing" ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing"

13
qmp.c
View file

@ -85,8 +85,12 @@ void qmp_quit(Error **err)
void qmp_stop(Error **errp) void qmp_stop(Error **errp)
{ {
if (runstate_check(RUN_STATE_INMIGRATE)) {
autostart = 0;
} else {
vm_stop(RUN_STATE_PAUSED); vm_stop(RUN_STATE_PAUSED);
} }
}
void qmp_system_reset(Error **errp) void qmp_system_reset(Error **errp)
{ {
@ -144,10 +148,7 @@ void qmp_cont(Error **errp)
{ {
Error *local_err = NULL; Error *local_err = NULL;
if (runstate_check(RUN_STATE_INMIGRATE)) { if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
error_set(errp, QERR_MIGRATION_EXPECTED);
return;
} else if (runstate_check(RUN_STATE_INTERNAL_ERROR) ||
runstate_check(RUN_STATE_SHUTDOWN)) { runstate_check(RUN_STATE_SHUTDOWN)) {
error_set(errp, QERR_RESET_REQUIRED); error_set(errp, QERR_RESET_REQUIRED);
return; return;
@ -162,8 +163,12 @@ void qmp_cont(Error **errp)
return; return;
} }
if (runstate_check(RUN_STATE_INMIGRATE)) {
autostart = 1;
} else {
vm_start(); vm_start();
} }
}
void qmp_system_wakeup(Error **errp) void qmp_system_wakeup(Error **errp)
{ {

2
vl.c
View file

@ -341,7 +341,7 @@ static const RunStateTransition runstate_transitions_def[] = {
{ RUN_STATE_DEBUG, RUN_STATE_RUNNING }, { RUN_STATE_DEBUG, RUN_STATE_RUNNING },
{ RUN_STATE_INMIGRATE, RUN_STATE_RUNNING }, { RUN_STATE_INMIGRATE, RUN_STATE_RUNNING },
{ RUN_STATE_INMIGRATE, RUN_STATE_PRELAUNCH }, { RUN_STATE_INMIGRATE, RUN_STATE_PAUSED },
{ RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED }, { RUN_STATE_INTERNAL_ERROR, RUN_STATE_PAUSED },
{ RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE }, { RUN_STATE_INTERNAL_ERROR, RUN_STATE_FINISH_MIGRATE },