diff options
| author | Alberto Garcia | 2019-04-30 12:08:02 +0200 |
|---|---|---|
| committer | Kevin Wolf | 2019-04-30 15:29:00 +0200 |
| commit | e1f4a37a49ebb346d846eddc5cd4ebbb7afd9990 (patch) | |
| tree | 5db2121c2bce16bba372269d50dd474501f7944f /scripts/qapi | |
| parent | qcow2: Fix qcow2_make_empty() with external data file (diff) | |
| download | qemu-e1f4a37a49ebb346d846eddc5cd4ebbb7afd9990.tar.gz qemu-e1f4a37a49ebb346d846eddc5cd4ebbb7afd9990.tar.xz qemu-e1f4a37a49ebb346d846eddc5cd4ebbb7afd9990.zip | |
qcow2: Fix error handling in the compression code
This patch fixes a few things in the way error codes are handled in
the qcow2 compression code:
a) qcow2_co_pwritev_compressed() expects qcow2_co_compress() to only
return -1 or -2 on failure, but this is not correct. Since the
change from qcow2_compress() to qcow2_co_compress() in commit
ceb029cd6feccf9f7607 the new code can also return -EINVAL (although
there does not seem to exist any code path that would cause that
error in the current implementation).
b) -1 and -2 are ad-hoc error codes defined in qcow2_compress().
This patch replaces them with standard constants from errno.h.
c) Both qcow2_compress() and qcow2_co_do_compress() return a negative
value on failure, but qcow2_co_pwritev_compressed() stores the
value in an unsigned data type.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts/qapi')
0 files changed, 0 insertions, 0 deletions
