mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
block: switch blk_write_compressed() to byte-based interface
This is a preparatory patch, which continues the general trend of the transition to the byte-based interfaces. bdrv_check_request() and blk_check_request() are no longer used, thus we can remove them. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Jeff Cody <jcody@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: Eric Blake <eblake@redhat.com> CC: John Snow <jsnow@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
094138d09e
commit
fe5c1355e7
6 changed files with 20 additions and 41 deletions
|
@ -1590,7 +1590,9 @@ static int convert_write(ImgConvertState *s, int64_t sector_num, int nb_sectors,
|
|||
break;
|
||||
}
|
||||
|
||||
ret = blk_write_compressed(s->target, sector_num, buf, n);
|
||||
ret = blk_pwrite_compressed(s->target,
|
||||
sector_num << BDRV_SECTOR_BITS,
|
||||
buf, n << BDRV_SECTOR_BITS);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
@ -1727,7 +1729,7 @@ static int convert_do_copy(ImgConvertState *s)
|
|||
|
||||
if (s->compressed) {
|
||||
/* signal EOF to align */
|
||||
ret = blk_write_compressed(s->target, 0, NULL, 0);
|
||||
ret = blk_pwrite_compressed(s->target, 0, NULL, 0);
|
||||
if (ret < 0) {
|
||||
goto fail;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue