V19: docs
qemu-iotests: add add-cow iotests support

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 <wdongxu@linux.vnet.ibm.com>

Conflicts:
	tests/qemu-iotests/common.rc
make path_has_protocol non static

We will use path_has_protocol outside block.c, so just make it public.

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
qed_read_string to bdrv_read_string

Make qed_read_string function to a common interface, so move it to
block.c.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
rename qcow2-cache.c to block-cache.c

Block layer will use qcow2-cache as common cache code, so rename
it to block-cache.c.
Make block-cache.c be common interface

To use block-cache.c be common cache interface, we need to add
some parameter to identify cache's type.

Define a struct named BlockTableType, pass BlockTableType and
table size parameters to block cache initialization function.

v17-v18:
1) move struct to source file.
2) cluster_size->table_size.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
add debug event for add-cow

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
add-cow file format core code.

add-cow file format core code. It use block-cache.c as cache code.
It lacks of snapshot_blkdev support.

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.
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 <wdongxu@linux.vnet.ibm.com>

Conflicts:
	block/block-cache.c
without flush