From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Apfelbaum <marcel.a@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, aliguori@amazon.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH] machine: replace underscores in machine's property names
Date: Sun, 29 Jun 2014 14:37:01 +0300 [thread overview]
Message-ID: <20140629113701.GA26161@redhat.com> (raw)
In-Reply-To: <1404032955-2591-1-git-send-email-marcel.a@redhat.com>
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 <marcel.a@redhat.com>
Nothing to do with me, pls merge through Andrea's or Paolo's tree.
FWIW
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 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
next prev parent reply other threads:[~2014-06-29 11:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-29 9:09 [Qemu-devel] [PATCH] machine: replace underscores in machine's property names Marcel Apfelbaum
2014-06-29 11:37 ` Michael S. Tsirkin [this message]
2014-07-17 14:15 ` Marcel Apfelbaum
2014-07-17 14:20 ` Paolo Bonzini
2014-07-17 15:48 ` Andreas Färber
2014-07-17 16:47 ` Michael Roth
2014-07-17 17:00 ` Paolo Bonzini
2014-07-18 14:15 ` Andreas Färber
2014-07-18 14:19 ` Paolo Bonzini
2014-07-18 16:06 ` Marcel Apfelbaum
2014-07-17 16:55 ` Peter Maydell
2014-07-17 16:59 ` Marcel Apfelbaum
2014-07-18 14:25 ` Andreas Färber
2014-07-18 14:38 ` Paolo Bonzini
2014-07-18 15:59 ` Marcel Apfelbaum
2014-07-18 16:10 ` Andreas Färber
2014-07-18 16:23 ` Marcel Apfelbaum
2014-07-18 16:32 ` Andreas Färber
2014-07-18 16:35 ` Marcel Apfelbaum
2014-07-18 20:11 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140629113701.GA26161@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@amazon.com \
--cc=marcel.a@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.