[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 09/17] tools: blktap2: use correct way to define array.



On Oct 13, 2014 10:13 PM, "Wen Congyang" <wency@xxxxxxxxxxxxxx> wrote:
>
> Currently, we use the following way to define an array:
> type array[] = {
> Â Â [index] = xxx,
> Â Â 0,
> };
> So array[index+1] will be NULL. If index is not the last
> index, it will override another index.
>
> tapdisk_vbd_index is not defined, but array[DISK_TYPE_VINDEX]
> is overridden, so we don't find this problem when building
> the source.
>
> Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx>
> Cc: Shriram Rajagopalan <rshriram@xxxxxxxxx>
> ---
> Âtools/blktap2/drivers/tapdisk-disktype.c | 12 ++----------
> Âtools/blktap2/drivers/tapdisk-disktype.h |Â 2 +-
> Â2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/tools/blktap2/drivers/tapdisk-disktype.c b/tools/blktap2/drivers/tapdisk-disktype.c
> index e9a6890..8d1383b 100644
> --- a/tools/blktap2/drivers/tapdisk-disktype.c
> +++ b/tools/blktap2/drivers/tapdisk-disktype.c
> @@ -82,12 +82,6 @@ static const disk_info_t block_cache_disk = {
> Â Â Â Â 1,
> Â};
>
> -static const disk_info_t vhd_index_disk = {
> -Â Â Â Â"vhdi",
> -Â Â Â Â"vhd index image (vhdi)",
> -Â Â Â Â1,
> -};
> -
> Âstatic const disk_info_t log_disk = {
> Â Â Â Â "log",
> Â Â Â Â "write logger (log)",
> @@ -110,9 +104,8 @@ const disk_info_t *tapdisk_disk_types[] = {
> Â Â Â Â [DISK_TYPE_QCOW]Â Â Â Â = &qcow_disk,
> Â Â Â Â [DISK_TYPE_BLOCK_CACHE] = &block_cache_disk,
> Â Â Â Â [DISK_TYPE_LOG] = &log_disk,
> -Â Â Â Â[DISK_TYPE_VINDEX]Â Â Â = &vhd_index_disk,
> Â Â Â Â [DISK_TYPE_REMUS]Â Â Â Â= &remus_disk,
> -Â Â Â Â0,
> +Â Â Â Â[DISK_TYPE_MAX]Â Â Â Â Â= NULL,
> Â};
>
> Âextern struct tap_disk tapdisk_aio;
> @@ -137,10 +130,9 @@ const struct tap_disk *tapdisk_disk_drivers[] = {
> Â Â Â Â [DISK_TYPE_RAM]Â Â Â Â Â= &tapdisk_ram,
> Â Â Â Â [DISK_TYPE_QCOW]Â Â Â Â = &tapdisk_qcow,
> Â Â Â Â [DISK_TYPE_BLOCK_CACHE] = &tapdisk_block_cache,
> -Â Â Â Â[DISK_TYPE_VINDEX]Â Â Â = &tapdisk_vhd_index,
> Â Â Â Â [DISK_TYPE_LOG]Â Â Â Â Â= &tapdisk_log,
> Â Â Â Â [DISK_TYPE_REMUS]Â Â Â Â= &tapdisk_remus,
> -Â Â Â Â0,
> +Â Â Â Â[DISK_TYPE_MAX]Â Â Â Â Â= NULL,
> Â};
>
> Âint
> diff --git a/tools/blktap2/drivers/tapdisk-disktype.h b/tools/blktap2/drivers/tapdisk-disktype.h
> index b697eea..c574990 100644
> --- a/tools/blktap2/drivers/tapdisk-disktype.h
> +++ b/tools/blktap2/drivers/tapdisk-disktype.h
> @@ -39,7 +39,7 @@
> Â#define DISK_TYPE_BLOCK_CACHE 7
> Â#define DISK_TYPE_LOGÂ Â Â Â Â8
> Â#define DISK_TYPE_REMUSÂ Â Â Â9
> -#define DISK_TYPE_VINDEXÂ Â Â 10
> +#define DISK_TYPE_MAXÂ Â Â Â Â10
>
> Â#define DISK_TYPE_NAME_MAXÂ Â 32
>
> --
> 1.9.3
>

I can only ack changes to block-remus file. I cannot ack changes to other parts of the blktap2 subsystem, as I am not their maintainer nor do I know much about that code. So I leave it to IanJ or IanC's discretion.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.