aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2014-07-18 19:32:37 +0300
committerAndreas Färber <afaerber@suse.de>2014-07-21 18:58:36 +0200
commitb0ddb8bf6bf1739240640f353fd49e9e5d3f85dc (patch)
tree4c65353b98b5ffac28e35b1555929f832d390f11 /vl.c
parent147fc419734b057b9d9154c2ca0d9d397054104b (diff)
machine: Replace underscores in machine's property names
Replaced '_' with '-' to comply with QOM guidelines. Made the conversion from command line to QMP in vl.c. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 6abedcfae7..fe451aaf15 100644
--- a/vl.c
+++ b/vl.c
@@ -2823,15 +2823,25 @@ static int object_set_property(const char *name, const char *value, void *opaque
Object *obj = OBJECT(opaque);
StringInputVisitor *siv;
Error *local_err = NULL;
+ char *c, *qom_name;
if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0 ||
strcmp(name, "type") == 0) {
return 0;
}
+ qom_name = g_strdup(name);
+ c = qom_name;
+ while (*c++) {
+ if (*c == '_') {
+ *c = '-';
+ }
+ }
+
siv = string_input_visitor_new(value);
- object_property_set(obj, string_input_get_visitor(siv), name, &local_err);
+ object_property_set(obj, string_input_get_visitor(siv), qom_name, &local_err);
string_input_visitor_cleanup(siv);
+ g_free(qom_name);
if (local_err) {
qerror_report_err(local_err);