mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
qcow2: Improve check for overlapping allocations
The old code detected an overlapping allocation even when the allocations didn't actually overlap, but were only adjacent. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
17a71e5823
commit
d9d74f4177
2 changed files with 120 additions and 120 deletions
|
@ -773,7 +773,7 @@ static int handle_dependencies(BlockDriverState *bs, uint64_t guest_offset,
|
|||
uint64_t old_start = old_alloc->offset >> s->cluster_bits;
|
||||
uint64_t old_end = old_start + old_alloc->nb_clusters;
|
||||
|
||||
if (end < old_start || start > old_end) {
|
||||
if (end <= old_start || start >= old_end) {
|
||||
/* No intersection */
|
||||
} else {
|
||||
if (start < old_start) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue