postcopy-ram.c (c760cb77e511eb05094df67c1b30029a952efa35) | postcopy-ram.c (038adc2f5850e32019bda06c559d0301be436eae) |
---|---|
1/* 2 * Postcopy migration for RAM 3 * 4 * Copyright 2013-2015 Red Hat, Inc. and/or its affiliates 5 * 6 * Authors: 7 * Dave Gilbert <dgilbert@redhat.com> 8 * --- 294 unchanged lines hidden (view full) --- 303 * userfault file descriptor 304 */ 305 if (!request_ufd_features(ufd, asked_features)) { 306 error_report("%s failed: features %" PRIu64, __func__, 307 asked_features); 308 return false; 309 } 310 | 1/* 2 * Postcopy migration for RAM 3 * 4 * Copyright 2013-2015 Red Hat, Inc. and/or its affiliates 5 * 6 * Authors: 7 * Dave Gilbert <dgilbert@redhat.com> 8 * --- 294 unchanged lines hidden (view full) --- 303 * userfault file descriptor 304 */ 305 if (!request_ufd_features(ufd, asked_features)) { 306 error_report("%s failed: features %" PRIu64, __func__, 307 asked_features); 308 return false; 309 } 310 |
311 if (getpagesize() != ram_pagesize_summary()) { | 311 if (qemu_real_host_page_size != ram_pagesize_summary()) { |
312 bool have_hp = false; 313 /* We've got a huge page */ 314#ifdef UFFD_FEATURE_MISSING_HUGETLBFS 315 have_hp = supported_features & UFFD_FEATURE_MISSING_HUGETLBFS; 316#endif 317 if (!have_hp) { 318 error_report("Userfault on this host does not support huge pages"); 319 return false; --- 21 unchanged lines hidden (view full) --- 341 342/* 343 * Note: This has the side effect of munlock'ing all of RAM, that's 344 * normally fine since if the postcopy succeeds it gets turned back on at the 345 * end. 346 */ 347bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) 348{ | 312 bool have_hp = false; 313 /* We've got a huge page */ 314#ifdef UFFD_FEATURE_MISSING_HUGETLBFS 315 have_hp = supported_features & UFFD_FEATURE_MISSING_HUGETLBFS; 316#endif 317 if (!have_hp) { 318 error_report("Userfault on this host does not support huge pages"); 319 return false; --- 21 unchanged lines hidden (view full) --- 341 342/* 343 * Note: This has the side effect of munlock'ing all of RAM, that's 344 * normally fine since if the postcopy succeeds it gets turned back on at the 345 * end. 346 */ 347bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) 348{ |
349 long pagesize = getpagesize(); | 349 long pagesize = qemu_real_host_page_size; |
350 int ufd = -1; 351 bool ret = false; /* Error unless we change it */ 352 void *testarea = NULL; 353 struct uffdio_register reg_struct; 354 struct uffdio_range range_struct; 355 uint64_t feature_mask; 356 Error *local_err = NULL; 357 --- 1114 unchanged lines hidden --- | 350 int ufd = -1; 351 bool ret = false; /* Error unless we change it */ 352 void *testarea = NULL; 353 struct uffdio_register reg_struct; 354 struct uffdio_range range_struct; 355 uint64_t feature_mask; 356 Error *local_err = NULL; 357 --- 1114 unchanged lines hidden --- |