From: Alberto Garcia Date: Wed, 1 May 2019 18:13:55 +0000 (+0300) Subject: qcow2: Replace bdrv_write() with bdrv_pwrite() X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e3b4257d032dede8ffcfe868ffd74bb584842f62;p=qmiga%2Fqemu.git qcow2: Replace bdrv_write() with bdrv_pwrite() There's only one bdrv_write() call left in the qcow2 code, and it can be trivially replaced with the byte-based bdrv_pwrite(). Signed-off-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index fa7ac1f7cb..7481903396 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -2429,8 +2429,8 @@ write_refblocks: on_disk_refblock = (void *)((char *) *refcount_table + refblock_index * s->cluster_size); - ret = bdrv_write(bs->file, refblock_offset / BDRV_SECTOR_SIZE, - on_disk_refblock, s->cluster_sectors); + ret = bdrv_pwrite(bs->file, refblock_offset, on_disk_refblock, + s->cluster_size); if (ret < 0) { fprintf(stderr, "ERROR writing refblock: %s\n", strerror(-ret)); goto fail;