block.c (776346cd63e5a1ceeeb4d81fa111d911abb73a69) | block.c (f3a9cfddaec127078ac1898de6b063db8ac3bb48) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 2776 unchanged lines hidden (view full) --- 2785 return target_sectors; 2786 } 2787 2788 for (;;) { 2789 nb_sectors = target_sectors - sector_num; 2790 if (nb_sectors <= 0) { 2791 return 0; 2792 } | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 2776 unchanged lines hidden (view full) --- 2785 return target_sectors; 2786 } 2787 2788 for (;;) { 2789 nb_sectors = target_sectors - sector_num; 2790 if (nb_sectors <= 0) { 2791 return 0; 2792 } |
2793 if (nb_sectors > INT_MAX) { 2794 nb_sectors = INT_MAX; | 2793 if (nb_sectors > INT_MAX / BDRV_SECTOR_SIZE) { 2794 nb_sectors = INT_MAX / BDRV_SECTOR_SIZE; |
2795 } 2796 ret = bdrv_get_block_status(bs, sector_num, nb_sectors, &n); 2797 if (ret < 0) { 2798 error_report("error getting block status at sector %" PRId64 ": %s", 2799 sector_num, strerror(-ret)); 2800 return ret; 2801 } 2802 if (ret & BDRV_BLOCK_ZERO) { --- 3246 unchanged lines hidden --- | 2795 } 2796 ret = bdrv_get_block_status(bs, sector_num, nb_sectors, &n); 2797 if (ret < 0) { 2798 error_report("error getting block status at sector %" PRId64 ": %s", 2799 sector_num, strerror(-ret)); 2800 return ret; 2801 } 2802 if (ret & BDRV_BLOCK_ZERO) { --- 3246 unchanged lines hidden --- |