aboutsummaryrefslogtreecommitdiff
path: root/block/vdi.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-04-29 19:03:15 +0200
committerKevin Wolf <kwolf@redhat.com>2014-04-30 14:46:17 +0200
commite1b42f456fad6e797eaf795ed2e400c4e47d5eb4 (patch)
treef0a4f982ce7c8c1a10165b42e4eb25715ddf1252 /block/vdi.c
parentb93f995081cc32e56071fef179161d2907d0491e (diff)
block/bochs: Fix error handling for seek_to_sector()
Currently, seek_to_sector() returns -1 both for errors and unallocated sectors, resulting in silent errors. As 0 is an invalid offset of data clusters (bitmap_offset is greater than 0 because s->data_offset is greater than 0), just return 0 for unallocated sectors and -errno in case of error. This should then be propagated by bochs_read(), the sole user of seek_to_sector(). That function also has a case of "return -1 in case of error", which is fixed by this patch as well. bochs_read() is called by bochs_co_read() which passes the return value through, therefore it is indeed correct for bochs_read() to return -errno. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vdi.c')
0 files changed, 0 insertions, 0 deletions