aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-04-30 17:06:57 +0100
committerPeter Maydell <peter.maydell@linaro.org>2019-04-30 17:06:57 +0100
commitf75d15231e56cb0f2bafe19faf1229c459a60731 (patch)
tree1e0906331b8e6832c8300affa5174583253aa24a /qemu-img.c
parentc4bfdd5947fd656fc46f6ab645b7b363aa1a83b7 (diff)
parent54277a2aab876aba7b55c7e88e2b372691849741 (diff)
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches: - iotests: Fix output of qemu-io related tests - Don't ignore bdrv_set_aio_context() for nodes with bs->drv = NUL - vmdk: Set vmdk parent backing_format to vmdk - qcow2: Preallocation fixes (especially for external data files) - Add linear-buffer-based APIs (as wrappers around qiov-based ones) - Various code cleanups and small corner case fixes # gpg: Signature made Tue 30 Apr 2019 16:35:09 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full] # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: (27 commits) block/qed: add missed coroutine_fn markers iotests: Check that images are in read-only mode after block-commit commit: Make base read-only if there is an early failure qemu-img: use buffer-based io block/stream: use buffer-based io block/commit: use buffer-based io block/backup: use buffer-based io block/parallels: use buffer-based io block/qed: use buffer-based io block/qcow: use buffer-based io block/qcow2: use buffer-based io block: introduce byte-based io helpers qcow2: Fix error handling in the compression code qcow2: Fix qcow2_make_empty() with external data file qemu-img: Make create hint at protocol options iotests: Perform the correct test in 082 qcow2: Fix full preallocation with external data file qcow2: Add errp to preallocate_co() qcow2: Avoid COW during metadata preallocation qemu-img: Saner printing of large file sizes ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/qemu-img.c b/qemu-img.c
index d7fe546b85..e6ad5978e0 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -267,9 +267,20 @@ static int print_block_option_help(const char *filename, const char *fmt)
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
}
- printf("Supported options:\n");
+ if (filename) {
+ printf("Supported options:\n");
+ } else {
+ printf("Supported %s options:\n", fmt);
+ }
qemu_opts_print_help(create_opts, false);
qemu_opts_free(create_opts);
+
+ if (!filename) {
+ printf("\n"
+ "The protocol level may support further options.\n"
+ "Specify the target filename to include those options.\n");
+ }
+
return 0;
}
@@ -1669,7 +1680,6 @@ static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector_num,
int nb_sectors, uint8_t *buf)
{
int n, ret;
- QEMUIOVector qiov;
assert(nb_sectors <= s->buf_sectors);
while (nb_sectors > 0) {
@@ -1685,11 +1695,10 @@ static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector_num,
bs_sectors = s->src_sectors[src_cur];
n = MIN(nb_sectors, bs_sectors - (sector_num - src_cur_offset));
- qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS);
- ret = blk_co_preadv(
+ ret = blk_co_pread(
blk, (sector_num - src_cur_offset) << BDRV_SECTOR_BITS,
- n << BDRV_SECTOR_BITS, &qiov, 0);
+ n << BDRV_SECTOR_BITS, buf, 0);
if (ret < 0) {
return ret;
}
@@ -1708,7 +1717,6 @@ static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t sector_num,
enum ImgConvertBlockStatus status)
{
int ret;
- QEMUIOVector qiov;
while (nb_sectors > 0) {
int n = nb_sectors;
@@ -1736,10 +1744,8 @@ static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t sector_num,
(s->compressed &&
!buffer_is_zero(buf, n * BDRV_SECTOR_SIZE)))
{
- qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS);
-
- ret = blk_co_pwritev(s->target, sector_num << BDRV_SECTOR_BITS,
- n << BDRV_SECTOR_BITS, &qiov, flags);
+ ret = blk_co_pwrite(s->target, sector_num << BDRV_SECTOR_BITS,
+ n << BDRV_SECTOR_BITS, buf, flags);
if (ret < 0) {
return ret;
}