From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7oyL-0006Xh-IV for qemu-devel@nongnu.org; Thu, 17 Jul 2014 12:56:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7oyF-0002Yr-BB for qemu-devel@nongnu.org; Thu, 17 Jul 2014 12:55:57 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:37497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7oyF-0002Yj-4Q for qemu-devel@nongnu.org; Thu, 17 Jul 2014 12:55:51 -0400 Received: by mail-la0-f43.google.com with SMTP id hr17so1975850lab.30 for ; Thu, 17 Jul 2014 09:55:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1404032955-2591-1-git-send-email-marcel.a@redhat.com> References: <1404032955-2591-1-git-send-email-marcel.a@redhat.com> From: Peter Maydell Date: Thu, 17 Jul 2014 17:55:29 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: "Michael S. Tsirkin" , Anthony Liguori , QEMU Developers , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Michael Roth On 29 June 2014 10:09, Marcel Apfelbaum wrote: > Replaced '_' with '-' to comply with QOM guidelines. > Made the conversion from HMP to QMP in vl.c > > Signed-off-by: Marcel Apfelbaum > 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