aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/crypto.c30
-rw-r--r--block/qapi.c9
2 files changed, 18 insertions, 21 deletions
diff --git a/block/crypto.c b/block/crypto.c
index cb8cbc2cc9..7eaa0571b5 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -193,17 +193,16 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
QemuOpts *opts,
Error **errp)
{
- OptsVisitor *ov;
+ Visitor *v;
QCryptoBlockOpenOptions *ret = NULL;
Error *local_err = NULL;
ret = g_new0(QCryptoBlockOpenOptions, 1);
ret->format = format;
- ov = opts_visitor_new(opts);
+ v = opts_visitor_new(opts);
- visit_start_struct(opts_get_visitor(ov),
- NULL, NULL, 0, &local_err);
+ visit_start_struct(v, NULL, NULL, 0, &local_err);
if (local_err) {
goto out;
}
@@ -211,7 +210,7 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
switch (format) {
case Q_CRYPTO_BLOCK_FORMAT_LUKS:
visit_type_QCryptoBlockOptionsLUKS_members(
- opts_get_visitor(ov), &ret->u.luks, &local_err);
+ v, &ret->u.luks, &local_err);
break;
default:
@@ -219,10 +218,10 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
break;
}
if (!local_err) {
- visit_check_struct(opts_get_visitor(ov), &local_err);
+ visit_check_struct(v, &local_err);
}
- visit_end_struct(opts_get_visitor(ov));
+ visit_end_struct(v, NULL);
out:
if (local_err) {
@@ -230,7 +229,7 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
qapi_free_QCryptoBlockOpenOptions(ret);
ret = NULL;
}
- opts_visitor_cleanup(ov);
+ visit_free(v);
return ret;
}
@@ -240,17 +239,16 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
QemuOpts *opts,
Error **errp)
{
- OptsVisitor *ov;
+ Visitor *v;
QCryptoBlockCreateOptions *ret = NULL;
Error *local_err = NULL;
ret = g_new0(QCryptoBlockCreateOptions, 1);
ret->format = format;
- ov = opts_visitor_new(opts);
+ v = opts_visitor_new(opts);
- visit_start_struct(opts_get_visitor(ov),
- NULL, NULL, 0, &local_err);
+ visit_start_struct(v, NULL, NULL, 0, &local_err);
if (local_err) {
goto out;
}
@@ -258,7 +256,7 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
switch (format) {
case Q_CRYPTO_BLOCK_FORMAT_LUKS:
visit_type_QCryptoBlockCreateOptionsLUKS_members(
- opts_get_visitor(ov), &ret->u.luks, &local_err);
+ v, &ret->u.luks, &local_err);
break;
default:
@@ -266,10 +264,10 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
break;
}
if (!local_err) {
- visit_check_struct(opts_get_visitor(ov), &local_err);
+ visit_check_struct(v, &local_err);
}
- visit_end_struct(opts_get_visitor(ov));
+ visit_end_struct(v, NULL);
out:
if (local_err) {
@@ -277,7 +275,7 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
qapi_free_QCryptoBlockCreateOptions(ret);
ret = NULL;
}
- opts_visitor_cleanup(ov);
+ visit_free(v);
return ret;
}
diff --git a/block/qapi.c b/block/qapi.c
index 5594f74d17..6f947e3e66 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -690,16 +690,15 @@ static void dump_qdict(fprintf_function func_fprintf, void *f, int indentation,
void bdrv_image_info_specific_dump(fprintf_function func_fprintf, void *f,
ImageInfoSpecific *info_spec)
{
- QmpOutputVisitor *ov = qmp_output_visitor_new();
QObject *obj, *data;
+ Visitor *v = qmp_output_visitor_new(&obj);
- visit_type_ImageInfoSpecific(qmp_output_get_visitor(ov), NULL, &info_spec,
- &error_abort);
- obj = qmp_output_get_qobject(ov);
+ visit_type_ImageInfoSpecific(v, NULL, &info_spec, &error_abort);
+ visit_complete(v, &obj);
assert(qobject_type(obj) == QTYPE_QDICT);
data = qdict_get(qobject_to_qdict(obj), "data");
dump_qobject(func_fprintf, f, 1, data);
- qmp_output_visitor_cleanup(ov);
+ visit_free(v);
}
void bdrv_image_info_dump(fprintf_function func_fprintf, void *f,