Re: [Qemu-devel] [PATCH V18 01/25] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-08-28 Thread Dong Xu Wang
On 2013/8/28 20:53, Eric Blake wrote: On 08/12/2013 10:31 PM, Dong Xu Wang wrote: qemu_opts_print has no user now, so can re-write the function safely. qemu_opts_print is used while using "qemu-img create", it produces the same output as previous code. The behavior of this fu

Re: [Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts

2013-08-28 Thread Dong Xu Wang
On 2013/8/28 20:57, Eric Blake wrote: On 08/12/2013 10:31 PM, Dong Xu Wang wrote: This patch moves the default value entirely to QemuOptDesc. When getting the value of an option that hasn't been set, and QemuOptDesc has a default value, return that. Else, behave as before. ...

Re: [Qemu-devel] [PATCH V18 24/25] qapi: query-command-line-options outputs def_value_str

2013-08-28 Thread Dong Xu Wang
On 2013/8/28 7:13, Eric Blake wrote: On 08/27/2013 08:12 AM, Kevin Wolf wrote: Am 13.08.2013 um 06:32 hat Dong Xu Wang geschrieben: QMP command query-command-line-options shows details information of parameters, since added def_value_str, also output it in the QMP command. v16->v17: 1)

Re: [Qemu-devel] [PATCH V18 01/25] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-08-28 Thread Dong Xu Wang
On 2013/8/27 21:49, Kevin Wolf wrote: Am 13.08.2013 um 06:31 hat Dong Xu Wang geschrieben: qemu_opts_print has no user now, so can re-write the function safely. qemu_opts_print is used while using "qemu-img create", it produces the same output as previous code. The behavior of thi

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

2013-08-25 Thread Dong Xu Wang
ble_size. Signed-off-by: Dong Xu Wang --- block/block-cache.c | 85 +++ block/block-cache.h | 59 +++ block/qcow2.c | 7 +++-- block/qcow2.h | 25 ++- include/block/block.h | 3 ++

[Qemu-devel] [PATCH V20 5/8] move qcow2-cache.c to block-cache.c

2013-08-25 Thread Dong Xu Wang
Will use block cache as common interface, so move qcow2-cache.c to block-cache.c, Signed-off-by: Dong Xu Wang --- block/Makefile.objs | 3 +- block/block-cache.c | 323 block/qcow2-cache.c | 323

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

2013-08-25 Thread Dong Xu Wang
. 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 --- block/Makefile.objs | 1 + block/add-cow.c

[Qemu-devel] [PATCH V20 4/8] rename qcow2_cache functions to block_cache

2013-08-25 Thread Dong Xu Wang
This patch only rename qcow2_cache* functions to block_cache*, did not touch other code. Signed-off-by: Dong Xu Wang --- block/qcow2-cache.c| 70 +- block/qcow2-cluster.c | 48 +- block/qcow2-refcount.c | 42

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

2013-08-25 Thread 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 --- block.c | 2 +- include/block/block.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index fcc8870..b2711e9

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

2013-08-25 Thread 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 --- tests/qemu-iotests/017 | 2 +- tests/qemu-iotests/020 | 2 +- tests/qemu-iotests/037 | 2 +- tests/qemu-iotests/038 | 2 +- tests/qemu

[Qemu-devel] [PATCH V20 0/7] add-cow file format

2013-08-25 Thread Dong Xu Wang
orrect qemu-iotests script. 5) Other bug fix. v11->v12: 1) Removed un-used feature bit. 2) Share cache code with qcow2.c. 3) Remove snapshot_blkdev support, will add it in another patch. 5) COW Bitmap field in add-cow file will be multiple of 65536. 6) fix grammer and typo. Dong Xu Wang (8

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

2013-08-25 Thread Dong Xu Wang
Make qed_read_string function to a common interface, so move it to block.c. Signed-off-by: Dong Xu Wang --- block.c | 27 +++ block/qed.c | 34 -- include/block/block.h | 2 ++ 3 files changed, 33 insertions(+), 30

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

2013-08-25 Thread Dong Xu Wang
luster size value. 3) fix type. Signed-off-by: Dong Xu 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 1

[Qemu-devel] [PATCH V18 05/25] qemu-option: opt->str store digit, without suffixes

2013-08-12 Thread Dong Xu Wang
To produce same output while using "qemu-img create", opt->str should store pure digit, without suffixes. Signed-off-by: Dong Xu Wang --- util/qemu-option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qemu-option.c b/util/qemu-option.c index b939e8a..861929d 1006

[Qemu-devel] [PATCH V18 21/25] block: add QemuOpts support for vpc.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/vpc.c | 125 1 file changed, 125 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index fe4f311..aa1263a 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -786,6 +786,109 @@ static int vpc_create

[Qemu-devel] [PATCH V18 01/25] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-08-12 Thread Dong Xu Wang
v7->v8: 1) print "elements => accept any 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. Reviewed-by: Eric Blake Signed-off-by: Dong Xu Wang --- include/q

[Qemu-devel] [PATCH V18 24/25] qapi: query-command-line-options outputs def_value_str

2013-08-12 Thread Dong Xu Wang
QMP command query-command-line-options shows details information of parameters, since added def_value_str, also output it in the QMP command. v16->v17: 1) add "Since 1.6" tag. 2) rename def_str_value to "default". Signed-off-by: Dong Xu Wang --- qapi-schema.json | 8 ++

[Qemu-devel] [PATCH V18 22/25] block: add QemuOpts support for block.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block.c | 86 ++--- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/block.c b/block.c index 25090dc..9f52341 100644 --- a/block.c +++ b/block.c @@ -375,7 +375,7 @@ static void

[Qemu-devel] [PATCH V18 20/25] block: add QemuOpts support for vmdk.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/vmdk.c | 236 +++ 1 file changed, 236 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index 346bb5c..5452aa2 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1720,6 +1720,197 @@ exit

[Qemu-devel] [PATCH V18 17/25] block: add QemuOpts support for sheepdog.c

2013-08-12 Thread Dong Xu Wang
Conflicts: block/sheepdog.c Signed-off-by: Dong Xu Wang --- block/sheepdog.c | 111 +++ 1 file changed, 111 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index afe0533..b09b4fa 100644 --- a/block/sheepdog.c +++ b

[Qemu-devel] [PATCH V18 15/25] block: add QemuOpts support for raw.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/raw.c | 20 1 file changed, 20 insertions(+) diff --git a/block/raw.c b/block/raw.c index 4751825..7636f6b 100644 --- a/block/raw.c +++ b/block/raw.c @@ -139,6 +139,24 @@ static QEMUOptionParameter raw_create_options[] = { { NULL

[Qemu-devel] [PATCH V18 14/25] block: add QemuOpts support for raw-win32.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/raw-win32.c | 36 1 file changed, 36 insertions(+) diff --git a/block/raw-win32.c b/block/raw-win32.c index 9b5b2af..78efc63 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -452,6 +452,40 @@ static

[Qemu-devel] [PATCH V18 25/25] qemu-option: remove QEMUOptionParameter related functions and struct

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang Conflicts: include/qemu/option.h --- block.c | 1 - include/qemu/option.h | 39 --- util/qemu-option.c| 285 -- 3 files changed, 325 deletions(-) diff --git a/block.c b/block.c index

[Qemu-devel] [PATCH V18 13/25] block: add QemuOpts support for raw-posix.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/raw-posix.c | 73 +++ 1 file changed, 73 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index ba721d3..528b3d1 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1069,6 +1069,29

[Qemu-devel] [PATCH V18 19/25] block: add QemuOpts support for vdi.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/vdi.c | 128 1 file changed, 128 insertions(+) diff --git a/block/vdi.c b/block/vdi.c index 8a91525..50bf24f 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -736,6 +736,102 @@ static int vdi_create

[Qemu-devel] [PATCH V18 18/25] block: add QemuOpts support for ssh.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/ssh.c | 69 + 1 file changed, 69 insertions(+) diff --git a/block/ssh.c b/block/ssh.c index d7e7bf8..7f1d5d7 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -709,6 +709,73 @@ static int ssh_create

[Qemu-devel] [PATCH V18 08/25] block: add QemuOpts support for gluster.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/gluster.c | 58 + 1 file changed, 58 insertions(+) diff --git a/block/gluster.c b/block/gluster.c index 645b7f1..eb9d644 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -407,6 +407,43 @@ out

[Qemu-devel] [PATCH V18 16/25] block: add QemuOpts support for rbd.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/rbd.c | 95 + 1 file changed, 95 insertions(+) diff --git a/block/rbd.c b/block/rbd.c index cb71751..4d5897c 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -368,6 +368,80 @@ static int

[Qemu-devel] [PATCH V18 11/25] block: add QemuOpts support for qcow2.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/qcow2.c | 265 ++ 1 file changed, 265 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 3376901..1c3249d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1460,6 +1460,218 @@ static int

[Qemu-devel] [PATCH V18 07/25] block: add QemuOpts support for cow.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/cow.c | 79 + 1 file changed, 79 insertions(+) diff --git a/block/cow.c b/block/cow.c index 1cc2e89..3a0d450 100644 --- a/block/cow.c +++ b/block/cow.c @@ -332,6 +332,83 @@ static

[Qemu-devel] [PATCH V18 12/25] block: add QemuOpts support for qed.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/qed.c | 153 block/qed.h | 3 +- 2 files changed, 155 insertions(+), 1 deletion(-) diff --git a/block/qed.c b/block/qed.c index f767b05..348695f 100644 --- a/block/qed.c +++ b/block/qed.c

[Qemu-devel] [PATCH V18 10/25] block: add QemuOpts support for qcow.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/qcow.c | 126 +++ 1 file changed, 126 insertions(+) diff --git a/block/qcow.c b/block/qcow.c index 5239bd6..5b572d3 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -755,6 +755,107 @@ exit: return

[Qemu-devel] [PATCH V18 09/25] block: add QemuOpts support for iscsi.c

2013-08-12 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/iscsi.c | 61 +++ 1 file changed, 61 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index e7c1c2b..de2fd8c 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1305,6 +1305,65 @@ static

[Qemu-devel] [PATCH V18 06/25] add interface to block

2013-08-12 Thread Dong Xu Wang
To make patches easy for reviewing, each block format is a single patch. Add a new interface to block layer to make sure origin code can compile and do not change any code logic. Signed-off-by: Dong Xu Wang --- block.c | 51

[Qemu-devel] [PATCH V18 02/25] qemu-option: avoid duplication of default value in QemuOpts

2013-08-12 Thread Dong Xu Wang
r") 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 Reviewed-by: Eric Blake v13->v14: 1) change code style. 2) assert errors.

[Qemu-devel] [PATCH V18 03/25] qemu-option: create four QemuOptsList related functions

2013-08-12 Thread Dong Xu Wang
x typo. v5->v6: 1) allocate enough space in append_opts_list function. Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 3 +++ util/qemu-option.c| 73 +++ 2 files changed, 76 insertions(+) diff --git a/include/qemu/option.h b/inc

[Qemu-devel] [PATCH V18 04/25] qemu-option: create some QemuOpts functons

2013-08-12 Thread Dong Xu Wang
These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: in block layer, after parsing a parameter value, parameter list will delete it to avoid parsing it twice. Signed-off-by: Dong Xu Wang v16->v17: 1) ret

[Qemu-devel] [PATCH V18 00/25] replace QEMUOptionParameter with QemuOpts parser

2013-08-12 Thread Dong Xu Wang
v17->v18: 1) split into small patches, by each image format. 2) opt->str store digit, without suffixes in QemuOpt Dong Xu Wang (25): qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print qemu-option: avoid duplication of default value in QemuOpts qemu-

Re: [Qemu-devel] [PATCH V17 0/9] replace QEMUOptionParameter with QemuOpts parser

2013-07-17 Thread Dong Xu Wang
On Wed, Jul 17, 2013 at 8:54 PM, Eric Blake wrote: > On 07/17/2013 03:29 AM, Dong Xu Wang wrote: >> These patches will replace QEMUOptionParameter with QemuOpts. Change logs >> please go to each patch's commit message. >> >> Dong Xu Wang (9): >> qemu-op

Re: [Qemu-devel] [PATCH V17 8/9] qemu-option: make qemu_opts_del accept opts being NULL

2013-07-17 Thread Dong Xu Wang
Please ignore patch 8 and patch9, it won't work and I will re-send them seperately. Sorry for the inconvenience. On Wed, Jul 17, 2013 at 5:29 PM, Dong Xu Wang wrote: > Signed-off-by: Dong Xu Wang > --- > util/qemu-option.c | 4 > 1 file changed, 4 insertions(+) > >

[Qemu-devel] [PATCH V17 8/9] qemu-option: make qemu_opts_del accept opts being NULL

2013-07-17 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- util/qemu-option.c | 4 1 file changed, 4 insertions(+) diff --git a/util/qemu-option.c b/util/qemu-option.c index 7545486..f4a0282 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -656,6 +656,10 @@ void qemu_opts_del(QemuOpts *opts

[Qemu-devel] [PATCH V17 6/9] qapi: query-command-line-options outputs def_value_str

2013-07-17 Thread Dong Xu Wang
QMP command query-command-line-options shows details information of parameters, since added def_value_str, also output it in the QMP command. Signed-off-by: Dong Xu Wang --- v16->v17: 1) add "Since 1.6" tag. 2) rename def_str_value to "default". qapi-schema.json | 8 ++

[Qemu-devel] [PATCH V17 2/9] qemu-option: avoid duplication of default value in QemuOpts

2013-07-17 Thread Dong Xu Wang
r") 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 Reviewed-by: Eric Blake Signed-off-by: Dong Xu Wang ---

[Qemu-devel] [PATCH V17 7/9] qemu-option: remove QEMUOptionParameter related functions and struct

2013-07-17 Thread Dong Xu Wang
Reviewed-by: Eric Blake Signed-off-by: Dong Xu 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 12fa8b4..2aaa057

[Qemu-devel] [PATCH V17 4/9] qemu-option: create some QemuOpts functons

2013-07-17 Thread Dong Xu Wang
These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: in block layer, after parsing a parameter value, parameter list will delete it to avoid parsing it twice. Signed-off-by: Dong Xu Wang --- v16->v17: 1) ret

[Qemu-devel] [PATCH V17 9/9] qemu-option: use qemu_opts_del without judging NULL

2013-07-17 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block.c| 8 ++-- hw/core/qdev.c | 4 +--- qemu-char.c| 4 +--- qemu-img.c | 4 +--- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/block.c b/block.c index e1d1c3d..e700593 100644 --- a/block.c +++ b/block.c @@ -408,9 +408,7

[Qemu-devel] [PATCH V17 1/9] qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print

2013-07-17 Thread Dong Xu Wang
2. Option descriptors may provide a default value. 3. Print to stdout instead of stderr. Previously the behavior was to print every option that has been set. Options that have not been set would be skipped. Reviewed-by: Eric Blake Signed-off-by: Dong Xu Wang --- v13->v14: 1) fix memory

[Qemu-devel] [PATCH V17 0/9] replace QEMUOptionParameter with QemuOpts parser

2013-07-17 Thread Dong Xu Wang
These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. Dong Xu Wang (9): qemu-option: add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print qemu-option: avoid duplication of default value in QemuOpts qemu-o

[Qemu-devel] [PATCH V17 3/9] qemu-option: create four QemuOptsList related functions

2013-07-17 Thread Dong Xu Wang
This patch creates 4 functions, count_opts_list, qemu_opts_append, qemu_opts_free and qemu_opts_print_help, they are used in following commits. Signed-off-by: Dong Xu Wang --- v16->v17: 1) fix indentation. 2) fix typo. v15->v16: 1) discard double-initialization. 2) use pointer directl

Re: [Qemu-devel] [PATCH V16 0/7] replace QEMUOptionParameter with QemuOpts parser

2013-07-15 Thread Dong Xu Wang
On Thu, Jul 11, 2013 at 3:49 AM, Eric Blake wrote: > On 07/09/2013 02:41 PM, Eric Blake wrote: >> On 07/04/2013 06:52 AM, Stefan Hajnoczi wrote: >>> On Tue, Jun 18, 2013 at 05:31:52PM +0800, Dong Xu Wang wrote: >>>> These patches will replace QEMUOptionParame

[Qemu-devel] [PATCH V16 6/7] query-command-line-options outputs def_value_str

2013-06-18 Thread Dong Xu Wang
QMP command query-command-line-options shows details information of parameters, since added def_value_str, also output it in the QMP command. Signed-off-by: Dong Xu Wang --- qapi-schema.json | 5 - qmp-commands.hx| 2 ++ util/qemu-config.c | 4 3 files changed, 10 insertions

[Qemu-devel] [PATCH V16 0/7] replace QEMUOptionParameter with QemuOpts parser

2013-06-18 Thread Dong Xu Wang
These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. Dong Xu Wang (7): add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print avoid duplication of default value in QemuOpts Create four QemuOptsList related func

[Qemu-devel] [PATCH V16 2/7] avoid duplication of default value in QemuOpts

2013-06-18 Thread Dong Xu Wang
r") 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 Reviewed-by: Eric Blake ---

[Qemu-devel] [PATCH V16 7/7] remove QEMUOptionParameter related functions and struct

2013-06-18 Thread Dong Xu Wang
Signed-off-by: Dong Xu 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 --- a/include/qemu

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

2013-06-18 Thread Dong Xu Wang
2. Option descriptors may provide a default value. 3. Print to stdout instead of stderr. Previously the behavior was to print every option that has been set. Options that have not been set would be skipped. Signed-off-by: Dong Xu Wang Reviewed-by: Eric Blake --- v13->v14: 1) fix memory

[Qemu-devel] [PATCH V16 3/7] Create four QemuOptsList related functions

2013-06-18 Thread Dong Xu Wang
This patch creates 4 functions, count_opts_list, qemu_opts_append, qemu_opts_free and qemu_opts_print_help, they are used in following commits. Signed-off-by: Dong Xu Wang --- v16->v17: 1) discard double-initialization. 2) use pointer directly, not g_strdup. v12->v13: 1) simply asser

[Qemu-devel] [PATCH V16 4/7] Create some QemuOpts functons

2013-06-18 Thread Dong Xu Wang
These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: in block layer, after parsing a parameter value, parameter list will delete it to avoid parsing it twice. Signed-off-by: Dong Xu Wang --- v13->v14: 1) rewr

Re: [Qemu-devel] [PATCH V18 5/6] add-cow file format core code.

2013-05-13 Thread Dong Xu Wang
On 2013/5/13 23:07, Jeff Cody wrote: On Wed, Apr 10, 2013 at 04:11:52PM +0800, Dong Xu Wang wrote: add-cow file format core code. It use block-cache.c as cache code. It lacks of snapshot_blkdev support. Signed-off-by: Dong Xu Wang --- v17-v18: 1) use error_report, not fprintf. 2) remove

[Qemu-devel] [RFC] QEMU Guest and Host channel

2013-05-12 Thread Dong Xu Wang
Hi, Now QEMU has a guest agent tool: http://wiki.qemu.org/Features/QAPI/GuestAgent Guest agent is used to send "guest agent commands" to agent, and agent will do some work and return the results via QMP protocol. Now qemu-guest-agent is mainly for single direction: Host->Guest, that is users

[Qemu-devel] [PATCH 2/2] remove double semicolons

2013-05-09 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- block/nbd.c | 2 +- fsdev/virtfs-proxy-helper.c | 4 ++-- hw/9pfs/virtio-9p-local.c | 2 +- hw/i386/pc_q35.c| 2 +- hw/intc/imx_avic.c | 2 +- hw/usb/host-linux.c | 4 ++-- qga/channel-win32.c | 2 +- 7 files

[Qemu-devel] [PATCH 1/2] clean unnecessary code: don't check g_strdup arg for NULL

2013-05-09 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- util/uri.c | 2 +- vl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/uri.c b/util/uri.c index 4238729..e348c17 100644 --- a/util/uri.c +++ b/util/uri.c @@ -2162,7 +2162,7 @@ query_params_append (struct QueryParams *ps

Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/2] remove needless semicolon

2013-05-09 Thread Dong Xu Wang
On 2013/5/9 15:08, Hu Tao wrote: On Thu, May 09, 2013 at 10:23:09AM +0400, Michael Tokarev wrote: 08.05.2013 17:25, Anthony Liguori wrote: Michael Tokarev writes: 08.05.2013 13:46, Trival wrote: Signed-off-by: Trival I think wdongxu probably wants HIS name and email go here. wdongxu, can

Re: [Qemu-devel] [PATCH V18 5/6] add-cow file format core code.

2013-05-08 Thread Dong Xu Wang
On Thu, Apr 18, 2013 at 6:03 PM, Stefan Hajnoczi wrote: > On Wed, Apr 10, 2013 at 04:11:52PM +0800, Dong Xu Wang wrote: >> +header.cluster_bits = ffs(cluster_size) - 1; >> +if (header.cluster_bits < MIN_CLUSTER_BITS || >> +header.cluster_bits > MAX_CLU

Re: [Qemu-devel] [PATCH V14 6/6] remove QEMUOptionParameter related functions and struct

2013-05-08 Thread Dong Xu Wang
On 2013/5/9 1:59, Eric Blake wrote: [assuming you mis-typed your cc:, and that you meant kwolf instead of kwol at redhat] On 05/08/2013 02:45 AM, Dong Xu Wang wrote: Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 32 -- util/qemu-option.c| 285

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

2013-05-08 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 32 -- util/qemu-option.c| 285 -- 2 files changed, 317 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index d63e447..51814cf 100644 --- a/include/qemu

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

2013-05-08 Thread Dong Xu Wang
This patch will create 4 functions, count_opts_list, qemu_opts_append, qemu_opts_free and qemu_opts_print_help, they will be used in following commits. Signed-off-by: Dong Xu Wang --- v12->v13: 1) simply assert that neither argument has merge_lists set. 2) drop superfluous paranthesesis aro

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

2013-05-08 Thread Dong Xu Wang
or not. 2. Option descriptors may provide a default value. 3. Print to stdout instead of stderr. Previously the behavior was to print every option that has been set. Options that have not been set would be skipped. Signed-off-by: Dong Xu Wang --- v13->v14: 1) fix memory leak. 2) make opt_set

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

2013-05-08 Thread Dong Xu Wang
These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: in block layer, after parsing a parameter value, parameter list will delete it to avoid parsing it twice. Signed-off-by: Dong Xu Wang --- v13->v14

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

2013-05-08 Thread Dong Xu Wang
"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 style. 2) assert errors. util/qemu-option

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

2013-05-08 Thread Dong Xu Wang
These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. Dong Xu Wang (6): add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print avoid duplication of default value in QemuOpts Create four QemuOptsList related func

Re: [Qemu-devel] [PATCH V13 4/6] create some QemuOpts functons

2013-05-07 Thread Dong Xu Wang
On 2013/5/7 15:38, Markus Armbruster wrote: Dong Xu Wang writes: On 2013/5/6 20:20, Markus Armbruster wrote: Dong Xu Wang writes: These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: after get an option

Re: [Qemu-devel] [PATCH V13 4/6] create some QemuOpts functons

2013-05-06 Thread Dong Xu Wang
On 2013/5/6 20:20, Markus Armbruster wrote: Dong Xu Wang writes: These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: after get an option value, options++. I don't understand the last sentence. Signe

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

2013-05-01 Thread Dong Xu Wang
On 2013/4/27 6:45, Eric Blake wrote: On 04/10/2013 02:11 AM, Dong Xu Wang wrote: Document for add-cow format, the usage and spec of add-cow are introduced. Signed-off-by: Dong Xu Wang --- V17->V18: 1) remove version field. 2) header size is maximum value and cluster size value. 3) fix t

Re: [Qemu-devel] [PATCH V18 5/6] add-cow file format core code.

2013-04-22 Thread Dong Xu Wang
On 2013/4/18 18:03, Stefan Hajnoczi wrote: On Wed, Apr 10, 2013 at 04:11:52PM +0800, Dong Xu Wang wrote: +header.cluster_bits = ffs(cluster_size) - 1; +if (header.cluster_bits < MIN_CLUSTER_BITS || +header.cluster_bits > MAX_CLUSTER_BITS || +(1 << header.

Re: [Qemu-devel] [PATCH V18 4/6] rename qcow2-cache.c to block-cache.c

2013-04-22 Thread Dong Xu Wang
On 2013/4/18 16:54, Stefan Hajnoczi wrote: On Wed, Apr 10, 2013 at 04:11:51PM +0800, Dong Xu Wang wrote: This patch does two things: 1. Rename and move qcow2-cache to block-cache. 2. Add a type enum to parameterize BLKDEBUG_EVENT() for L2, refcount, and bitmaps. It's hard to revi

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

2013-04-22 Thread Dong Xu Wang
On 2013/4/18 16:30, Stefan Hajnoczi wrote: On Wed, Apr 10, 2013 at 04:11:48PM +0800, Dong Xu Wang wrote: +The Header is included in the first bytes: +(HEADER_SIZE is defined in 40-43 bytes.) +Byte0 - 3:magic +add-cow magic string ("ACOW"). + +

Re: [Qemu-devel] [PATCH V13 0/6] replace QEMUOptionParameter with QemuOpts parser

2013-04-21 Thread Dong Xu Wang
On 2013/4/10 14:25, Dong Xu Wang wrote: These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. Dong Xu Wang (6): add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print avoid duplication of default value in Qem

[Qemu-devel] [PATCH V18 4/6] rename qcow2-cache.c to block-cache.c

2013-04-10 Thread Dong Xu Wang
We will re-use qcow2-cache as block layer common cache code, so change its name and made some changes, define a struct named BlockTableType, pass BlockTableType and table size parameters to block cache initialization function. Signed-off-by: Dong Xu Wang --- v17-v18: 1) move struct to source

[Qemu-devel] [PATCH V18 3/6] qed_read_string to bdrv_read_string

2013-04-10 Thread Dong Xu Wang
Make qed_read_string function to a common interface, so move it to block.c. Signed-off-by: Dong Xu Wang --- block.c | 27 +++ block/qed.c | 34 -- include/block/block.h | 2 ++ 3 files changed, 33 insertions(+), 30

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

2013-04-10 Thread Dong Xu Wang
Document for add-cow format, the usage and spec of add-cow are introduced. Signed-off-by: Dong Xu Wang --- V17->V18: 1) remove version field. 2) header size is maximum value and cluster size value. 3) fix type. docs/specs/add-cow.txt | 165 +

[Qemu-devel] [PATCH V18 2/6] make path_has_protocol non static

2013-04-10 Thread 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 --- block.c | 2 +- include/block/block.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 45e1d96..1e7dab5

[Qemu-devel] [PATCH V18 5/6] add-cow file format core code.

2013-04-10 Thread Dong Xu Wang
add-cow file format core code. It use block-cache.c as cache code. It lacks of snapshot_blkdev support. Signed-off-by: Dong Xu Wang --- v17-v18: 1) use error_report, not fprintf. 2) remove version field from header. 3) header_size is MAX(cluster_size, 4096). 4) introduce s->cluster_sectors

[Qemu-devel] [PATCH V18 6/6] qemu-iotests: add add-cow iotests support

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

[Qemu-devel] [PATCH V18 0/6] add-cow file format

2013-04-10 Thread Dong Xu Wang
>v12: 1) Removed un-used feature bit. 2) Share cache code with qcow2.c. 3) Remove snapshot_blkdev support, will add it in another patch. 5) COW Bitmap field in add-cow file will be multiple of 65536. 6) fix grammer and typo. Dong Xu Wang (6): docs: document for add-cow file format make p

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

2013-04-09 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 32 -- util/qemu-option.c| 285 -- 2 files changed, 317 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index d63e447..51814cf 100644 --- a/include/qemu

[Qemu-devel] [PATCH V13 4/6] create some QemuOpts functons

2013-04-09 Thread Dong Xu Wang
These functions will be used in next commit. qemu_opt_get_(*)_del functions are used to make sure we have the same behaviors as before: after get an option value, options++. Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 11 +- util/qemu-option.c| 103

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

2013-04-09 Thread Dong Xu Wang
This patch will create 4 functions, count_opts_list, qemu_opts_append, qemu_opts_free and qemu_opts_print_help, they will be used in following commits. Signed-off-by: Dong Xu Wang --- v12->v13: 1) simply assert that neither argument has merge_lists set. 2) drop superfluous paranthesesis aroun

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

2013-04-09 Thread Dong Xu Wang
gument equals the default from QemuOptDesc. Example: qemu_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.

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

2013-04-09 Thread Dong Xu Wang
or not. 2. Option descriptors may provide a default value. 3. Print to stdout instead of stderr. Previously the behavior was to print every option that has been set. Options that have not been set would be skipped. Signed-off-by: Dong Xu Wang --- v12->v13 1) re-write commit message. v11

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

2013-04-09 Thread Dong Xu Wang
These patches will replace QEMUOptionParameter with QemuOpts. Change logs please go to each patch's commit message. Dong Xu Wang (6): add def_value_str in QemuOptDesc struct and rewrite qemu_opts_print avoid duplication of default value in QemuOpts Create four QemuOptsList related func

Re: [Qemu-devel] [PATCH] fix compile error

2013-04-09 Thread Dong Xu Wang
On 2013/4/9 18:50, Dong Xu Wang wrote: Since 0d09e41a51aa0752b1ce525ce084f7cd210e461b virtio-9p-device.h has been renamed as virtio-9p.h, so there will be a compiling error. This patch will fix it. Signed-off-by: Dong Xu Wang --- hw/9pfs/virtio-9p-device.c | 2 +- 1 file changed, 1

[Qemu-devel] [PATCH] fix compile error

2013-04-09 Thread Dong Xu Wang
Since 0d09e41a51aa0752b1ce525ce084f7cd210e461b virtio-9p-device.h has been renamed as virtio-9p.h, so there will be a compiling error. This patch will fix it. Signed-off-by: Dong Xu Wang --- hw/9pfs/virtio-9p-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs

Re: [Qemu-devel] [PATCH V12 3/4] Use QemuOpts support in block layer

2013-03-24 Thread Dong Xu Wang
On Thu, Mar 21, 2013 at 11:31 PM, Markus Armbruster wrote: > Dong Xu Wang writes: > >> This patch will use QemuOpts related functions in block layer, add >> a member bdrv_create_opts to BlockDriver struct, it will return >> a QemuOptsList pointer, which includes t

[Qemu-devel] [PATCH V12 2/4] Create four QemuOptsList related functions

2013-02-28 Thread Dong Xu Wang
This patch will create 4 functions, count_opts_list, qemu_opts_append, qemu_opts_free and qemu_opts_print_help, they will be used in following commits. Signed-off-by: Dong Xu Wang --- v11->v12: 1) renmae functions. 2) fix loop styles and code styles. 3) qemu_opts_apend will not return NULL

[Qemu-devel] [PATCH V12 1/4] add def_value_str and use it in qemu_opts_print

2013-02-28 Thread Dong Xu Wang
or not. 2. Option descriptors may provide a default value. 3. Print to stdout instead of stderr. Previously the behavior was to print every option that has been set. Options that have not been set would be skipped. Signed-off-by: Dong Xu Wang --- v11->v12 1) make def_value_str become the real

[Qemu-devel] [PATCH V12 4/4] remove QEMUOptionParameter related code

2013-02-28 Thread Dong Xu Wang
Signed-off-by: Dong Xu Wang --- include/qemu/option.h | 32 -- util/qemu-option.c| 285 -- 2 files changed, 317 deletions(-) diff --git a/include/qemu/option.h b/include/qemu/option.h index 0d5fb66..31b0715 100644 --- a/include/qemu

[Qemu-devel] [PATCH V12 0/4] replace QEMUOptionParameter with QemuOpts parser

2013-02-28 Thread Dong Xu Wang
Patch 1 add def_value_str and use it in qemu_opts_print. Patch 2 Create functions to pair with QemuOpts parser. Patch 3 Use QemuOpts parser in Block. Patch 4 Remove QEMUOptionParameter parser related code. Dong Xu Wang (4): add def_value_str and use it in qemu_opts_print Create

Re: [Qemu-devel] [PATCH V11 2/4] Create four opts list related functions

2013-01-31 Thread Dong Xu Wang
于 2013-1-26 2:13, Blue Swirl 写道: On Thu, Jan 24, 2013 at 6:59 PM, Markus Armbruster wrote: Dong Xu Wang writes: This patch will create 4 functions, count_opts_list, append_opts_list, free_opts_list and print_opts_list, they will used in following commits. Signed-off-by: Dong Xu Wang

Re: [Qemu-devel] [PATCH V11 3/4] Use QemuOpts support in block layer

2013-01-29 Thread Dong Xu Wang
于 2013-1-29 17:45, Markus Armbruster 写道: > Dong Xu Wang writes: > >> Markus Armbruster writes: >>> Dong Xu Wang writes: >>> >>>> Markus Armbruster writes: >>>>> Dong Xu Wang writes: > [...] >>>>>> @@ -264,17 +264

Re: [Qemu-devel] [PATCH V11 3/4] Use QemuOpts support in block layer

2013-01-28 Thread Dong Xu Wang
于 2013-1-29 1:41, Markus Armbruster 写道: > Dong Xu Wang writes: > >> Markus Armbruster writes: >>> Dong Xu Wang writes: >>> >>>> This patch will use QemuOpts related functions in block layer, add >>>> a member bdrv_create_options to BlockDri

  1   2   3   4   >