From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7mTD-0002oi-V9 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 10:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7mT6-0002Jp-2b for qemu-devel@nongnu.org; Thu, 17 Jul 2014 10:15:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7mT5-0002Je-Kg for qemu-devel@nongnu.org; Thu, 17 Jul 2014 10:15:31 -0400 Message-ID: <1405606506.2696.60.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Thu, 17 Jul 2014 17:15:06 +0300 In-Reply-To: <20140629113701.GA26161@redhat.com> References: <1404032955-2591-1-git-send-email-marcel.a@redhat.com> <20140629113701.GA26161@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: pbonzini@redhat.com, Andreas =?ISO-8859-1?Q?F=E4rber?= Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, aliguori@amazon.com, "Michael S. Tsirkin" On Sun, 2014-06-29 at 14:37 +0300, Michael S. Tsirkin wrote: > On Sun, Jun 29, 2014 at 12:09:15PM +0300, 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 > > Nothing to do with me, pls merge through Andrea's or Paolo's tree. > FWIW Ping. I thought we want this in 2.1 Thanks, Marcel > > Acked-by: Michael S. Tsirkin > > > > --- > > hw/core/machine.c | 8 ++++---- > > vl.c | 12 +++++++++++- > > 2 files changed, 15 insertions(+), 5 deletions(-) > > > > diff --git a/hw/core/machine.c b/hw/core/machine.c > > index cbba679..7a66c57 100644 > > --- a/hw/core/machine.c > > +++ b/hw/core/machine.c > > @@ -239,11 +239,11 @@ static void machine_initfn(Object *obj) > > { > > object_property_add_str(obj, "accel", > > machine_get_accel, machine_set_accel, NULL); > > - object_property_add_bool(obj, "kernel_irqchip", > > + object_property_add_bool(obj, "kernel-irqchip", > > machine_get_kernel_irqchip, > > machine_set_kernel_irqchip, > > NULL); > > - object_property_add(obj, "kvm_shadow_mem", "int", > > + object_property_add(obj, "kvm-shadow-mem", "int", > > machine_get_kvm_shadow_mem, > > machine_set_kvm_shadow_mem, > > NULL, NULL, NULL); > > @@ -257,11 +257,11 @@ static void machine_initfn(Object *obj) > > machine_get_dtb, machine_set_dtb, NULL); > > object_property_add_str(obj, "dumpdtb", > > machine_get_dumpdtb, machine_set_dumpdtb, NULL); > > - object_property_add(obj, "phandle_start", "int", > > + object_property_add(obj, "phandle-start", "int", > > machine_get_phandle_start, > > machine_set_phandle_start, > > NULL, NULL, NULL); > > - object_property_add_str(obj, "dt_compatible", > > + object_property_add_str(obj, "dt-compatible", > > machine_get_dt_compatible, > > machine_set_dt_compatible, > > NULL); > > diff --git a/vl.c b/vl.c > > 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); > > + 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); > > > > if (local_err) { > > qerror_report_err(local_err); > > -- > > 1.8.3.1 >