Re: [Qemu-devel] [kata-dev] [ANNOUNCE] virtio-fs v0.3 release

2019-08-19 Thread Xu Wang
Thanks all the contributors, looking forward to having a product virtio-fs deployment shortly. > On Aug 20, 2019, at 12:04 AM, Stefan Hajnoczi wrote: > > I am delighted to announce the release of virtio-fs v0.3, a shared file > system that lets virtual machines access a directory tree on the ho

[Qemu-devel] [PATCH] block: Fix relative backing file path checking

2013-12-09 Thread Xu Wang
saved in the ovl.img is a/a/blob.img. Bug occurred. After patched: The step 3 above an error message will be thrown because backing file checking started after got the full path of backing file intead of relative path. Signed-off-by: Xu Wang --- block.c | 17 +++--

[Qemu-devel] [PATCH V9 4/4] blockdev: Add infinite loop check in drive_init()

2013-11-25 Thread Xu Wang
Check the backing file for a loop during image boot, to avoid a lack or response or segfault. Signed-off-by: Xu Wang --- blockdev.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/blockdev.c b/blockdev.c index 330aa4a..e39fc27 100644 --- a/blockdev.c +++ b/blockdev.c @@ -511,6

[Qemu-devel] [PATCH V9 3/4] block: Add backing file loop check in change_backing_file()

2013-11-25 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index b8cea1c..87f7018 100644 --- a

[Qemu-devel] [PATCH V9 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-25 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/block.c b/block.c

[Qemu-devel] [PATCH V9 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-25 Thread Xu Wang
bdrv_backing_chain_okay() and bdrv_image_create_okay(). Signed-off-by: Xu Wang --- block.c | 73 +++ include/block/block.h | 3 +++ qemu-img.c| 52 ++-- 3 files changed, 102 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH V9 0/4] Refine and export backing file loop check

2013-11-25 Thread Xu Wang
hile() 6. Changed get_win_inode() to get_inode() and move all inode get method into it to make logic more simpler. 7. Added value of @fmt as suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (4): block/qemu-img: Refine and export infinite loop c

[Qemu-devel] [PATCH V8 4/4] blockdev: Add infinite loop check in drive_init()

2013-11-14 Thread Xu Wang
Check the backing file for a loop during image boot, to avoid a lack or response or segfault. Signed-off-by: Xu Wang --- blockdev.c | 8 1 file changed, 8 insertions(+) diff --git a/blockdev.c b/blockdev.c index b260477..60a3c93 100644 --- a/blockdev.c +++ b/blockdev.c @@ -510,6

[Qemu-devel] [PATCH V8 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-14 Thread Xu Wang
bdrv_backing_chain_okay() and bdrv_image_create_okay(). Signed-off-by: Xu Wang --- block.c | 74 +++ include/block/block.h | 3 +++ qemu-img.c| 52 ++-- 3 files changed, 103 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH V8 0/4] Refine and export backing file loop check

2013-11-14 Thread Xu Wang
d value of @fmt as suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (4): block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() block: Add check infinite loop in bdrv_img_create() block: Add backing file loop check in change_ba

[Qemu-devel] [PATCH V8 3/4] block: Add backing file loop check in change_backing_file()

2013-11-14 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block.c b/block.c index 6fbc702..2d58f12 100644 --- a

[Qemu-devel] [PATCH V8 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-14 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index

[Qemu-devel] [PATCH V7 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-12 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 3c43179

[Qemu-devel] [PATCH V7 0/4] Refine and export backing file loop check

2013-11-12 Thread Xu Wang
logic more simpler. 7. Added value of @fmt as suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (4): block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() block: Add check infinite loop in bdrv_img_create() block: Add backing file

[Qemu-devel] [PATCH V7 3/4] block: Add backing file loop check in change_backing_file()

2013-11-12 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index c2ed6ef..861b133 100644 --- a

[Qemu-devel] [PATCH V7 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-12 Thread Xu Wang
bdrv_backing_chain_okay() and bdrv_image_create_okay(). Signed-off-by: Xu Wang --- block.c | 76 +++ include/block/block.h | 3 ++ qemu-img.c| 52 +-- 3 files changed, 105 insertions(+), 26 deletions(-) diff

[Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_init()

2013-11-05 Thread Xu Wang
Check the backing file for a loop during image boot, to avoid a lack or response or segfault. Signed-off-by: Xu Wang --- blockdev.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/blockdev.c b/blockdev.c index b260477..7c0927f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -510,6 +510,12

[Qemu-devel] [PATCH V6 3/5] block: Add check infinite loop in bdrv_img_create()

2013-11-05 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 3443117

[Qemu-devel] [PATCH V6 0/5] Refine and export backing file loop check

2013-11-05 Thread Xu Wang
) 6. Changed get_win_inode() to get_inode() and move all inode get method into it to make logic more simpler. 7. Added value of @fmt as suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (5): block/qemu-img: Refine and export infinite loop checki

[Qemu-devel] [PATCH V6 4/5] block: Add backing file loop check in change_backing_file()

2013-11-05 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index 8423e80..cb50bfd 100644 --- a

[Qemu-devel] [PATCH V6 2/5] qemu-img: Add infinite loop checking in bdrv_new_open()

2013-11-05 Thread Xu Wang
Every image should be checked if there is infinite loop in backing file chain before open it. So infinite loop check was added into bdrv_new_open(). If @filename is opened without the flag BDRV_O_NO_BACKING, the infinite loop check should be called. Signed-off-by: Xu Wang --- qemu-img.c | 8

[Qemu-devel] [PATCH V6 1/5] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-05 Thread Xu Wang
bdrv_backing_chain_okay() and bdrv_image_create_okay(). Signed-off-by: Xu Wang --- block.c | 117 ++ include/block/block.h | 4 ++ qemu-img.c| 44 --- 3 files changed, 139 insertions(+), 26 deletions(-) diff --git a/block.c

Re: [Qemu-devel] [PATCH V5 1/6] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-10-11 Thread Xu Wang
于 2013/8/3 6:09, Eric Blake 写道: On 08/02/2013 03:02 AM, Xu Wang wrote: From: Xu Wang If there is a loop exists in the backing file chain, many problems could be caused by it, such as no response and segment fault during system boot. Hence stopping backing file loop appear is very necessary

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-

[Qemu-devel] [PATCH V5 5/6] block: Add backing file loop check in change_backing_file()

2013-08-02 Thread Xu Wang
From: Xu Wang Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 8bb63c2

[Qemu-devel] [PATCH V5 4/6] block: Check infinite loop in bdrv_img_create()

2013-08-02 Thread Xu Wang
From: Xu Wang Backing file loop should be checked before qemu-img create command execution. If loop was found, qemu-img create should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c

[Qemu-devel] [PATCH V5 1/6] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-08-02 Thread Xu Wang
From: Xu Wang If there is a loop exists in the backing file chain, many problems could be caused by it, such as no response and segment fault during system boot. Hence stopping backing file loop appear is very necessary. This patch refine and export loop checking function from collect_image_

[Qemu-devel] [PATCH V5 2/6] qemu-img: Add infinite loop checking in bdrv_new_open()

2013-08-02 Thread Xu Wang
From: Xu Wang Every image should be checked if there is infinite loop in backing file chain before open it. So infinite loop check was added into bdrv_new_open(). If @filename is opened with no flags BDRV_O_NO_BACKING, the infinite loop check should be called. Signed-off-by: Xu Wang --- qemu

[Qemu-devel] [PATCH V5 6/6] block: Add infinite loop check in drive_init()

2013-08-02 Thread Xu Wang
From: Xu Wang Backing file should be checked if there is a loop in it during image boot. Becase if there is loop qemu would no response for a long time and segment fault occured. So this patch would check backing file chain if there is loop in it before open image. Signed-off-by: Xu Wang

[Qemu-devel] [PATCH V5 3/6] block: Add WIN32 platform support for backing_file_loop_check()

2013-08-02 Thread Xu Wang
From: Xu Wang Method of get_inode is different between Linux and WIN32 plateform. This patch added inode caculate method on Windows plateform so that backing file check could work on Windows plateform. Signed-off-by: Xu Wang --- block.c | 156

[Qemu-devel] [PATCH V5 0/6] Refine and export backing file loop check

2013-08-02 Thread Xu Wang
From: Xu Wang If there is loop exists in the backing file chain, many problems could be caused by it, such as no response and segment fault during system boot. Hence stopping backing file loop appear is very necessary. These patches refine and export loop checking function from collect_image_

[Qemu-devel] [PATCH V4 5/5] block: Add infinite loop check in drive_init()

2013-07-22 Thread Xu Wang
Backing file should be checked if there is a loop in it during image boot. Becase if there is loop qemu would no response for a long time and segment fault occured. So this patch would check backing file chain if there is loop in it before open image. Signed-off-by: Xu Wang --- blockdev.c | 7

[Qemu-devel] [PATCH V4 4/5] block: Add backing file loop check in change_backing_file()

2013-07-22 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 9daf63c..d996524 100644

[Qemu-devel] [PATCH V4 3/5] block: Check infinite loop in bdrv_img_create()

2013-07-22 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop was found, qemu-img create should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index

[Qemu-devel] [PATCH V4 2/5] block: Add WIN32 platform support for backing_file_loop_check()

2013-07-22 Thread Xu Wang
Method of get_inode is different between Linux and WIN32 plateform. This patch added inode caculate method on Windows plateform so that backing file check could work on Windows plateform. Signed-off-by: Xu Wang --- block.c | 160

[Qemu-devel] [PATCH V4 1/5] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-07-22 Thread Xu Wang
block.c and build a independent function named bdrv_ backing_file_loop_check(). Signed-off-by: Xu Wang --- block.c | 96 +++ include/block/block.h | 4 +++ qemu-img.c| 29 +--- 3 files changed, 109 insertions

[Qemu-devel] [PATCH V4 0/5] Redefine and export backing file loop check

2013-07-22 Thread Xu Wang
. 7. Added value of @fmt as suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (5): block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() block: Add WIN32 platform support for backing_file_loop_check() block: Check infinite loop in

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

[Qemu-devel] [PATCH V3 7/7] block: Add backing file loop check in qed_change_backing_file()

2013-07-15 Thread Xu Wang
Add backing file loop check before execute change backing file for qed format. Signed-off-by: Xu Wang --- block/qed.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/qed.c b/block/qed.c index f767b05..79c2875 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1468,6 +1468,13

[Qemu-devel] [PATCH V3 4/7] block: Add backing file loop check in change_backing_file()

2013-07-15 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index e9b9112..bd8240c 100644

[Qemu-devel] [PATCH V3 5/7] block: Add infinite loop check in drive_init()

2013-07-15 Thread Xu Wang
Backing file should be checked if there is a loop in it during image boot. Becase if there is loop qemu would no response for a long time and segment fault occured. So this patch would check backing file chain if there is loop in it before open image. Signed-off-by: Xu Wang --- blockdev.c | 6

[Qemu-devel] [PATCH V3 3/7] block: Check infinite loop in bdrv_img_create()

2013-07-15 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop was found, qemu-img create should be stopped and an error was printed. Signed-off-by: Xu Wang --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index

[Qemu-devel] [PATCH V3 2/7] block: Add WIN32 platform support for backing_file_loop_check()

2013-07-15 Thread Xu Wang
Method of get_inode is different between Linux and WIN32 plateform. This patch added inode caculate method on Windows plateform so that backing file check could work on Windows plateform. Signed-off-by: Xu Wang --- block.c | 109

[Qemu-devel] [PATCH V3 6/7] block: Add backing file loop check in qcow2_change_backing_file()

2013-07-15 Thread Xu Wang
Add backing file loop check before execute change backing file for qcow2 format. Signed-off-by: Xu Wang --- block/qcow2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 0eceefe..01bd7d5 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1195,6

[Qemu-devel] [PATCH V3 1/7] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-07-15 Thread Xu Wang
block.c and build a independent function named bdrv_ backing_file_loop_check(). Signed-off-by: Xu Wang --- block.c | 97 +++ include/block/block.h | 4 +++ qemu-img.c| 29 +-- 3 files changed, 110 insertions(+), 20

[Qemu-devel] [PATCH V3 0/7] Redefine and export backing file loop check

2013-07-15 Thread Xu Wang
suggested. 8. Added backing file loop check in qcow2.c/qed.c Xu Wang (7): block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() block: Add WIN32 platform support for backing_file_loop_check() block: Check infinite loop in bdrv_img_create() block: Add

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

Re: [Qemu-devel] [PATCH V2 2/5] Add WIN32 platform support for backing_file_loop_check()

2013-07-14 Thread Xu Wang
2013/7/10 Fam Zheng > On Mon, 07/08 03:26, Xu Wang wrote: > > Signed-off-by: Xu Wang > > --- > > block.c | 94 > + > > 1 file changed, 94 insertions(+) > > > > diff --git a/block.c b

Re: [Qemu-devel] [PATCH V2 1/5] Refine and export infinite loop checking in collect_image_info_list()

2013-07-11 Thread Xu Wang
2013/7/10 Fam Zheng > On Mon, 07/08 03:26, Xu Wang wrote: > > Signed-off-by: Xu Wang > > --- > > block.c | 101 > ++ > > include/block/block.h | 4 ++ > > qemu-img.c| 30 +

Re: [Qemu-devel] [PATCH 1/2] Refine and export infinite loop checking in collect_image_info_list()

2013-07-08 Thread Xu Wang
2013/6/29 Eric Blake > On 06/27/2013 01:38 AM, Xu Wang wrote: > > From: Xu Wang > > > > Signed-off-by: Xu Wang > > --- > > qemu-img.c | 110 > + > > 1 file changed, 89 insertions(+), 21

[Qemu-devel] [PATCH V2 5/5] Add infinite loop check in drive_init()

2013-07-08 Thread Xu Wang
Signed-off-by: Xu Wang --- blockdev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/blockdev.c b/blockdev.c index 5975dde..0178764 100644 --- a/blockdev.c +++ b/blockdev.c @@ -695,6 +695,11 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type

[Qemu-devel] [PATCH V2 3/5] Check infinite loop in bdrv_img_create()

2013-07-08 Thread Xu Wang
Signed-off-by: Xu Wang --- block.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 8dc6ded..6df25d9 100644 --- a/block.c +++ b/block.c @@ -4688,15 +4688,15 @@ void bdrv_img_create(const char *filename, const char *fmt

[Qemu-devel] [PATCH V2 2/5] Add WIN32 platform support for backing_file_loop_check()

2013-07-08 Thread Xu Wang
Signed-off-by: Xu Wang --- block.c | 94 + 1 file changed, 94 insertions(+) diff --git a/block.c b/block.c index 53b1a01..8dc6ded 100644 --- a/block.c +++ b/block.c @@ -4431,6 +4431,83 @@ bdrv_acct_done(BlockDriverState *bs

  1   2   3   4   5   >