[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's prope
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names |
Date: |
Thu, 17 Jul 2014 17:55:29 +0100 |
On 29 June 2014 10:09, Marcel Apfelbaum <address@hidden> wrote:
> Replaced '_' with '-' to comply with QOM guidelines.
> Made the conversion from HMP to QMP in vl.c
>
> Signed-off-by: Marcel Apfelbaum <address@hidden>
> index a1686ef..7587c97 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2820,15 +2820,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);
Memory allocated with g_strdup...
> + 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);
> + free(qom_name);
...but freed with free rather than g_free.
>
> if (local_err) {
> qerror_report_err(local_err);
> --
> 1.8.3.1
thanks
-- PMM
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Marcel Apfelbaum, 2014/07/17
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Paolo Bonzini, 2014/07/17
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Andreas Färber, 2014/07/17
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Michael Roth, 2014/07/17
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Paolo Bonzini, 2014/07/17
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Andreas Färber, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Paolo Bonzini, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Marcel Apfelbaum, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Andreas Färber, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Paolo Bonzini, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Marcel Apfelbaum, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Andreas Färber, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Marcel Apfelbaum, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Andreas Färber, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Marcel Apfelbaum, 2014/07/18
- Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names, Paolo Bonzini, 2014/07/18