[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC Patch v3 08/18] blktap2: use correct way to define array.
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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |