Re: [PATCH v3 0/4] Additional parameters for qemu_img map

2020-05-13 Thread Eyal Moscovici
On 13/05/2020 20:49, Eric Blake wrote: On 5/13/20 8:36 AM, Eyal Moscovici wrote: Hi, The following series adds two parameters to qemu-img map: 1. start-offset: mapping starting offset. 2. max-length: the length of the mapping. These parameters proved useful when mapping large disk spread

[PATCH v3 4/4] qemu-img: Add --start-offset and --max-length to map

2020-05-13 Thread Eyal Moscovici
user to divide these type of map operations into shorter independent tasks. Reviewed-by: Eric Blake Acked-by: Mark Kanda Co-developed-by: Yoav Elnekave Signed-off-by: Yoav Elnekave Signed-off-by: Eyal Moscovici --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c

[PATCH v3 3/4] qemu-img: refactor dump_map_entry JSON format output

2020-05-13 Thread Eyal Moscovici
-by: Eyal Moscovici --- qemu-img.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 23e90a99e1..80340cb218 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2901,9 +2901,8 @@ static int dump_map_entry(OutputFormat output_format, MapEntry *e

[PATCH v3 2/4] qemu-img: validate image length in img_map

2020-05-13 Thread Eyal Moscovici
The code handles this case correctly we merely skip the loop. However it is probably best to return an explicit error. Reviewed-by: Eric Blake Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici --- qemu-img.c | 5 + 1 file changed, 5 insertions(+) diff --git a/qemu-img.c b/qemu-img.c

[PATCH v3 1/1] qemu_img: add cvtnum_full to print error reports

2020-05-13 Thread Eyal Moscovici
-by: Mark Kanda Signed-off-by: Eyal Moscovici --- qemu-img.c | 76 +- tests/qemu-iotests/049.out | 8 ++-- 2 files changed, 38 insertions(+), 46 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 6a4327aaba..a4ce35abc5 100644 --- a/qemu

[PATCH v3 0/4] Additional parameters for qemu_img map

2020-05-13 Thread Eyal Moscovici
error reporting to cvtnum. 2. Add image length validation in img_map. 3. Rebase over QEMU 5.0. Eyal Moscovici (1): qemu_img: add cvtnum_full to print error reports qemu-img.c | 76 +- tests/qemu-iotests/049.out | 8 ++-- 2 files changed, 38

Re: [PATCH v2 5/5] qemu-img: Add --start-offset and --max-length to map

2020-05-12 Thread Eyal Moscovici
On 07/05/2020 1:04, Eric Blake wrote: On 5/6/20 4:34 PM, Eyal Moscovici wrote: The mapping operation of large disks especially ones stored over a long chain of QCOW2 files can take a long time to finish. Additionally when mapping fails there was no way recover by restarting the mapping from

Re: [PATCH v2 2/5] qemu_img: add error report to cvtnum

2020-05-12 Thread Eyal Moscovici
On 07/05/2020 0:59, Eric Blake wrote: On 5/6/20 4:34 PM, Eyal Moscovici wrote: All calls to cvtnum check the return value and print the same error message more or less. And so error reporting moved to cvtnum to reduce duplicate code and provide a single error message. Acked-by: Mark Kanda

Re: [PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT

2020-05-12 Thread Eyal Moscovici
On 07/05/2020 0:49, Eric Blake wrote: On 5/6/20 4:34 PM, Eyal Moscovici wrote: Following commit f46bfdbfc8f95cf65d7818ef68a801e063c40332 (util/cutils: Change qemu_strtosz*() from int64_t to uint64_t) which added a similar check to cvtnum. As a result there is no need to check it separately

[PATCH v2 5/5] qemu-img: Add --start-offset and --max-length to map

2020-05-06 Thread Eyal Moscovici
user to divide these type of map operations into shorter independent tasks. Reviewed-by: Eric Blake Acked-by: Mark Kanda Co-developed-by: Yoav Elnekave Signed-off-by: Yoav Elnekave Signed-off-by: Eyal Moscovici --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c

[PATCH v2 4/5] qemu-img: refactor dump_map_entry JSON format output

2020-05-06 Thread Eyal Moscovici
-by: Eyal Moscovici --- qemu-img.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a1b507a0be..0a140fe564 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2896,9 +2896,8 @@ static int dump_map_entry(OutputFormat output_format, MapEntry *e

[PATCH v2 3/5] qemu-img: validate image length in img_map

2020-05-06 Thread Eyal Moscovici
The code handles this case correctly we merely skip the loop. However it is probably best to return an explicit error. Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici --- qemu-img.c | 5 + 1 file changed, 5 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index 4a06ab7fe8..a1b507a0be

[PATCH v2 2/5] qemu_img: add error report to cvtnum

2020-05-06 Thread Eyal Moscovici
All calls to cvtnum check the return value and print the same error message more or less. And so error reporting moved to cvtnum to reduce duplicate code and provide a single error message. Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici --- qemu-img.c | 63

[PATCH v2 0/5] Additional parameters for qemu_img map

2020-05-06 Thread Eyal Moscovici
map execution as well as recover from failed mapping operations. In addition the map operation can divided to multiple independent tasks. V2 changes: 1. add error reporting to cvtnum. 2. add image length validation in img_map. 3. rebase over QEMU 5.0. Eyal Moscovici (5): qemu-img: remove check

[PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT

2020-05-06 Thread Eyal Moscovici
Following commit f46bfdbfc8f95cf65d7818ef68a801e063c40332 (util/cutils: Change qemu_strtosz*() from int64_t to uint64_t) which added a similar check to cvtnum. As a result there is no need to check it separately outside of cvtnum. Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici --- qemu

Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output

2020-05-06 Thread Eyal Moscovici
On 29/04/2020, 17:58, "Eric Blake" wrote: On 3/22/20 4:11 AM, Eyal Moscovici wrote: > Previously dump_map_entry identified whether we need to start a new JSON > array based on whether start address == 0. In this refactor we remove > this assumption as in f

Re: [PATCH 2/2] qemu-img: Add --start-offset and --max-length to map

2020-05-06 Thread Eyal Moscovici
Thanks for the review. I will send V2 based on QEMU version 5.0. On 29/04/2020, 18:06, "Eric Blake" wrote: On 3/22/20 4:11 AM, Eyal Moscovici wrote: > The mapping operation of large disks especially ones stored over a > long chain of QCOW2 files can take a lon

[PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output

2020-03-22 Thread Eyal Moscovici
Previously dump_map_entry identified whether we need to start a new JSON array based on whether start address == 0. In this refactor we remove this assumption as in following patches we will allow map to start from an arbitrary position. Acked-by: Mark Kanda Signed-off-by: Eyal Moscovici

[PATCH 2/2] qemu-img: Add --start-offset and --max-length to map

2020-03-22 Thread Eyal Moscovici
user to divide these type of map operations into shorter independent tasks. Acked-by: Mark Kanda Co-developed-by: Yoav Elnekave Signed-off-by: Yoav Elnekave Signed-off-by: Eyal Moscovici --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c | 30

[PATCH 0/2] Additional parameters for qemu_img map

2020-03-22 Thread Eyal Moscovici
map execution as well as recover from failed mapping operations. In addition the map operation can divided to multiple independent tasks. Eyal Moscovici (2): qemu-img: refactor dump_map_entry JSON format output qemu-img: Add --start-offset and --max-length to map docs/tools/qemu-img.rst | 2