[Qemu-devel] [PATCH V15 1/6] add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-05-30 Thread Dongxu Wang
ny params" while opts_accepts_any() == true. 2) since def_print_str is the default value if an option isn't set, so rename it to def_value_str. Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- include/qemu/option.h | 3 ++- util/qemu-option.c| 32 ++-

[Qemu-devel] [PATCH V15 2/6] avoid duplication of default value in QemuOpts

2013-05-30 Thread Dongxu Wang
mu_opt_get(opts, "bar") If "bar" has been set in opts, return its value. Else, if opt's QemuOptDesc has a default value for "bar", return that. Else, return NULL. Signed-off-by: Dong Xu Wang v13->v14: 1) change code sty

[Qemu-devel] [PATCH V15 0/6] replace QEMUOptionParameter with QemuOpts parser

2013-05-30 Thread Dongxu Wang
These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. V14->V15: 1) Only delete enum QEMUOptionParType. Dong Xu Wang (6): add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print avoid duplication of default value in Qemu

[Qemu-devel] [PATCH V15 4/6] Create some QemuOpts functons

2013-05-30 Thread Dongxu Wang
->v14: 1) rewrite commit message. 2) use def_value_str in qemu_opt_get_FOO_del() and qemu_opt_get_del(). 3) delete redundant qemu_opt_del(opt). Signed-off-by: Dongxu Wang --- include/qemu/option.h | 11 - util/qemu-option.c| 116 +++--- 2 fi

[Qemu-devel] [PATCH V15 3/6] Create four QemuOptsList related functions

2013-05-30 Thread Dongxu Wang
Signed-off-by: Dongxu Wang --- include/qemu/option.h | 3 ++ util/qemu-option.c| 82 +++ 2 files changed, 85 insertions(+) diff --git a/include/qemu/option.h b/include/qemu/option.h index b928ab0..c7a5c14 100644 --- a/include/qemu/option.h +

[Qemu-devel] [PATCH V15 6/6] remove QEMUOptionParameter related functions and struct

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang Signed-off-by: Dongxu Wang --- include/qemu/option.h | 39 --- util/qemu-option.c| 285 -- 2 files changed, 324 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index d63e447..d2d3f16 100644

[Qemu-devel] [PATCH V19 0/8] add-cow file format

2013-05-30 Thread Dongxu Wang
It will introduce a new file format: add-cow. The add-cow file format makes it possible to perform copy-on-write on top of a raw disk image. When we know that no backing file clusters remain visible (e.g. we have streamed the entire image and copied all data from the backing file), then it is pos

[Qemu-devel] [PATCH V19 1/8] V18: docs: document for add-cow file format

2013-05-30 Thread Dongxu Wang
ang Signed-off-by: Dongxu Wang --- docs/specs/add-cow.txt | 172 + 1 file changed, 172 insertions(+) create mode 100644 docs/specs/add-cow.txt diff --git a/docs/specs/add-cow.txt b/docs/specs/add-cow.txt new file mode 100644 index 000..fba7

[Qemu-devel] [PATCH V19 4/8] rename qcow2-cache.c to block-cache.c

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang Block layer will use qcow2-cache as common cache code, so rename it to block-cache.c. v18->v19: 1) only rename, did not touch other code. Signed-off-by: Dongxu Wang --- block/Makefile.objs| 3 +- block/block-cache.c|

[Qemu-devel] [PATCH V19 3/8] qed_read_string to bdrv_read_string

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang Make qed_read_string function to a common interface, so move it to block.c. Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- block.c | 27 +++ block/qed.c | 34 -- include/block

[Qemu-devel] [PATCH V19 2/8] make path_has_protocol non static

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang We will use path_has_protocol outside block.c, so just make it public. Reviewed-by: Michael Roth Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- block.c | 2 +- include/block/block.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff

[Qemu-devel] [PATCH V19 8/8] qemu-iotests: add add-cow iotests support

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang This patch will use qemu-iotests to test add-cow file format. v17-v18: 1) add 037 and 038 tests. Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/037 | 2

[Qemu-devel] [PATCH V19 7/8] add-cow file format core code.

2013-05-30 Thread Dongxu Wang
MAX(cluster_size, 4096). 4) introduce s->cluster_sectors. 5) use BLKDBG_L2_LOAD/UPDATE. v16->v17: 1) Use stringify. v15->v16: 1) Judge if opts is null in add_cow_create function. Signed-off-by: Dong Xu Wang Conflicts: block/block-cache.c Signed-off-by: Dongxu Wang --- block/M

[Qemu-devel] [PATCH V19 5/8] Make block-cache.c be common interface

2013-05-30 Thread Dongxu Wang
le. 2) cluster_size->table_size. Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- block/block-cache.c | 75 ++--- block/qcow2-cluster.c | 30 +- block/qcow2-refcount.c | 30 +- block

[Qemu-devel] [RFC] Check backing_file chain's loop

2013-05-30 Thread Dongxu Wang
Hi, Now block layer does not check whether backing_file chain can be a circle, do you think it is necessary to do a check? For example, 1.qcow2's backing_file is 2.qcow2 and 2.qcow2's backing_file is 1.qcow2, then any IO operation will be a fault. If necessary, I will post a patch to fix.

[Qemu-devel] [PATCH V19 6/8] add debug event for add-cow

2013-05-30 Thread Dongxu Wang
From: Dong Xu Wang Signed-off-by: Dong Xu Wang Signed-off-by: Dongxu Wang --- block/blkdebug.c | 3 +++ block/block-cache.c | 4 ++-- include/block/block.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 71f99e4..2bd6a53

Re: [Qemu-devel] [RFC] Check backing_file chain's loop

2013-05-30 Thread Dongxu Wang
On 2013/5/30 20:48, Stefan Hajnoczi wrote: hain 1.qcow2' don't crash. qemu-img info --backing-chain detects cycles and returns an error, see the hash table in collect_image_info_list(). We should protect bdrv_open() too. Okay, will send a patch. Stefan

Re: [Qemu-devel] [PATCH V15 1/6] add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-05-30 Thread Dongxu Wang
On 2013/5/31 5:22, Eric Blake wrote: On 05/30/2013 03:55 AM, Dongxu Wang wrote: From: Dong Xu Wang qemu_opts_print has no user now, so can re-write the function safely. qemu_opts_print will be used while using "qemu-img create", it will produce the same output as previous code. Th

Re: [Qemu-devel] [PATCH V15 3/6] Create four QemuOptsList related functions

2013-05-30 Thread Dongxu Wang
On 2013/5/31 5:43, Eric Blake wrote: On 05/30/2013 03:55 AM, Dongxu Wang wrote: From: Dong Xu Wang This patch will create 4 functions, count_opts_list, qemu_opts_append, s/will create/creates/ - commit messages make the most sense when written in present tense qemu_opts_free and

Re: [Qemu-devel] [PATCH V19 1/8] V18: docs: document for add-cow file format

2013-06-02 Thread Dongxu Wang
On 2013/6/3 9:48, Fam Zheng wrote: On Thu, 05/30 18:00, Dongxu Wang wrote: From: Dong Xu Wang Document for add-cow format, the usage and spec of add-cow are introduced. v18-v19: 1) backing_fmt and image_fmt NUL-terminated. 2) other fix. V17->V18: 1) remove version field. 2) header size