Max Reitz e1b42f456f 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>
2014-04-30 14:46:17 +02:00
..
2014-03-25 14:09:50 +01:00
2013-08-19 15:52:19 +02:00
2014-02-25 10:50:11 +00:00
2014-04-01 15:22:35 +02:00
2014-02-17 11:57:23 -05:00
2013-09-12 10:12:48 +02:00
2014-03-25 14:09:50 +01:00
2014-04-01 13:59:47 +02:00
2014-04-22 12:00:20 +02:00