4567474e95
Notable changes: * bdrv_co_p{discard,readv,writev,write_zeroes} function signatures changed, to using int64_t for offsets/bytes and some still had int rather than BrdvRequestFlags for the flags. * job_cancel_sync now has a force parameter. Commit messages in 73895f3838cd7fdaf185cf1dbc47be58844a966f 4cfb3f05627ad82af473e7f7ae113c3884cd04e3 sound like using force=true makes more sense. * Added 3 patches coming in via qemu-stable tag, most important one is to work around a librbd issue. * Added another 3 patches from qemu-devel to fix issue leading to crash when live migrating with iothread. * cluster_size calculation helper changed (see patch pve/0026). * QAPI's if conditionals now use 'CONFIG_FOO' rather than 'defined(CONFIG_FOO)' Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
66 lines
2.2 KiB
Diff
66 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Alexandre Derumier <aderumier@odiso.com>
|
|
Date: Mon, 6 Apr 2020 12:16:42 +0200
|
|
Subject: [PATCH] PVE: [Up] qemu-img dd: add -n skip_create
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
---
|
|
qemu-img.c | 23 ++++++++++++++---------
|
|
1 file changed, 14 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/qemu-img.c b/qemu-img.c
|
|
index d9e8a8c4d4..6e1fbd5820 100644
|
|
--- a/qemu-img.c
|
|
+++ b/qemu-img.c
|
|
@@ -4930,7 +4930,7 @@ static int img_dd(int argc, char **argv)
|
|
const char *fmt = NULL;
|
|
int64_t size = 0, readsize = 0;
|
|
int64_t block_count = 0, out_pos, in_pos;
|
|
- bool force_share = false;
|
|
+ bool force_share = false, skip_create = false;
|
|
struct DdInfo dd = {
|
|
.flags = 0,
|
|
.count = 0,
|
|
@@ -4968,7 +4968,7 @@ static int img_dd(int argc, char **argv)
|
|
{ 0, 0, 0, 0 }
|
|
};
|
|
|
|
- while ((c = getopt_long(argc, argv, ":hf:O:U", long_options, NULL))) {
|
|
+ while ((c = getopt_long(argc, argv, ":hf:O:U:n", long_options, NULL))) {
|
|
if (c == EOF) {
|
|
break;
|
|
}
|
|
@@ -4988,6 +4988,9 @@ static int img_dd(int argc, char **argv)
|
|
case 'h':
|
|
help();
|
|
break;
|
|
+ case 'n':
|
|
+ skip_create = true;
|
|
+ break;
|
|
case 'U':
|
|
force_share = true;
|
|
break;
|
|
@@ -5118,13 +5121,15 @@ static int img_dd(int argc, char **argv)
|
|
size - in.bsz * in.offset, &error_abort);
|
|
}
|
|
|
|
- ret = bdrv_create(drv, out.filename, opts, &local_err);
|
|
- if (ret < 0) {
|
|
- error_reportf_err(local_err,
|
|
- "%s: error while creating output image: ",
|
|
- out.filename);
|
|
- ret = -1;
|
|
- goto out;
|
|
+ if (!skip_create) {
|
|
+ ret = bdrv_create(drv, out.filename, opts, &local_err);
|
|
+ if (ret < 0) {
|
|
+ error_reportf_err(local_err,
|
|
+ "%s: error while creating output image: ",
|
|
+ out.filename);
|
|
+ ret = -1;
|
|
+ goto out;
|
|
+ }
|
|
}
|
|
|
|
/* TODO, we can't honour --image-opts for the target,
|