vl.c: simplified machine_set_property

Refactored the code to re-use object_property_parse.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Greg Bellows <greg.bellows@linaro.org>
Message-id: 1418217570-15517-3-git-send-email-marcel.a@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Marcel Apfelbaum 2014-12-16 16:58:05 +00:00 committed by Peter Maydell
parent 49d2e648e8
commit 2e16898a61

5
vl.c
View File

@ -2535,7 +2535,6 @@ static int machine_set_property(const char *name, const char *value,
void *opaque)
{
Object *obj = OBJECT(opaque);
StringInputVisitor *siv;
Error *local_err = NULL;
char *c, *qom_name;
@ -2551,9 +2550,7 @@ static int machine_set_property(const char *name, const char *value,
}
}
siv = string_input_visitor_new(value);
object_property_set(obj, string_input_get_visitor(siv), qom_name, &local_err);
string_input_visitor_cleanup(siv);
object_property_parse(obj, value, qom_name, &local_err);
g_free(qom_name);
if (local_err) {