Minor migration fixes 2018-10-31

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJb2d6MAAoJEAUWMx68W/3ngo0QAK9ikRLUSB7Nw7gGpnBXUvAs
 8E6kirFF1H9AYscljbHMptI1oFxW3ffi24lgHxOjEFhUyi0aeC2pUZ52X99yWJuU
 2RuC4/nQ+PmJwkRGydcynxh1SXptbemK8PdA3p6gdeVY6oTi6ugWy3/dyRZf4F+3
 HoC0cl1GACpcUCm8i2y/bc7pf9j5wg2nk4X0WeXVukalgR8IobcXzoDRLR7X4nQD
 55XUD4FyIAxsRr4GMu+vUz6/eVMVFkXy+zr5UmhIwOKYpDfJMQKppLWIqfi/PqAO
 wqhoVPHEDvZriRcpfVMUuPVXc0ALyl3S6MWLdNTWq9q1foV7iqpjts/tqF8M7Jm9
 jls8uiBwxbymkdMX8uA+ggnW7PtVaQ+zhYBOjKiyvCwlqKxlNkDSYTIK9VMRyQ54
 gr4s8hS+sFZf10LGC9uLiFw/jLtLr38vEdNe+DheVOkB+SUFzzCsf8L0Q1ctiZYk
 DNfJ+HbPJx8vOTs1ZHuKVDOjN3+SadWmgO4nMphKswUNAHZ0tlbxeAuixa3xR9Lo
 2wdfofT+iUnjX1cH7jv8LvP5xu+F1ygsEJwpbpQG3GOYOP7pd8fCmdDjpg0lunNM
 qvODok6UhTs95TtF/bVoViiPx8MGodhbpGYW74m8Cj+d3AB9CK2bR9XlcBYKU5H1
 UAgsRq26BBavzPkTperz
 =iceI
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20181031a' into staging

Minor migration fixes 2018-10-31

# gpg: Signature made Wed 31 Oct 2018 16:55:40 GMT
# gpg:                using RSA key 0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>"
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert/tags/pull-migration-20181031a:
  migration: avoid segmentfault when take a snapshot of a VM which being migrated
  qapi: Fix COLOStatus and query-colo-status since version
  COLO: Fix Colo doc secondeary should be secondary

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-11-02 09:49:35 +00:00
commit 4cb890b858
5 changed files with 17 additions and 12 deletions

View file

@ -173,7 +173,7 @@ Secondary:
{ 'execute': 'nbd-server-start',
'arguments': {'addr': {'type': 'inet', 'data': {'host': 'xx.xx.xx.xx', 'port': '8889'} } }
}
{'execute': 'nbd-server-add', 'arguments': {'device': 'secondeary-disk0', 'writable': true } }
{'execute': 'nbd-server-add', 'arguments': {'device': 'secondary-disk0', 'writable': true } }
Note:
a. The qmp command nbd-server-start and nbd-server-add must be run

View file

@ -742,7 +742,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
* Return true if we're already in the middle of a migration
* (i.e. any of the active or setup states)
*/
static bool migration_is_setup_or_active(int state)
bool migration_is_setup_or_active(int state)
{
switch (state) {
case MIGRATION_STATUS_ACTIVE:

View file

@ -241,6 +241,8 @@ void migrate_fd_error(MigrationState *s, const Error *error);
void migrate_fd_connect(MigrationState *s, Error *error_in);
bool migration_is_setup_or_active(int state);
void migrate_init(MigrationState *s);
bool migration_is_blocked(Error **errp);
/* True if outgoing migration has entered postcopy phase */

View file

@ -1327,21 +1327,25 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
MigrationState *ms = migrate_get_current();
MigrationStatus status;
migrate_init(ms);
ms->to_dst_file = f;
if (migration_is_setup_or_active(ms->state) ||
ms->state == MIGRATION_STATUS_CANCELLING ||
ms->state == MIGRATION_STATUS_COLO) {
error_setg(errp, QERR_MIGRATION_ACTIVE);
return -EINVAL;
}
if (migration_is_blocked(errp)) {
ret = -EINVAL;
goto done;
return -EINVAL;
}
if (migrate_use_block()) {
error_setg(errp, "Block migration and snapshots are incompatible");
ret = -EINVAL;
goto done;
return -EINVAL;
}
migrate_init(ms);
ms->to_dst_file = f;
qemu_mutex_unlock_iothread();
qemu_savevm_state_header(f);
qemu_savevm_state_setup(f);
@ -1363,7 +1367,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
error_setg_errno(errp, -ret, "Error while writing VM state");
}
done:
if (ret != 0) {
status = MIGRATION_STATUS_FAILED;
} else {

View file

@ -1317,7 +1317,7 @@
#
# @reason: describes the reason for the COLO exit.
#
# Since: 3.0
# Since: 3.1
##
{ 'struct': 'COLOStatus',
'data': { 'mode': 'COLOMode', 'reason': 'COLOExitReason' } }
@ -1334,7 +1334,7 @@
# -> { "execute": "query-colo-status" }
# <- { "return": { "mode": "primary", "active": true, "reason": "request" } }
#
# Since: 3.0
# Since: 3.1
##
{ 'command': 'query-colo-status',
'returns': 'COLOStatus' }