Use C99 initializers for BlockDriver methods

Consistently use the C99 named initializer format for the BlockDriver
methods to make the method table more readable and more easily
extensible.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6768 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2009-03-07 22:00:29 +00:00
parent aaedd1f9f3
commit e60f469ca8
13 changed files with 129 additions and 150 deletions

View File

@ -242,11 +242,10 @@ static void bochs_close(BlockDriverState *bs)
} }
BlockDriver bdrv_bochs = { BlockDriver bdrv_bochs = {
"bochs", .format_name = "bochs",
sizeof(BDRVBochsState), .instance_size = sizeof(BDRVBochsState),
bochs_probe, .bdrv_probe = bochs_probe,
bochs_open, .bdrv_open = bochs_open,
bochs_read, .bdrv_read = bochs_read,
NULL, .bdrv_close = bochs_close,
bochs_close,
}; };

View File

@ -154,11 +154,10 @@ static void cloop_close(BlockDriverState *bs)
} }
BlockDriver bdrv_cloop = { BlockDriver bdrv_cloop = {
"cloop", .format_name = "cloop",
sizeof(BDRVCloopState), .instance_size = sizeof(BDRVCloopState),
cloop_probe, .bdrv_probe = cloop_probe,
cloop_open, .bdrv_open = cloop_open,
cloop_read, .bdrv_read = cloop_read,
NULL, .bdrv_close = cloop_close,
cloop_close,
}; };

View File

@ -253,15 +253,15 @@ static void cow_flush(BlockDriverState *bs)
} }
BlockDriver bdrv_cow = { BlockDriver bdrv_cow = {
"cow", .format_name = "cow",
sizeof(BDRVCowState), .instance_size = sizeof(BDRVCowState),
cow_probe, .bdrv_probe = cow_probe,
cow_open, .bdrv_open = cow_open,
cow_read, .bdrv_read = cow_read,
cow_write, .bdrv_write = cow_write,
cow_close, .bdrv_close = cow_close,
cow_create, .bdrv_create = cow_create,
cow_flush, .bdrv_flush = cow_flush,
cow_is_allocated, .bdrv_is_allocated = cow_is_allocated,
}; };
#endif #endif

View File

@ -284,11 +284,10 @@ static void dmg_close(BlockDriverState *bs)
} }
BlockDriver bdrv_dmg = { BlockDriver bdrv_dmg = {
"dmg", .format_name = "dmg",
sizeof(BDRVDMGState), .instance_size = sizeof(BDRVDMGState),
dmg_probe, .bdrv_probe = dmg_probe,
dmg_open, .bdrv_open = dmg_open,
dmg_read, .bdrv_read = dmg_read,
NULL, .bdrv_close = dmg_close,
dmg_close,
}; };

View File

@ -177,13 +177,12 @@ static int64_t nbd_getlength(BlockDriverState *bs)
} }
BlockDriver bdrv_nbd = { BlockDriver bdrv_nbd = {
"nbd", .format_name = "nbd",
sizeof(BDRVNBDState), .instance_size = sizeof(BDRVNBDState),
NULL, /* no probe for protocols */ .bdrv_open = nbd_open,
nbd_open, .bdrv_read = nbd_read,
nbd_read, .bdrv_write = nbd_write,
nbd_write, .bdrv_close = nbd_close,
nbd_close, .bdrv_getlength = nbd_getlength,
.bdrv_getlength = nbd_getlength, .protocol_name = "nbd",
.protocol_name = "nbd",
}; };

View File

@ -164,11 +164,10 @@ static void parallels_close(BlockDriverState *bs)
} }
BlockDriver bdrv_parallels = { BlockDriver bdrv_parallels = {
"parallels", .format_name = "parallels",
sizeof(BDRVParallelsState), .instance_size = sizeof(BDRVParallelsState),
parallels_probe, .bdrv_probe = parallels_probe,
parallels_open, .bdrv_open = parallels_open,
parallels_read, .bdrv_read = parallels_read,
NULL, .bdrv_close = parallels_close,
parallels_close,
}; };

View File

@ -887,23 +887,20 @@ static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
} }
BlockDriver bdrv_qcow = { BlockDriver bdrv_qcow = {
"qcow", .format_name = "qcow",
sizeof(BDRVQcowState), .instance_size = sizeof(BDRVQcowState),
qcow_probe, .bdrv_probe = qcow_probe,
qcow_open, .bdrv_open = qcow_open,
NULL, .bdrv_close = qcow_close,
NULL, .bdrv_create = qcow_create,
qcow_close, .bdrv_flush = qcow_flush,
qcow_create, .bdrv_is_allocated = qcow_is_allocated,
qcow_flush, .bdrv_set_key = qcow_set_key,
qcow_is_allocated, .bdrv_make_empty = qcow_make_empty,
qcow_set_key, .bdrv_aio_read = qcow_aio_read,
qcow_make_empty, .bdrv_aio_write = qcow_aio_write,
.bdrv_aio_cancel = qcow_aio_cancel,
.bdrv_aio_read = qcow_aio_read, .aiocb_size = sizeof(QCowAIOCB),
.bdrv_aio_write = qcow_aio_write,
.bdrv_aio_cancel = qcow_aio_cancel,
.aiocb_size = sizeof(QCowAIOCB),
.bdrv_write_compressed = qcow_write_compressed, .bdrv_write_compressed = qcow_write_compressed,
.bdrv_get_info = qcow_get_info, .bdrv_get_info = qcow_get_info,
}; };

View File

@ -2646,28 +2646,26 @@ static void dump_refcounts(BlockDriverState *bs)
#endif #endif
BlockDriver bdrv_qcow2 = { BlockDriver bdrv_qcow2 = {
"qcow2", .format_name = "qcow2",
sizeof(BDRVQcowState), .instance_size = sizeof(BDRVQcowState),
qcow_probe, .bdrv_probe = qcow_probe,
qcow_open, .bdrv_open = qcow_open,
NULL, .bdrv_close = qcow_close,
NULL, .bdrv_create = qcow_create,
qcow_close, .bdrv_flush = qcow_flush,
qcow_create, .bdrv_is_allocated = qcow_is_allocated,
qcow_flush, .bdrv_set_key = qcow_set_key,
qcow_is_allocated, .bdrv_make_empty = qcow_make_empty,
qcow_set_key,
qcow_make_empty,
.bdrv_aio_read = qcow_aio_read, .bdrv_aio_read = qcow_aio_read,
.bdrv_aio_write = qcow_aio_write, .bdrv_aio_write = qcow_aio_write,
.bdrv_aio_cancel = qcow_aio_cancel, .bdrv_aio_cancel = qcow_aio_cancel,
.aiocb_size = sizeof(QCowAIOCB), .aiocb_size = sizeof(QCowAIOCB),
.bdrv_write_compressed = qcow_write_compressed, .bdrv_write_compressed = qcow_write_compressed,
.bdrv_snapshot_create = qcow_snapshot_create, .bdrv_snapshot_create = qcow_snapshot_create,
.bdrv_snapshot_goto = qcow_snapshot_goto, .bdrv_snapshot_goto = qcow_snapshot_goto,
.bdrv_snapshot_delete = qcow_snapshot_delete, .bdrv_snapshot_delete = qcow_snapshot_delete,
.bdrv_snapshot_list = qcow_snapshot_list, .bdrv_snapshot_list = qcow_snapshot_list,
.bdrv_get_info = qcow_get_info, .bdrv_get_info = qcow_get_info,
}; };

View File

@ -1180,32 +1180,28 @@ static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
#endif /* !linux */ #endif /* !linux */
BlockDriver bdrv_host_device = { BlockDriver bdrv_host_device = {
"host_device", .format_name = "host_device",
sizeof(BDRVRawState), .instance_size = sizeof(BDRVRawState),
NULL, /* no probe for protocols */ .bdrv_open = hdev_open,
hdev_open, .bdrv_close = raw_close,
NULL, .bdrv_flush = raw_flush,
NULL,
raw_close,
NULL,
raw_flush,
#ifdef CONFIG_AIO #ifdef CONFIG_AIO
.bdrv_aio_read = raw_aio_read, .bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write, .bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel, .bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB), .aiocb_size = sizeof(RawAIOCB),
#endif #endif
.bdrv_pread = raw_pread, .bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite, .bdrv_pwrite = raw_pwrite,
.bdrv_getlength = raw_getlength, .bdrv_getlength = raw_getlength,
/* removable device support */ /* removable device support */
.bdrv_is_inserted = raw_is_inserted, .bdrv_is_inserted = raw_is_inserted,
.bdrv_media_changed = raw_media_changed, .bdrv_media_changed = raw_media_changed,
.bdrv_eject = raw_eject, .bdrv_eject = raw_eject,
.bdrv_set_locked = raw_set_locked, .bdrv_set_locked = raw_set_locked,
/* generic scsi device */ /* generic scsi device */
.bdrv_ioctl = raw_ioctl, .bdrv_ioctl = raw_ioctl,
}; };

View File

@ -495,23 +495,19 @@ static int raw_set_locked(BlockDriverState *bs, int locked)
#endif #endif
BlockDriver bdrv_host_device = { BlockDriver bdrv_host_device = {
"host_device", .format_name = "host_device",
sizeof(BDRVRawState), .instance_size = sizeof(BDRVRawState),
NULL, /* no probe for protocols */ .bdrv_open = hdev_open,
hdev_open, .bdrv_close = raw_close,
NULL, .bdrv_flush = raw_flush,
NULL,
raw_close,
NULL,
raw_flush,
#ifdef WIN32_AIO #ifdef WIN32_AIO
.bdrv_aio_read = raw_aio_read, .bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write, .bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel, .bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB); .aiocb_size = sizeof(RawAIOCB);
#endif #endif
.bdrv_pread = raw_pread, .bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite, .bdrv_pwrite = raw_pwrite,
.bdrv_getlength = raw_getlength, .bdrv_getlength = raw_getlength,
}; };

View File

@ -812,14 +812,14 @@ static void vmdk_flush(BlockDriverState *bs)
} }
BlockDriver bdrv_vmdk = { BlockDriver bdrv_vmdk = {
"vmdk", .format_name = "vmdk",
sizeof(BDRVVmdkState), .instance_size = sizeof(BDRVVmdkState),
vmdk_probe, .bdrv_probe = vmdk_probe,
vmdk_open, .bdrv_open = vmdk_open,
vmdk_read, .bdrv_read = vmdk_read,
vmdk_write, .bdrv_write = vmdk_write,
vmdk_close, .bdrv_close = vmdk_close,
vmdk_create, .bdrv_create = vmdk_create,
vmdk_flush, .bdrv_flush = vmdk_flush,
vmdk_is_allocated, .bdrv_is_allocated = vmdk_is_allocated,
}; };

View File

@ -582,12 +582,12 @@ static void vpc_close(BlockDriverState *bs)
} }
BlockDriver bdrv_vpc = { BlockDriver bdrv_vpc = {
"vpc", .format_name = "vpc",
sizeof(BDRVVPCState), .instance_size = sizeof(BDRVVPCState),
vpc_probe, .bdrv_probe = vpc_probe,
vpc_open, .bdrv_open = vpc_open,
vpc_read, .bdrv_read = vpc_read,
vpc_write, .bdrv_write = vpc_write,
vpc_close, .bdrv_close = vpc_close,
vpc_create, .bdrv_create = vpc_create,
}; };

View File

@ -2805,17 +2805,14 @@ static void vvfat_close(BlockDriverState *bs)
} }
BlockDriver bdrv_vvfat = { BlockDriver bdrv_vvfat = {
"vvfat", .format_name = "vvfat",
sizeof(BDRVVVFATState), .instance_size = sizeof(BDRVVVFATState),
NULL, /* no probe for protocols */ .bdrv_open = vvfat_open,
vvfat_open, .bdrv_read = vvfat_read,
vvfat_read, .bdrv_write = vvfat_write,
vvfat_write, .bdrv_close = vvfat_close,
vvfat_close, .bdrv_is_allocated = vvfat_is_allocated,
NULL, /* ??? Not sure if we can do any meaningful flushing. */ .protocol_name = "fat",
NULL,
vvfat_is_allocated,
.protocol_name = "fat",
}; };
#ifdef DEBUG #ifdef DEBUG