qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	dgilbert@redhat.com, "Richard Henderson" <rth@twiddle.net>,
	"Andreas Färber" <afaerber@suse.de>,
	qemu-arm@nongnu.org, xen-devel@lists.xenproject.org,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Amit Shah" <amit@kernel.org>,
	"Stefan Berger" <stefanb@linux.ibm.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-ppc@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Corey Minyard" <minyard@acm.org>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: Re: [Qemu-devel] [PATCH for-3.2 v3 07/14] qdev: all globals are now user-provided
Date: Fri, 23 Nov 2018 15:20:22 +0100	[thread overview]
Message-ID: <20181123152022.2a07375b@redhat.com> (raw)
In-Reply-To: <20181107123652.23417-8-marcandre.lureau@redhat.com>

On Wed,  7 Nov 2018 16:36:45 +0400
Marc-André Lureau <marcandre.lureau@redhat.com> wrote:

> Considering that CPU features are provided via command line, the
I can guess what it is about once I recall how -cpu foo,+-feat works,
but without that knowledge I don't get meaning behind the sentence.
Could you rephrase it?

> global_props are now all user-provided globals. No need to track this
> anymore for qdev_prop_check_globals().
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/hw/qdev-core.h         |  3 --
>  hw/core/qdev-properties.c      |  4 ---
>  tests/test-qdev-global-props.c | 57 ++++------------------------------
>  vl.c                           |  1 -
>  4 files changed, 6 insertions(+), 59 deletions(-)
> 
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index a24d0dd566..baaf097212 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -249,8 +249,6 @@ struct PropertyInfo {
>  
>  /**
>   * GlobalProperty:
> - * @user_provided: Set to true if property comes from user-provided config
> - * (command-line or config file).
>   * @used: Set to true if property was used when initializing a device.
>   * @errp: Error destination, used like first argument of error_setg()
>   *        in case property setting fails later. If @errp is NULL, we
> @@ -262,7 +260,6 @@ typedef struct GlobalProperty {
>      const char *driver;
>      const char *property;
>      const char *value;
> -    bool user_provided;
>      bool used;
>      Error **errp;
>  } GlobalProperty;
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index bd84c4ea4c..43c30a57f4 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -1192,9 +1192,6 @@ int qdev_prop_check_globals(void)
>          if (prop->used) {
>              continue;
>          }
> -        if (!prop->user_provided) {
> -            continue;
> -        }
>          oc = object_class_by_name(prop->driver);
>          oc = object_class_dynamic_cast(oc, TYPE_DEVICE);
>          if (!oc) {
> @@ -1233,7 +1230,6 @@ void qdev_prop_set_globals(DeviceState *dev)
>              if (!dev->hotplugged && prop->errp) {
>                  error_propagate(prop->errp, err);
>              } else {
> -                assert(prop->user_provided);
>                  warn_report_err(err);
>              }
>          }
> diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c
> index 3a8d3170a0..f49a1b70b5 100644
> --- a/tests/test-qdev-global-props.c
> +++ b/tests/test-qdev-global-props.c
> @@ -215,12 +215,12 @@ static void test_dynamic_globalprop_subprocess(void)
>  {
>      MyType *mt;
>      static GlobalProperty props[] = {
> -        { TYPE_DYNAMIC_PROPS, "prop1", "101", true },
> -        { TYPE_DYNAMIC_PROPS, "prop2", "102", true },
> -        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },
> -        { TYPE_UNUSED_HOTPLUG, "prop4", "104", true },
> -        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", true },
> -        { TYPE_NONDEVICE, "prop6", "106", true },
> +        { TYPE_DYNAMIC_PROPS, "prop1", "101", },
> +        { TYPE_DYNAMIC_PROPS, "prop2", "102", },
> +        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", },
> +        { TYPE_UNUSED_HOTPLUG, "prop4", "104", },
> +        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105", },
> +        { TYPE_NONDEVICE, "prop6", "106", },
>          {}
>      };
>      int global_error;
> @@ -255,46 +255,6 @@ static void test_dynamic_globalprop(void)
>      g_test_trap_assert_stdout("");
>  }
>  
> -/* Test setting of dynamic properties using user_provided=false properties */
> -static void test_dynamic_globalprop_nouser_subprocess(void)
> -{
> -    MyType *mt;
> -    static GlobalProperty props[] = {
> -        { TYPE_DYNAMIC_PROPS, "prop1", "101" },
> -        { TYPE_DYNAMIC_PROPS, "prop2", "102" },
> -        { TYPE_DYNAMIC_PROPS"-bad", "prop3", "103" },
> -        { TYPE_UNUSED_HOTPLUG, "prop4", "104" },
> -        { TYPE_UNUSED_NOHOTPLUG, "prop5", "105" },
> -        { TYPE_NONDEVICE, "prop6", "106" },
> -        {}
> -    };
> -    int global_error;
> -
> -    register_global_properties(props);
> -
> -    mt = DYNAMIC_TYPE(object_new(TYPE_DYNAMIC_PROPS));
> -    qdev_init_nofail(DEVICE(mt));
> -
> -    g_assert_cmpuint(mt->prop1, ==, 101);
> -    g_assert_cmpuint(mt->prop2, ==, 102);
> -    global_error = qdev_prop_check_globals();
> -    g_assert_cmpuint(global_error, ==, 0);
> -    g_assert(props[0].used);
> -    g_assert(props[1].used);
> -    g_assert(!props[2].used);
> -    g_assert(!props[3].used);
> -    g_assert(!props[4].used);
> -    g_assert(!props[5].used);
> -}
> -
> -static void test_dynamic_globalprop_nouser(void)
> -{
> -    g_test_trap_subprocess("/qdev/properties/dynamic/global/nouser/subprocess", 0, 0);
> -    g_test_trap_assert_passed();
> -    g_test_trap_assert_stderr("");
> -    g_test_trap_assert_stdout("");
> -}
> -
>  /* Test if global props affecting subclasses are applied in the right order */
>  static void test_subclass_global_props(void)
>  {
> @@ -344,11 +304,6 @@ int main(int argc, char **argv)
>      g_test_add_func("/qdev/properties/dynamic/global",
>                      test_dynamic_globalprop);
>  
> -    g_test_add_func("/qdev/properties/dynamic/global/nouser/subprocess",
> -                    test_dynamic_globalprop_nouser_subprocess);
> -    g_test_add_func("/qdev/properties/dynamic/global/nouser",
> -                    test_dynamic_globalprop_nouser);
> -
>      g_test_add_func("/qdev/properties/global/subclass",
>                      test_subclass_global_props);
>  
> diff --git a/vl.c b/vl.c
> index 2aea884c9d..d11b070e70 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2931,7 +2931,6 @@ static int global_init_func(void *opaque, QemuOpts *opts, Error **errp)
>      g->driver   = qemu_opt_get(opts, "driver");
>      g->property = qemu_opt_get(opts, "property");
>      g->value    = qemu_opt_get(opts, "value");
> -    g->user_provided = true;
>      g->errp = &error_fatal;
>      qdev_prop_register_global(g);
>      return 0;

  reply	other threads:[~2018-11-23 14:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 12:36 [Qemu-devel] [PATCH for-3.2 v3 00/14] Generalize machine compatibility properties Marc-André Lureau
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 01/14] tests: qdev_prop_check_globals() doesn't return "all_used" Marc-André Lureau
2018-11-20 15:33   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 02/14] qom: make interface types abstract Marc-André Lureau
2018-11-20 16:33   ` Igor Mammedov
2018-11-20 17:42     ` Eduardo Habkost
2018-11-20 18:54     ` Laszlo Ersek
2018-11-21  9:10       ` Igor Mammedov
2018-11-23 14:03   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 03/14] qom: make user_creatable_complete() specific to UserCreatable Marc-André Lureau
2018-11-20 16:39   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 04/14] accel: register global_props like machine globals Marc-André Lureau
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 05/14] qdev: move qdev_prop_register_global_list() to tests Marc-André Lureau
2018-11-11 23:46   ` Philippe Mathieu-Daudé
2018-11-20 16:40   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 06/14] qdev: do not mix compat props with global props Marc-André Lureau
2018-11-23 14:02   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 07/14] qdev: all globals are now user-provided Marc-André Lureau
2018-11-23 14:20   ` Igor Mammedov [this message]
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 08/14] qdev-props: convert global_props to GArray Marc-André Lureau
2018-11-23 14:26   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 09/14] qdev-props: remove errp from GlobalProperty Marc-André Lureau
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 10/14] qdev-props: call object_apply_global_props() Marc-André Lureau
2018-11-26 13:20   ` Igor Mammedov
2018-11-26 20:02     ` Marc-André Lureau
2018-11-27 14:12       ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 11/14] qom: teach interfaces to implement post-init Marc-André Lureau
2018-11-26 13:46   ` Igor Mammedov
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 12/14] machine: add compat-props interface Marc-André Lureau
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 13/14] hw/i386: add pc-i440fx-3.2 & pc-q35-3.2 Marc-André Lureau
2018-11-07 15:49   ` Marc-André Lureau
2018-11-07 19:01     ` Eduardo Habkost
2018-11-07 12:36 ` [Qemu-devel] [PATCH for-3.2 v3 14/14] hostmem: use object id for memory region name with >= 3.1 Marc-André Lureau
2018-11-26 13:55 ` [Qemu-devel] [PATCH for-3.2 v3 00/14] Generalize machine compatibility properties Igor Mammedov

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=20181123152022.2a07375b@redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=amit@kernel.org \
    --cc=anthony.perard@citrix.com \
    --cc=atar4qemu@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=minyard@acm.org \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sstabellini@kernel.org \
    --cc=stefanb@linux.ibm.com \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).