From: Eduardo Habkost <ehabkost@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
David Hildenbrand <david@redhat.com>,
"open list:sPAPR" <qemu-ppc@nongnu.org>,
Cornelia Huck <cohuck@redhat.com>,
qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@de.ibm.com>,
"open list:S390" <qemu-s390x@nongnu.org>,
"open list:Virt" <qemu-arm@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
imammedo@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH for-3.2 v5 08/19] hw: apply machine compat properties without touching globals
Date: Mon, 10 Dec 2018 15:31:18 -0200 [thread overview]
Message-ID: <20181210173118.GF4669@habkost.net> (raw)
In-Reply-To: <20181204142023.15982-9-marcandre.lureau@redhat.com>
On Tue, Dec 04, 2018 at 06:20:12PM +0400, Marc-André Lureau wrote:
> Similarly to accel properties, move compat properties out of globals
> registration, and apply the machine compat properties during
> device_post_init().
>
> As suggested during review, populating the arrays can be done directly
> without resorting to using macros.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/hw/boards.h | 3 +-
> hw/arm/virt.c | 48 ++-
> hw/core/machine.c | 19 +-
> hw/core/qdev.c | 2 +
> hw/i386/pc_piix.c | 588 +++++++++++++++++++++----------------
> hw/i386/pc_q35.c | 70 ++++-
> hw/ppc/spapr.c | 209 +++++++------
> hw/s390x/s390-virtio-ccw.c | 220 +++++++-------
> vl.c | 1 -
> 9 files changed, 673 insertions(+), 487 deletions(-)
>
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index f82f28468b..28c2b0af41 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -69,7 +69,6 @@ int machine_kvm_shadow_mem(MachineState *machine);
> int machine_phandle_start(MachineState *machine);
> bool machine_dump_guest_core(MachineState *machine);
> bool machine_mem_merge(MachineState *machine);
> -void machine_register_compat_props(MachineState *machine);
> HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine);
> void machine_set_cpu_numa_node(MachineState *machine,
> const CpuInstanceProperties *props,
> @@ -191,7 +190,7 @@ struct MachineClass {
> const char *default_machine_opts;
> const char *default_boot_order;
> const char *default_display;
> - GArray *compat_props;
> + GPtrArray *compat_props;
> const char *hw_version;
> ram_addr_t default_ram_size;
> const char *default_cpu_type;
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index f69e7eb399..530c8ca89d 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1872,8 +1872,9 @@ static void virt_machine_3_1_options(MachineClass *mc)
> }
> DEFINE_VIRT_MACHINE_AS_LATEST(3, 1)
>
> -#define VIRT_COMPAT_3_0 \
> +static GlobalProperty virt_compat_3_0[] = {
> HW_COMPAT_3_0
> +};
[...]
All the changes to compat macros are independent from the change
you describe in the patch subject, and makes review more
difficult. What about doing that in a separate patch?
We can replace all the virt.c, pc_piix.c, pc_q35.c, and spapr.c
hunks in this patch with the following:
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f82f28468b..622bbaf939 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -290,18 +289,10 @@ struct MachineState {
#define SET_MACHINE_COMPAT(m, COMPAT) \
do { \
- int i; \
static GlobalProperty props[] = { \
COMPAT \
- { /* end of list */ } \
}; \
- if (!m->compat_props) { \
- m->compat_props = g_array_new(false, false, sizeof(void *)); \
- } \
- for (i = 0; props[i].driver != NULL; i++) { \
- GlobalProperty *prop = &props[i]; \
- g_array_append_val(m->compat_props, prop); \
- } \
+ compat_props_add(m->compat_props, props, G_N_ELEMENTS(props)); \
} while (0)
#endif
--
Eduardo
WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Habkost <ehabkost@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Cornelia Huck <cohuck@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
David Hildenbrand <david@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
"open list:S390" <qemu-s390x@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
"open list:sPAPR" <qemu-ppc@nongnu.org>,
imammedo@redhat.com, David Gibson <david@gibson.dropbear.id.au>,
"open list:Virt" <qemu-arm@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH for-3.2 v5 08/19] hw: apply machine compat properties without touching globals
Date: Mon, 10 Dec 2018 15:31:18 -0200 [thread overview]
Message-ID: <20181210173118.GF4669@habkost.net> (raw)
In-Reply-To: <20181204142023.15982-9-marcandre.lureau@redhat.com>
On Tue, Dec 04, 2018 at 06:20:12PM +0400, Marc-André Lureau wrote:
> Similarly to accel properties, move compat properties out of globals
> registration, and apply the machine compat properties during
> device_post_init().
>
> As suggested during review, populating the arrays can be done directly
> without resorting to using macros.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/hw/boards.h | 3 +-
> hw/arm/virt.c | 48 ++-
> hw/core/machine.c | 19 +-
> hw/core/qdev.c | 2 +
> hw/i386/pc_piix.c | 588 +++++++++++++++++++++----------------
> hw/i386/pc_q35.c | 70 ++++-
> hw/ppc/spapr.c | 209 +++++++------
> hw/s390x/s390-virtio-ccw.c | 220 +++++++-------
> vl.c | 1 -
> 9 files changed, 673 insertions(+), 487 deletions(-)
>
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index f82f28468b..28c2b0af41 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -69,7 +69,6 @@ int machine_kvm_shadow_mem(MachineState *machine);
> int machine_phandle_start(MachineState *machine);
> bool machine_dump_guest_core(MachineState *machine);
> bool machine_mem_merge(MachineState *machine);
> -void machine_register_compat_props(MachineState *machine);
> HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine);
> void machine_set_cpu_numa_node(MachineState *machine,
> const CpuInstanceProperties *props,
> @@ -191,7 +190,7 @@ struct MachineClass {
> const char *default_machine_opts;
> const char *default_boot_order;
> const char *default_display;
> - GArray *compat_props;
> + GPtrArray *compat_props;
> const char *hw_version;
> ram_addr_t default_ram_size;
> const char *default_cpu_type;
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index f69e7eb399..530c8ca89d 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1872,8 +1872,9 @@ static void virt_machine_3_1_options(MachineClass *mc)
> }
> DEFINE_VIRT_MACHINE_AS_LATEST(3, 1)
>
> -#define VIRT_COMPAT_3_0 \
> +static GlobalProperty virt_compat_3_0[] = {
> HW_COMPAT_3_0
> +};
[...]
All the changes to compat macros are independent from the change
you describe in the patch subject, and makes review more
difficult. What about doing that in a separate patch?
We can replace all the virt.c, pc_piix.c, pc_q35.c, and spapr.c
hunks in this patch with the following:
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f82f28468b..622bbaf939 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -290,18 +289,10 @@ struct MachineState {
#define SET_MACHINE_COMPAT(m, COMPAT) \
do { \
- int i; \
static GlobalProperty props[] = { \
COMPAT \
- { /* end of list */ } \
}; \
- if (!m->compat_props) { \
- m->compat_props = g_array_new(false, false, sizeof(void *)); \
- } \
- for (i = 0; props[i].driver != NULL; i++) { \
- GlobalProperty *prop = &props[i]; \
- g_array_append_val(m->compat_props, prop); \
- } \
+ compat_props_add(m->compat_props, props, G_N_ELEMENTS(props)); \
} while (0)
#endif
--
Eduardo
next prev parent reply other threads:[~2018-12-10 17:31 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 14:20 [Qemu-devel] [PATCH for-3.2 v5 00/19] Generalize machine compatibility properties Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 01/19] tests: qdev_prop_check_globals() doesn't return "all_used" Marc-André Lureau
2018-12-04 14:20 ` [Qemu-arm] [PATCH for-3.2 v5 02/19] qom: make interface types abstract Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] " Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 03/19] qom: make user_creatable_complete() specific to UserCreatable Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 04/19] accel: register global_props like machine globals Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 05/19] qdev: move qdev_prop_register_global_list() to tests Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 06/19] qom: remove unimplemented class_finalize Marc-André Lureau
2018-12-04 14:20 ` [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] " Marc-André Lureau
2018-12-10 16:45 ` Igor Mammedov
2018-12-10 16:45 ` [Qemu-devel] " Igor Mammedov
2018-12-10 16:54 ` Igor Mammedov
2018-12-10 16:54 ` Igor Mammedov
2018-12-12 12:00 ` Marc-André Lureau
2018-12-12 12:00 ` Marc-André Lureau
2018-12-13 12:06 ` Igor Mammedov
2018-12-13 12:06 ` Igor Mammedov
2018-12-11 13:14 ` Igor Mammedov
2018-12-11 13:14 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-arm] [PATCH for-3.2 v5 08/19] hw: apply machine " Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] " Marc-André Lureau
2018-12-10 17:31 ` Eduardo Habkost [this message]
2018-12-10 17:31 ` Eduardo Habkost
2018-12-11 12:07 ` Marc-André Lureau
2018-12-11 12:07 ` Marc-André Lureau
2018-12-11 14:02 ` [Qemu-arm] " Eduardo Habkost
2018-12-11 14:02 ` Eduardo Habkost
2018-12-11 14:23 ` [Qemu-arm] " Eduardo Habkost
2018-12-11 14:23 ` Eduardo Habkost
2018-12-11 14:30 ` Marc-André Lureau
2018-12-11 14:30 ` Marc-André Lureau
2018-12-11 15:52 ` [Qemu-arm] " Igor Mammedov
2018-12-11 15:52 ` Igor Mammedov
2018-12-11 17:43 ` [Qemu-arm] " Eduardo Habkost
2018-12-11 17:43 ` Eduardo Habkost
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 09/19] hw: remove SET_MACHINE_COMPAT Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 10/19] qdev: make a separate helper function to apply compat properties Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 11/19] qdev: all globals are now user-provided Marc-André Lureau
2018-12-10 17:00 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 12/19] qdev-props: convert global_props to GPtrArray Marc-André Lureau
2018-12-10 17:05 ` Igor Mammedov
2018-12-11 12:12 ` Marc-André Lureau
2018-12-11 13:03 ` Igor Mammedov
2018-12-11 13:04 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 13/19] qdev-props: remove errp from GlobalProperty Marc-André Lureau
2018-12-10 17:20 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 14/19] qdev-props: call object_apply_global_props() Marc-André Lureau
2018-12-10 17:28 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 15/19] qom: add object_class_get_class_data() Marc-André Lureau
2018-12-11 16:02 ` Igor Mammedov
2018-12-12 18:48 ` Marc-André Lureau
2018-12-04 14:20 ` [Qemu-arm] [PATCH for-3.2 v5 16/19] RFC: arm: replace instance_post_init() Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] " Marc-André Lureau
2018-12-11 13:43 ` [Qemu-arm] " Igor Mammedov
2018-12-11 13:43 ` Igor Mammedov
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 17/19] hw/i386: add pc-i440fx-4.0 & pc-q35-4.0 Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 18/19] hw/arm/virt: add virt-4.0 machine type Marc-André Lureau
2018-12-04 14:20 ` Marc-André Lureau
2018-12-04 14:20 ` [Qemu-devel] [PATCH for-3.2 v5 19/19] hostmem: use object id for memory region name with >= 4.0 Marc-André Lureau
2018-12-04 14:22 ` [Qemu-devel] [PATCH for-3.2 v5 00/19] Generalize machine compatibility properties Marc-André Lureau
2018-12-10 17:07 ` Eduardo Habkost
2018-12-10 17:31 ` Igor Mammedov
2018-12-10 17:39 ` Eduardo Habkost
2018-12-11 15:11 ` 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=20181210173118.GF4669@habkost.net \
--to=ehabkost@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcandre.lureau@redhat.com \
--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=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
/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.