#include <getopt.h>
#define QEMU_IMG_VERSION "qemu-img version " QEMU_VERSION QEMU_PKGVERSION \
- ", Copyright (c) 2004-2008 Fabrice Bellard\n"
+ ", " QEMU_COPYRIGHT "\n"
typedef struct img_cmd_t {
const char *name;
.bs = bs,
};
- commit_active_start(bs, base_bs, 0, BLOCKDEV_ON_ERROR_REPORT,
+ commit_active_start("commit", bs, base_bs, 0, BLOCKDEV_ON_ERROR_REPORT,
common_block_job_cb, &cbi, &local_err);
if (local_err) {
goto done;
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;
}
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;
}
const char *preallocation =
qemu_opt_get(opts, BLOCK_OPT_PREALLOC);
- if (!drv->bdrv_write_compressed) {
+ if (!drv->bdrv_co_pwritev_compressed) {
error_report("Compression not supported for this file format");
ret = -1;
goto out;
error_report("Image is read-only");
break;
default:
- error_report("Error resizing image (%d)", -ret);
+ error_report("Error resizing image: %s", strerror(-ret));
break;
}
out:
static void bench_undrained_flush_cb(void *opaque, int ret)
{
if (ret < 0) {
- error_report("Failed flush request: %s\n", strerror(-ret));
+ error_report("Failed flush request: %s", strerror(-ret));
exit(EXIT_FAILURE);
}
}
BlockAIOCB *acb;
if (ret < 0) {
- error_report("Failed request: %s\n", strerror(-ret));
+ error_report("Failed request: %s", strerror(-ret));
exit(EXIT_FAILURE);
}