[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v14 16/19] block: convert crypto driver to use QObje
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PATCH v14 16/19] block: convert crypto driver to use QObjectInputVisitor |
Date: |
Tue, 27 Sep 2016 14:13:18 +0100 |
The crypto block driver currently uses OptsVisitor to
convert from the block driver open/create options into
QCryptoBlockOpenOptions/QCryptoBlockCreateOptions. This
is easily replaced by use of QObjectInputVisitor with
no need to enable any compatibility options, since the
structs dealt with contain only scalars.
Signed-off-by: Daniel P. Berrange <address@hidden>
---
block/crypto.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/block/crypto.c b/block/crypto.c
index 7aa7eb5..fee6c99 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -23,7 +23,7 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "crypto/block.h"
-#include "qapi/opts-visitor.h"
+#include "qapi/qobject-input-visitor.h"
#include "qapi-visit.h"
#include "qapi/error.h"
@@ -206,7 +206,10 @@ block_crypto_open_opts_init(QCryptoBlockFormat format,
ret = g_new0(QCryptoBlockOpenOptions, 1);
ret->format = format;
- v = opts_visitor_new(opts);
+ v = qobject_input_visitor_new_opts(opts, false, 0, false, &local_err);
+ if (local_err) {
+ goto out;
+ }
visit_start_struct(v, NULL, NULL, 0, &local_err);
if (local_err) {
@@ -252,7 +255,10 @@ block_crypto_create_opts_init(QCryptoBlockFormat format,
ret = g_new0(QCryptoBlockCreateOptions, 1);
ret->format = format;
- v = opts_visitor_new(opts);
+ v = qobject_input_visitor_new_opts(opts, false, 0, false, &local_err);
+ if (local_err) {
+ goto out;
+ }
visit_start_struct(v, NULL, NULL, 0, &local_err);
if (local_err) {
--
2.7.4
- [Qemu-devel] [PATCH v14 07/19] qapi: don't pass two copies of TestInputVisitorData to tests, (continued)
- [Qemu-devel] [PATCH v14 07/19] qapi: don't pass two copies of TestInputVisitorData to tests, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 09/19] qapi: permit auto-creating single element lists, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 08/19] qapi: permit scalar type conversions in QObjectInputVisitor, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 05/19] qapi: rename QmpInputVisitor to QObjectInputVisitor, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 10/19] qapi: permit auto-creating nested structs, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 06/19] qapi: rename QmpOutputVisitor to QObjectOutputVisitor, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 11/19] qapi: add integer range support for QObjectInputVisitor, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 14/19] hmp: support non-scalar properties with object_add, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 13/19] qom: support non-scalar properties with -object, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 12/19] qapi: allow QObjectInputVisitor to be created with QemuOpts, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 16/19] block: convert crypto driver to use QObjectInputVisitor,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v14 17/19] acpi: convert to QObjectInputVisitor for -acpi parsing, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 15/19] numa: convert to use QObjectInputVisitor for -numa, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 18/19] net: convert to QObjectInputVisitor for -net/-netdev parsing, Daniel P. Berrange, 2016/09/27
- [Qemu-devel] [PATCH v14 19/19] qapi: delete unused OptsVisitor code, Daniel P. Berrange, 2016/09/27