[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [v19 17/25] ssh.c: replace QEMUOptionParameter with QemuOpt
From: |
Chunyan Liu |
Subject: |
[Qemu-devel] [v19 17/25] ssh.c: replace QEMUOptionParameter with QemuOpts |
Date: |
Mon, 20 Jan 2014 22:20:00 +0800 |
ssh.c: replace QEMUOptionParameter with QemuOpts
Signed-off-by: Dong Xu Wang <address@hidden>
Signed-off-by: Chunyan Liu <address@hidden>
---
block/ssh.c | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/block/ssh.c b/block/ssh.c
index aa63c9d..8fd2175 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -642,16 +642,20 @@ static int ssh_file_open(BlockDriverState *bs, QDict
*options, int bdrv_flags,
return ret;
}
-static QEMUOptionParameter ssh_create_options[] = {
- {
- .name = BLOCK_OPT_SIZE,
- .type = OPT_SIZE,
- .help = "Virtual disk size"
- },
- { NULL }
+static QemuOptsList ssh_create_opts = {
+ .name = "ssh-create-opts",
+ .head = QTAILQ_HEAD_INITIALIZER(ssh_create_opts.head),
+ .desc = {
+ {
+ .name = BLOCK_OPT_SIZE,
+ .type = QEMU_OPT_SIZE,
+ .help = "Virtual disk size"
+ },
+ { /* end of list */ }
+ }
};
-static int ssh_create(const char *filename, QEMUOptionParameter *options,
+static int ssh_create(const char *filename, QemuOpts *opts,
Error **errp)
{
int r, ret;
@@ -665,12 +669,7 @@ static int ssh_create(const char *filename,
QEMUOptionParameter *options,
ssh_state_init(&s);
/* Get desired file size. */
- while (options && options->name) {
- if (!strcmp(options->name, BLOCK_OPT_SIZE)) {
- total_size = options->value.n;
- }
- options++;
- }
+ total_size = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0);
DPRINTF("total_size=%" PRIi64, total_size);
uri_options = qdict_new();
@@ -1044,14 +1043,14 @@ static BlockDriver bdrv_ssh = {
.instance_size = sizeof(BDRVSSHState),
.bdrv_parse_filename = ssh_parse_filename,
.bdrv_file_open = ssh_file_open,
- .bdrv_create = ssh_create,
+ .bdrv_create2 = ssh_create,
.bdrv_close = ssh_close,
.bdrv_has_zero_init = ssh_has_zero_init,
.bdrv_co_readv = ssh_co_readv,
.bdrv_co_writev = ssh_co_writev,
.bdrv_getlength = ssh_getlength,
.bdrv_co_flush_to_disk = ssh_co_flush,
- .create_options = ssh_create_options,
+ .create_opts = &ssh_create_opts,
};
static void bdrv_ssh_init(void)
--
1.6.0.2
- [Qemu-devel] [v19 09/25] qcow.c: replace QEMUOptionParamter with QemuOpts, (continued)
- [Qemu-devel] [v19 09/25] qcow.c: replace QEMUOptionParamter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 10/25] qcow2.c: replace QEMUOptionParameter with QemuOpts in create, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 11/25] qcow2.c: replace QEMUOptionParameter with QemuOpts in amend options, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 15/25] rbd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 12/25] qed.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 13/25] raw-posix.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 16/25] sheepdog.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 14/25] raw-win32.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 18/25] vdi.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 17/25] ssh.c: replace QEMUOptionParameter with QemuOpts,
Chunyan Liu <=
- [Qemu-devel] [v19 21/25] raw_bsd.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 19/25] vmdk.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 20/25] vpc.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 22/25] vhdx.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 23/25] vvfat.c: replace QEMUOptionParameter with QemuOpts, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 25/25] change back to original name from bdrv_create2 to bdrv_create, Chunyan Liu, 2014/01/20
- [Qemu-devel] [v19 24/25] cleanup QEMUOptionParameter, Chunyan Liu, 2014/01/20
- Re: [Qemu-devel] [v19 00/25] replace QEMUOptionParameter with QemuOpts, Kevin Wolf, 2014/01/22