mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
Revert "qobject: let object_property_get_str() use new API"
Commitaafb21a0b9
"qobject: let object_property_get_str() use new API" isn't much of a simplification. Not worth having object_property_get_str() differ from the other object_property_get_FOO(). Revert. This reverts commitaafb21a0b9
. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-12-armbru@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
410f44f596
commit
26c52828f6
1 changed files with 6 additions and 3 deletions
|
@ -1415,15 +1415,18 @@ char *object_property_get_str(Object *obj, const char *name,
|
||||||
Error **errp)
|
Error **errp)
|
||||||
{
|
{
|
||||||
QObject *ret = object_property_get_qobject(obj, name, errp);
|
QObject *ret = object_property_get_qobject(obj, name, errp);
|
||||||
|
QString *qstring;
|
||||||
char *retval;
|
char *retval;
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
qstring = qobject_to(QString, ret);
|
||||||
retval = g_strdup(qobject_get_try_str(ret));
|
if (!qstring) {
|
||||||
if (!retval) {
|
|
||||||
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "string");
|
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "string");
|
||||||
|
retval = NULL;
|
||||||
|
} else {
|
||||||
|
retval = g_strdup(qstring_get_str(qstring));
|
||||||
}
|
}
|
||||||
|
|
||||||
qobject_unref(ret);
|
qobject_unref(ret);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue