Re: [Qemu-devel] [Qemu-block] [PATCH v1 1/1] qcow2 resize with snapshots

2016-05-19 Thread Eric Blake
On 05/19/2016 01:46 AM, zhangzhiming wrote: First, a disclaimer: thanks for writing a patch, and for trying to improve the code. The rest of this mail may sound negative, but take it as advice for how to make your efforts more likely to succeed. In the subject line, it looks like you manually ad

Re: [Qemu-devel] [Qemu-block] [PATCH v1 1/1] qcow2 resize with snapshots

2016-05-19 Thread zhangzhiming
hi, and some extra code need to be changed. zhangzhiming zhangzhimin...@meituan.com -- diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index d872cf2..fb888b0 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -498,7 +498,7 @@ int qcow2_snapshot_goto(BlockDriverState

Re: [Qemu-devel] [Qemu-block] [PATCH v1 1/1] qcow2 resize with snapshots

2016-05-19 Thread zhangzhiming
add code, shrink l1 table while resize. zhangzhiming zhangzhimin...@meituan.com -- diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 31ecc10..3e07510 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -31,6 +31,36 @@ #include "block/qcow2.h" #include "trace.h" +

Re: [Qemu-devel] [Qemu-block] [PATCH v1 1/1] qcow2 resize with snapshots

2016-05-19 Thread zhangzhiming
hi, missed some code. zhangzhiming zhangzhimin...@meituan.com -- diff --git a/block.c b/block.c index 047698a..ff83134 100644 --- a/block.c +++ b/block.c @@ -2641,7 +2641,7 @@ int bdrv_apply_snapshot(BlockDriverState *bs, const char *snapshot_id, uint64_t return ret; } -ret

[Qemu-devel] [Qemu-block] [PATCH v1 1/1] qcow2 resize with snapshots

2016-05-19 Thread zhangzhiming
hi, i wrote some code for 'qcow2 resize' with snapshot with v3 image and 'qcow2 goto’ too, different size of snapshots are supported. and i have tested the function and it seems work well. there are some code copied from snapshot_delete_blkdev_internal, and qmp_block_resize, it feels not very