vfio-helpers.c (96662996eda78c48aadddd4e76d8615c7eb72d80) | vfio-helpers.c (cb49dfce586367cda313fe9ce92e095f534e8178) |
---|---|
1/* 2 * VFIO utility 3 * 4 * Copyright 2016 - 2018 Red Hat, Inc. 5 * 6 * Authors: 7 * Fam Zheng <famz@redhat.com> 8 * --- 646 unchanged lines hidden (view full) --- 655 656/* Check if the mapping list is (ascending) ordered. */ 657static bool qemu_vfio_verify_mappings(QEMUVFIOState *s) 658{ 659 int i; 660 if (QEMU_VFIO_DEBUG) { 661 for (i = 0; i < s->nr_mappings - 1; ++i) { 662 if (!(s->mappings[i].host < s->mappings[i + 1].host)) { | 1/* 2 * VFIO utility 3 * 4 * Copyright 2016 - 2018 Red Hat, Inc. 5 * 6 * Authors: 7 * Fam Zheng <famz@redhat.com> 8 * --- 646 unchanged lines hidden (view full) --- 655 656/* Check if the mapping list is (ascending) ordered. */ 657static bool qemu_vfio_verify_mappings(QEMUVFIOState *s) 658{ 659 int i; 660 if (QEMU_VFIO_DEBUG) { 661 for (i = 0; i < s->nr_mappings - 1; ++i) { 662 if (!(s->mappings[i].host < s->mappings[i + 1].host)) { |
663 fprintf(stderr, "item %d not sorted!\n", i); | 663 error_report("item %d not sorted!", i); |
664 qemu_vfio_dump_mappings(s); 665 return false; 666 } 667 if (!(s->mappings[i].host + s->mappings[i].size <= 668 s->mappings[i + 1].host)) { | 664 qemu_vfio_dump_mappings(s); 665 return false; 666 } 667 if (!(s->mappings[i].host + s->mappings[i].size <= 668 s->mappings[i + 1].host)) { |
669 fprintf(stderr, "item %d overlap with next!\n", i); | 669 error_report("item %d overlap with next!", i); |
670 qemu_vfio_dump_mappings(s); 671 return false; 672 } 673 } 674 } 675 return true; 676} 677 --- 173 unchanged lines hidden --- | 670 qemu_vfio_dump_mappings(s); 671 return false; 672 } 673 } 674 } 675 return true; 676} 677 --- 173 unchanged lines hidden --- |