mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-09 19:19:30 +00:00
qcow2: Return 0/-errno in write_l2_entries
Change write_l2_entries to return the real error code instead of -1. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
50779cc264
commit
79a31189d4
@ -627,12 +627,13 @@ static int write_l2_entries(BDRVQcowState *s, uint64_t *l2_table,
|
|||||||
int start_offset = (8 * l2_index) & ~511;
|
int start_offset = (8 * l2_index) & ~511;
|
||||||
int end_offset = (8 * (l2_index + num) + 511) & ~511;
|
int end_offset = (8 * (l2_index + num) + 511) & ~511;
|
||||||
size_t len = end_offset - start_offset;
|
size_t len = end_offset - start_offset;
|
||||||
|
int ret;
|
||||||
|
|
||||||
BLKDBG_EVENT(s->hd, BLKDBG_L2_UPDATE);
|
BLKDBG_EVENT(s->hd, BLKDBG_L2_UPDATE);
|
||||||
if (bdrv_pwrite(s->hd, l2_offset + start_offset, &l2_table[l2_start_index],
|
ret = bdrv_pwrite(s->hd, l2_offset + start_offset,
|
||||||
len) != len)
|
&l2_table[l2_start_index], len);
|
||||||
{
|
if (ret < 0) {
|
||||||
return -1;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user