mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
block: Factor out qobject_input_visitor_new_flat_confused()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
92adf9dbcd
commit
af91062ee1
13 changed files with 53 additions and 62 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "qapi/qmp/qlist.h"
|
||||
#include "qapi/qmp/qnum.h"
|
||||
#include "qapi/qmp/qstring.h"
|
||||
#include "qapi/qobject-input-visitor.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
|
@ -529,7 +530,7 @@ QObject *qdict_crumple(const QDict *src, Error **errp)
|
|||
* used for anything else, and it should go away once the block
|
||||
* subsystem has been cleaned up.
|
||||
*/
|
||||
QObject *qdict_crumple_for_keyval_qiv(QDict *src, Error **errp)
|
||||
static QObject *qdict_crumple_for_keyval_qiv(QDict *src, Error **errp)
|
||||
{
|
||||
QDict *tmp = NULL;
|
||||
char *buf;
|
||||
|
@ -695,3 +696,28 @@ bool qdict_rename_keys(QDict *qdict, const QDictRenames *renames, Error **errp)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a QObject input visitor for flat @qdict with possibly
|
||||
* confused scalar types.
|
||||
*
|
||||
* The block subsystem uses this function to visit its flat QDict with
|
||||
* possibly confused scalar types. It should not be used for anything
|
||||
* else, and it should go away once the block subsystem has been
|
||||
* cleaned up.
|
||||
*/
|
||||
Visitor *qobject_input_visitor_new_flat_confused(QDict *qdict,
|
||||
Error **errp)
|
||||
{
|
||||
QObject *crumpled;
|
||||
Visitor *v;
|
||||
|
||||
crumpled = qdict_crumple_for_keyval_qiv(qdict, errp);
|
||||
if (!crumpled) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
v = qobject_input_visitor_new_keyval(crumpled);
|
||||
qobject_unref(crumpled);
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue