[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/8] Postcopy: Check for support when setting the cap
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PULL 6/8] Postcopy: Check for support when setting the capability |
Date: |
Fri, 10 Jun 2016 12:30:50 +0530 |
From: "Dr. David Alan Gilbert" <address@hidden>
Knowing whether the destination host supports migration with
postcopy can be tricky.
The destination doesn't need the capability set, however
if we set it then use the opportunity to do the test and
tell the user/management layer early.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>
---
migration/migration.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index 7bc406a..253395c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -720,6 +720,7 @@ void
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
{
MigrationState *s = migrate_get_current();
MigrationCapabilityStatusList *cap;
+ bool old_postcopy_cap = migrate_postcopy_ram();
if (migration_is_setup_or_active(s->state)) {
error_setg(errp, QERR_MIGRATION_ACTIVE);
@@ -742,6 +743,19 @@ void
qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM] =
false;
}
+ /* This check is reasonably expensive, so only when it's being
+ * set the first time, also it's only the destination that needs
+ * special support.
+ */
+ if (!old_postcopy_cap && runstate_check(RUN_STATE_INMIGRATE) &&
+ !postcopy_ram_supported_by_host()) {
+ /* postcopy_ram_supported_by_host will have emitted a more
+ * detailed message
+ */
+ error_report("Postcopy is not supported");
+ s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM] =
+ false;
+ }
}
}
--
2.7.4
- [Qemu-devel] [PULL 0/8] migration: fixes, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 1/8] Postcopy: Avoid 0 length discards, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 3/8] Postcopy: Add stats on page requests, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 2/8] Migration: Split out ram part of qmp_query_migrate, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 5/8] tests: fix libqtest socket timeouts, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 6/8] Postcopy: Check for support when setting the capability,
Amit Shah <=
- [Qemu-devel] [PULL 4/8] test: Postcopy, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 7/8] migration: fix typos in qapi-schema from latest migration additions, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 8/8] migration: rename functions to starting migrations, Amit Shah, 2016/06/10
- Re: [Qemu-devel] [PULL 0/8] migration: fixes, Peter Maydell, 2016/06/10
- [Qemu-devel] [PULL 0/8] migration: fixes, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 2/8] migration: rename functions to starting migrations, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 1/8] migration: fix typos in qapi-schema from latest migration additions, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 3/8] Postcopy: Avoid 0 length discards, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 4/8] Migration: Split out ram part of qmp_query_migrate, Amit Shah, 2016/06/10
- [Qemu-devel] [PULL 5/8] Postcopy: Add stats on page requests, Amit Shah, 2016/06/10