[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v21 10/25] iscsi.c: replace QEMUOptionParameter with
From: |
Chunyan Liu |
Subject: |
[Qemu-devel] [PATCH v21 10/25] iscsi.c: replace QEMUOptionParameter with QemuOpts |
Date: |
Fri, 21 Feb 2014 18:35:33 +0800 |
iscsi.c: replace QEMUOptionParamter with QemuOpts
Signed-off-by: Dong Xu Wang <address@hidden>
Signed-off-by: Chunyan Liu <address@hidden>
---
block/iscsi.c | 29 ++++++++++++++---------------
1 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index f8e496f..6d00ec0 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1382,13 +1382,8 @@ static int iscsi_create(const char *filename,
QEMUOptionParameter *options,
bs = bdrv_new("");
/* Read out options */
- while (options && options->name) {
- if (!strcmp(options->name, "size")) {
- total_size = options->value.n / BDRV_SECTOR_SIZE;
- }
- options++;
- }
-
+ total_size =
+ qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0) / BDRV_SECTOR_SIZE;
bs->opaque = g_malloc0(sizeof(struct IscsiLun));
iscsilun = bs->opaque;
@@ -1439,13 +1434,17 @@ static int iscsi_get_info(BlockDriverState *bs,
BlockDriverInfo *bdi)
return 0;
}
-static QEMUOptionParameter iscsi_create_options[] = {
- {
- .name = BLOCK_OPT_SIZE,
- .type = OPT_SIZE,
- .help = "Virtual disk size"
- },
- { NULL }
+static QemuOptsList iscsi_create_opts = {
+ .name = "iscsi-create-opts",
+ .head = QTAILQ_HEAD_INITIALIZER(iscsi_create_opts.head),
+ .desc = {
+ {
+ .name = BLOCK_OPT_SIZE,
+ .type = QEMU_OPT_SIZE,
+ .help = "Virtual disk size"
+ },
+ { /* end of list */ }
+ }
};
static BlockDriver bdrv_iscsi = {
@@ -1457,7 +1456,7 @@ static BlockDriver bdrv_iscsi = {
.bdrv_file_open = iscsi_open,
.bdrv_close = iscsi_close,
.bdrv_create = iscsi_create,
- .create_options = iscsi_create_options,
+ .create_opts = &iscsi_create_opts,
.bdrv_reopen_prepare = iscsi_reopen_prepare,
.bdrv_getlength = iscsi_getlength,
--
1.6.0.2
- [Qemu-devel] [PATCH v21 02/25] qapi: output def_value_str when query command line options, (continued)
- [Qemu-devel] [PATCH v21 02/25] qapi: output def_value_str when query command line options, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 04/25] improve assertion in qemu_opt_get functions, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 06/25] add convert functions between QEMUOptionParameter to QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 05/25] add some QemuOpts functions for replace work, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 03/25] improve some functions in qemu-option.c, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 07/25] change block layer to support both QemuOpts and QEMUOptionParamter, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 09/25] gluster.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 11/25] qcow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 08/25] cow.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 13/25] qed.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 10/25] iscsi.c: replace QEMUOptionParameter with QemuOpts,
Chunyan Liu <=
- [Qemu-devel] [PATCH v21 12/25] qcow2.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 16/25] raw_bsd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 17/25] rbd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 15/25] raw-win32.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 18/25] sheepdog.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 14/25] raw-posix.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 20/25] vdi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 19/25] ssh.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 21/25] vmdk.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21
- [Qemu-devel] [PATCH v21 22/25] vpc.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/02/21