X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=qemu-img.c;h=1090286a9f7822b5aeb2c7cf6d224588c35a5d21;hb=3eff376977c457475272a34d243dac6af7cd6a47;hp=969edce186b334653166021ee874e4093b0dd57e;hpb=a5d5a3bdbd4bd2ffb27f825dd8a39e1fbaf11ad3;p=mirror_qemu.git diff --git a/qemu-img.c b/qemu-img.c index 969edce186..1090286a9f 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -44,7 +44,7 @@ #include #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; @@ -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; } @@ -2032,7 +2034,7 @@ static int img_convert(int argc, char **argv) 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; @@ -3283,7 +3285,7 @@ static int img_resize(int argc, char **argv) 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: @@ -3490,7 +3492,7 @@ typedef struct BenchData { 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); } } @@ -3501,7 +3503,7 @@ static void bench_cb(void *opaque, int ret) BlockAIOCB *acb; if (ret < 0) { - error_report("Failed request: %s\n", strerror(-ret)); + error_report("Failed request: %s", strerror(-ret)); exit(EXIT_FAILURE); }