From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0DQg-0001AY-5S for qemu-devel@nongnu.org; Wed, 22 Feb 2012 09:44:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0DQc-0004Xw-60 for qemu-devel@nongnu.org; Wed, 22 Feb 2012 09:44:26 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:51460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0DQb-0004Xf-Tl for qemu-devel@nongnu.org; Wed, 22 Feb 2012 09:44:22 -0500 Received: by dadp14 with SMTP id p14so115115dad.4 for ; Wed, 22 Feb 2012 06:44:20 -0800 (PST) Message-ID: <4F44FF40.7040904@codemonkey.ws> Date: Wed, 22 Feb 2012 08:44:16 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1329844391-25016-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1329844391-25016-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL v2 0/9] qdev deconstruction, command-line episode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 02/21/2012 11:13 AM, Paolo Bonzini wrote: > Anthony, > > I'm sending a pull request since you informally said on IRC that you're > okay with the patches. > > The following changes since commit 99c7f87826337fa81f2f0f9baa9ca0a44faf90e9: > > input: send kbd+mouse events only to running guests. (2012-02-17 11:02:55 -0600) Pulled. Thanks. Regards, Anthony Liguori > > are available in the git repository at: > git://github.com/bonzini/qemu.git qdev-props-for-anthony > > v1->v2: > Fix bug in parsing booleans and strengthen test suite. > The interdiff is attached. > > Paolo Bonzini (9): > qapi: allow sharing enum implementation across visitors > qapi: drop qmp_input_end_optional > qapi: add string-based visitors > qapi: add tests for string-based visitors > qom: add generic string parsing/printing > qdev: accept both strings and integers for PCI addresses > qdev: accept hex properties only if prefixed by 0x > qdev: use built-in QOM string parser > qdev: drop unnecessary parse/print methods > > .gitignore | 2 + > Makefile.objs | 5 +- > hw/qdev-properties.c | 186 +++++++++------------------------------- > include/qemu/object.h | 24 +++++ > qapi/qapi-visit-core.c | 51 +++++++++++ > qapi/qapi-visit-impl.h | 23 +++++ > qapi/qmp-input-visitor.c | 39 +-------- > qapi/qmp-output-visitor.c | 22 +----- > qapi/string-input-visitor.c | 138 +++++++++++++++++++++++++++++ > qapi/string-input-visitor.h | 25 ++++++ > qapi/string-output-visitor.c | 89 +++++++++++++++++++ > qapi/string-output-visitor.h | 26 ++++++ > qom/object.c | 24 +++++ > test-string-input-visitor.c | 195 ++++++++++++++++++++++++++++++++++++++++++ > test-string-output-visitor.c | 188 ++++++++++++++++++++++++++++++++++++++++ > tests/Makefile | 12 ++- > 16 files changed, 841 insertions(+), 208 deletions(-) > create mode 100644 qapi/qapi-visit-impl.h > create mode 100644 qapi/string-input-visitor.c > create mode 100644 qapi/string-input-visitor.h > create mode 100644 qapi/string-output-visitor.c > create mode 100644 qapi/string-output-visitor.h > create mode 100644 test-string-input-visitor.c > create mode 100644 test-string-output-visitor.c > > diff --git a/include/qemu/object.h b/include/qemu/object.h > index 2081ca0..ff6be14 100644 > --- a/include/qemu/object.h > +++ b/include/qemu/object.h > @@ -742,7 +742,7 @@ void object_property_parse(Object *obj, const char *string, > const char *name, struct Error **errp); > > /** > - * object_property_set: > + * object_property_print: > * @obj: the object > * @name: the name of the property > * @errp: returns an error if this function fails > diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c > index ceee699..497eb9a 100644 > --- a/qapi/string-input-visitor.c > +++ b/qapi/string-input-visitor.c > @@ -47,13 +47,15 @@ static void parse_type_bool(Visitor *v, bool *obj, const char *name, > StringInputVisitor *siv = DO_UPCAST(StringInputVisitor, visitor, v); > > if (siv->string) { > - if (strcasecmp(siv->string, "on") || strcasecmp(siv->string, "yes") || > - strcasecmp(siv->string, "true")) { > + if (!strcasecmp(siv->string, "on") || > + !strcasecmp(siv->string, "yes") || > + !strcasecmp(siv->string, "true")) { > *obj = true; > return; > } > - if (strcasecmp(siv->string, "off") || strcasecmp(siv->string, "no") || > - strcasecmp(siv->string, "false")) { > + if (!strcasecmp(siv->string, "off") || > + !strcasecmp(siv->string, "no") || > + !strcasecmp(siv->string, "false")) { > *obj = false; > return; > } > diff --git a/test-string-input-visitor.c b/test-string-input-visitor.c > index ba2cc40..5370e32 100644 > --- a/test-string-input-visitor.c > +++ b/test-string-input-visitor.c > @@ -75,6 +75,41 @@ static void test_visitor_in_bool(TestInputVisitorData *data, > visit_type_bool(v,&res, NULL,&errp); > g_assert(!error_is_set(&errp)); > g_assert_cmpint(res, ==, true); > + visitor_input_teardown(data, unused); > + > + v = visitor_input_test_init(data, "yes"); > + > + visit_type_bool(v,&res, NULL,&errp); > + g_assert(!error_is_set(&errp)); > + g_assert_cmpint(res, ==, true); > + visitor_input_teardown(data, unused); > + > + v = visitor_input_test_init(data, "on"); > + > + visit_type_bool(v,&res, NULL,&errp); > + g_assert(!error_is_set(&errp)); > + g_assert_cmpint(res, ==, true); > + visitor_input_teardown(data, unused); > + > + v = visitor_input_test_init(data, "false"); > + > + visit_type_bool(v,&res, NULL,&errp); > + g_assert(!error_is_set(&errp)); > + g_assert_cmpint(res, ==, false); > + visitor_input_teardown(data, unused); > + > + v = visitor_input_test_init(data, "no"); > + > + visit_type_bool(v,&res, NULL,&errp); > + g_assert(!error_is_set(&errp)); > + g_assert_cmpint(res, ==, false); > + visitor_input_teardown(data, unused); > + > + v = visitor_input_test_init(data, "off"); > + > + visit_type_bool(v,&res, NULL,&errp); > + g_assert(!error_is_set(&errp)); > + g_assert_cmpint(res, ==, false); > } > > static void test_visitor_in_number(TestInputVisitorData *data,