From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7p2h-0000Rk-82 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 13:00:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7p2Z-0003tR-M0 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 13:00:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7p2Z-0003tL-Bz for qemu-devel@nongnu.org; Thu, 17 Jul 2014 13:00:19 -0400 Message-ID: <1405616392.2696.71.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Thu, 17 Jul 2014 19:59:52 +0300 In-Reply-To: References: <1404032955-2591-1-git-send-email-marcel.a@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Peter Maydell Cc: "Michael S. Tsirkin" , Anthony Liguori , QEMU Developers , Andreas =?ISO-8859-1?Q?F=E4rber?= , Michael Roth On Thu, 2014-07-17 at 17:55 +0100, Peter Maydell wrote: > 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. Thanks, I'll take care of that. Marcel > > > > > if (local_err) { > > qerror_report_err(local_err); > > -- > > 1.8.3.1 > > thanks > -- PMM