diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-10-17 10:31:10 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2016-10-17 10:31:10 +0100 |
| commit | 4378caf59edf6df796b9ad3174e5703fd25a781c (patch) | |
| tree | ea5627e0532e0cbfffd103be09cff3796f5122d0 /migration/postcopy-ram.c | |
| parent | 6aa5a3679449cdf0b6fe5a6829b22e642ded57fd (diff) | |
| parent | 7c2b0f65cc2b6b14ad797549b8bde13aa97f6ba2 (diff) | |
| download | focaccia-qemu-4378caf59edf6df796b9ad3174e5703fd25a781c.tar.gz focaccia-qemu-4378caf59edf6df796b9ad3174e5703fd25a781c.zip | |
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20161014' into staging
migration/next for 20161014 # gpg: Signature made Fri 14 Oct 2016 16:24:13 BST # gpg: using RSA key 0xF487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/migration/20161014: docs/xbzrle: correction migrate: move max-bandwidth and downtime-limit to migrate_set_parameter migration: Fix seg with missing port migration/postcopy: Explicitly disallow huge pages RAMBlocks: Store page size Postcopy vs xbzrle: Don't send xbzrle pages once in postcopy [for 2.8] migrate: Fix bounds check for migration parameters in migration.c migrate: Use boxed qapi for migrate-set-parameters migrate: Share common MigrationParameters struct migrate: Fix cpu-throttle-increment regression in HMP migration/rdma: Don't flag an error when we've been told about one migration: Make failed migration load set file error migration/rdma: Pass qemu_file errors across link migration: Report values for comparisons migration: report an error giving the failed field Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'migration/postcopy-ram.c')
| -rw-r--r-- | migration/postcopy-ram.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 9b0477835f..a40dddbaf6 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -85,6 +85,24 @@ static bool ufd_version_check(int ufd) } /* + * Check for things that postcopy won't support; returns 0 if the block + * is fine. + */ +static int check_range(const char *block_name, void *host_addr, + ram_addr_t offset, ram_addr_t length, void *opaque) +{ + RAMBlock *rb = qemu_ram_block_by_name(block_name); + + if (qemu_ram_pagesize(rb) > getpagesize()) { + error_report("Postcopy doesn't support large page sizes yet (%s)", + block_name); + return -E2BIG; + } + + return 0; +} + +/* * Note: This has the side effect of munlock'ing all of RAM, that's * normally fine since if the postcopy succeeds it gets turned back on at the * end. @@ -104,6 +122,12 @@ bool postcopy_ram_supported_by_host(void) goto out; } + /* Check for anything about the RAMBlocks we don't support */ + if (qemu_ram_foreach_block(check_range, NULL)) { + /* check_range will have printed its own error */ + goto out; + } + ufd = syscall(__NR_userfaultfd, O_CLOEXEC); if (ufd == -1) { error_report("%s: userfaultfd not available: %s", __func__, |