Machine props patches
The following changes since commit e59dbbac0364344a3ad84c3497a98c56003d3fb8:
Merge remote-tracking branch 'remotes/philmd/tags/fw_cfg-20190104-pull-request' into staging (2019-01-04 18:23:13 +0000)
are available in the Git repository at:
https://github.com/elmarco/qemu.git tags/machine-props-pull-request
for you to fetch changes up to fa0cb34d2210cc749b9a70db99bb41c56ad20831:
hostmem: use object id for memory region name with >= 4.0 (2019-01-07 16:18:42 +0400)
----------------------------------------------------------------
Generalize machine compatibility properties
During "[PATCH v2 05/10] qom/globals: generalize object_property_set_globals()" review, Eduardo suggested to rework the GlobalProperty handling, so that -global is limited to QDev only and we avoid mixing the machine compats and the user-provided -global properties (instead of generalizing -global to various object kinds, like I proposed in v2).
"qdev: do not mix compat props with global props" patch decouples a bit user-provided -global from machine compat properties. This allows to get rid of "user_provided" and "errp" fields in following patches.
A new compat property "x-use-canonical-path-for-ramblock-id" is added to hostmem for legacy canonical path names, set to true for -file and -memfd with qemu < 4.0.
(this series was initially titled "[PATCH v2 00/10] hostmem: use object "id" for memory region name with >= 3.1", but its focus is more in refactoring the global and compatilibity properties handling now)
----------------------------------------------------------------
Marc-André Lureau (28):
hw: apply accel compat properties without touching globals
machines: replace COMPAT define with a static array
hw: apply machine compat properties without touching globals
machine: move compat properties out of globals
hw: remove SET_MACHINE_COMPAT
compat: replace PC_COMPAT_3_1 & HW_COMPAT_3_1 macros
compat: replace PC_COMPAT_3_0 & HW_COMPAT_3_0 macros
compat: replace PC_COMPAT_2_12 & HW_COMPAT_2_12 macros
compat: replace PC_COMPAT_2_11 & HW_COMPAT_2_11 macros
compat: replace PC_COMPAT_2_10 & HW_COMPAT_2_10 macros
compat: replace PC_COMPAT_2_9 & HW_COMPAT_2_9 macros
compat: replace PC_COMPAT_2_8 & HW_COMPAT_2_8 macros
compat: replace PC_COMPAT_2_7 & HW_COMPAT_2_7 macros
compat: replace PC_COMPAT_2_6 & HW_COMPAT_2_6 macros
compat: replace PC_COMPAT_2_5 & HW_COMPAT_2_5 macros
compat: replace PC_COMPAT_2_4 & HW_COMPAT_2_4 macros
compat: replace PC_COMPAT_2_3 & HW_COMPAT_2_3 macros
compat: replace PC_COMPAT_2_2 & HW_COMPAT_2_2 macros
compat: replace PC_COMPAT_2_1 & HW_COMPAT_2_1 macros
include: remove compat.h
compat: remove remaining PC_COMPAT macros
qdev: make a separate helper function to apply compat properties
qdev: all globals are now user-provided
qdev-props: convert global_props to GPtrArray
qdev-props: remove errp from GlobalProperty
qdev-props: call object_apply_global_props()
arm: replace instance_post_init()
hostmem: use object id for memory region name with >= 4.0
include/hw/boards.h | 59 ++- include/hw/compat.h | 299 -------------- include/hw/i386/pc.h | 689 +++------------------------------ include/hw/qdev-core.h | 23 +- include/qom/object.h | 3 + include/sysemu/accel.h | 4 +- include/sysemu/hostmem.h | 3 +- target/arm/cpu-qom.h | 3 + target/arm/cpu.h | 2 + accel/accel.c | 12 - backends/hostmem-file.c | 8 +- backends/hostmem-memfd.c | 2 +- backends/hostmem-ram.c | 9 +- backends/hostmem.c | 36 ++ hw/arm/virt.c | 46 +-- hw/core/machine.c | 347 ++++++++++++++++- hw/core/qdev-properties.c | 49 +-- hw/core/qdev.c | 15 + hw/i386/pc.c | 674 ++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 508 ++++++++++++------------ hw/i386/pc_q35.c | 36 +- hw/ppc/spapr.c | 207 +++++----- hw/s390x/s390-virtio-ccw.c | 196 +++++----- hw/xen/xen-common.c | 41 +- qom/cpu.c | 1 - qom/object.c | 35 ++ target/arm/cpu.c | 30 +- target/arm/cpu64.c | 24 +- target/i386/cpu.c | 1 - target/sparc/cpu.c | 1 - tests/test-qdev-global-props.c | 57 +-- vl.c | 4 - 32 files changed, 1786 insertions(+), 1638 deletions(-) delete mode 100644 include/hw/compat.h
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 01/28] hw: apply accel compat properties without touching globals
Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals.
Introduce object_apply_global_props() function, to apply compatibility properties from a GPtrArray.
--- include/hw/qdev-core.h | 10 ++++++++++ include/qom/object.h | 3 +++ include/sysemu/accel.h | 4 +--- accel/accel.c | 12 ------------ hw/core/qdev.c | 9 +++++++++ hw/xen/xen-common.c | 9 ++++++--- qom/object.c | 25 +++++++++++++++++++++++++ vl.c | 1 - 8 files changed, 54 insertions(+), 19 deletions(-)
include/hw/qdev-core.h +10 -0
@@ -267,6 +267,16 @@ typedef struct GlobalProperty {Error **errp; } GlobalProperty; +static inline void +compat_props_add (GPtrArray *arr, +GlobalProperty props[],size_t nelem) +{ +int i; +for (i =0 ; i < nelem; i++) { +g_ptr_array_add (arr, (void *)&props[i]); + } +} +/*** Board API. This should go away once we have a machine config file. ***/ DeviceState *qdev_create (BusState *bus,const char *name);
include/qom/object.h +3 -0
@@ -675,6 +675,9 @@ Object *object_new_with_propv(const char *typename,Error **errp, va_list vargs); +void object_apply_global_props (Object *obj,const GPtrArray *props, +Error **errp); +/** * object_set_props: * @obj: the object instance to set properties on
include/sysemu/accel.h +1 -3
@@ -49,7 +49,7 @@ typedef struct AccelClass {* global properties may be overridden by machine-type * compat_props or user-provided global properties. */ -GlobalProperty *global_props; +GPtrArray *compat_props; } AccelClass;#define TYPE_ACCEL "accel"
@@ -67,8 +67,6 @@ typedef struct AccelClass {extern unsigned long tcg_tb_size;void configure_accelerator (MachineState *ms); -/* Register accelerator specific global properties */ -void accel_register_compat_props (AccelState *accel);/* Called just before os_setup_post (ie just before drop OS privs) */ void accel_setup_post (MachineState *ms);
accel/accel.c +0 -12
@@ -119,18 +119,6 @@ void configure_accelerator(MachineState *ms) } } -void accel_register_compat_props (AccelState *accel) -{ -AccelClass *class =ACCEL_GET_CLASS (accel); -GlobalProperty *prop = class->global_props; - -for (; prop && prop->driver; prop++) { -/* Any compat_props must never cause error */ - prop->errp = &error_abort; -qdev_prop_register_global (prop); - } -} -void accel_setup_post (MachineState *ms) {AccelState *accel = ms->accelerator;
hw/core/qdev.c +9 -0
@@ -972,6 +972,15 @@ static void device_initfn(Object *obj)static void device_post_init (Object *obj) { +if (object_dynamic_cast (qdev_get_machine (),TYPE_MACHINE )) { +MachineState *m =MACHINE (qdev_get_machine ()); +AccelClass *ac =ACCEL_GET_CLASS (m->accelerator); + +if (ac->compat_props) { +object_apply_global_props (obj, ac->compat_props, &error_abort); + } + } +qdev_prop_set_globals (DEVICE (obj)); }
hw/xen/xen-common.c +6 -3
@@ -174,18 +174,21 @@ static GlobalProperty xen_compat_props[] = { .driver = "migration", .property = "send-section-footer", .value = "off", - }, - { /* end of list */ }, + } };static void xen_accel_class_init (ObjectClass *oc,void *data) {AccelClass *ac =ACCEL_CLASS (oc); + ac->name ="Xen" ; ac->init_machine = xen_init; ac->setup_post = xen_setup_post; ac->allowed = &xen_allowed; - ac->global_props = xen_compat_props; + ac->compat_props =g_ptr_array_new (); + +compat_props_add (ac->compat_props, + xen_compat_props,G_N_ELEMENTS (xen_compat_props)); }#define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen")
qom/object.c +25 -0
@@ -370,6 +370,31 @@ static void object_post_init_with_type(Object *obj, TypeImpl *ti) } } +void object_apply_global_props (Object *obj,const GPtrArray *props,Error **errp) +{ +Error *err =NULL ; +int i; + +if (!props) { +return ; + } + +for (i =0 ; i < props->len; i++) { +GlobalProperty *p =g_ptr_array_index (props, i); + +if (object_dynamic_cast (obj, p->driver) ==NULL ) { +continue ; + } + p->used = true; +object_property_parse (obj, p->value, p->property, &err); +if (err !=NULL ) { +error_prepend (&err,"can't apply global %s.%s=%s: " , + p->driver, p->property, p->value); +error_propagate (errp, err); + } + } +} +static void object_initialize_with_type (void *data,size_t size,TypeImpl *type) {Object *obj = data;
vl.c +0 -1
@@ -2996,7 +2996,6 @@ static void user_register_global_props(void)*/ static void register_global_properties (MachineState *ms) { -accel_register_compat_props (ms->accelerator);machine_register_compat_props (ms);user_register_global_props (); }
Signature · 1 line
2.20.1.2.gb21ebb671b
Re: [Qemu-devel] [PULL v2 01/28] hw: apply accel compat properties without touching globals
Quoted 16 lines · Marc-André Lureau
Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals.
Introduce
object_apply_global_props()function, to apply compatibility properties from a GPtrArray.hw/core/qdev.c +1
-0@@ -972,6 +972,15 @@ static void device_initfn(Object *obj)static void device_post_init (Object *obj) { +if (object_dynamic_cast (qdev_get_machine (),TYPE_MACHINE )) {
hw/core/qdev.c static void device_initfn(Object *obj) · line 985
Quoted 10 lines
hw/core/qdev.c +8
-0+MachineState *m =MACHINE (qdev_get_machine ()); +AccelClass *ac =ACCEL_GET_CLASS (m->accelerator); + +if (ac->compat_props) { +object_apply_global_props (obj, ac->compat_props, &error_abort); + } + } +qdev_prop_set_globals (DEVICE (obj)); }
Hi; I've just noticed that this commit seems to break "-device whatever,help" :
$ gdb --args ./build/x86/arm-softmmu/qemu-system-arm -device iotkit,help -M virt GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 [...] (gdb) r Starting program: /home/petmay01/linaro/qemu-from-laptop/qemu/build/x86/arm-softmmu/qemu-system-arm -device iotkit,help -M virt [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffce6c1700 (LWP 23277)]
Thread 1 "qemu-system-arm" received signal SIGSEGV, Segmentation fault. 0x0000555555d985d1 in object_get_class (obj=0x0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:857
857 return obj->class;
(gdb) bt
#0 0x0000555555d985d1 in object_get_class (obj=0x0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:857
#1 0x0000555555b5675d in object_apply_compat_props (obj=0x555556b42600)
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/qdev.c:978
#2 0x0000555555b567f0 in device_post_init (obj=0x555556b42600)
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/qdev.c:989
#3 0x0000555555d97294 in object_post_init_with_type
(obj=0x555556b42600, ti=0x5555569f7840)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:365
#4 0x0000555555d972c2 in object_post_init_with_type
(obj=0x555556b42600, ti=0x5555569f8640)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:369
#5 0x0000555555d972c2 in object_post_init_with_type
(obj=0x555556b42600, ti=0x555556a12c60)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:369#6 0x0000555555d97572 in object_initialize_with_type (data=0x555556b42600, size=1056, type=0x555556a12c60) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:425 #7 0x0000555555d975b0 in object_initialize (data=0x555556b42600, size=1056, typename=0x555555ff3ee1 "armv7m_systick") at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432 #8 0x0000555555d976fd in object_initialize_childv (parentobj=0x555556b40fa0, propname=0x555555ff3f36 "systick-reg-ns", childobj=0x555556b42600, size=1056, type=0x555555ff3ee1 "armv7m_systick", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffd7c0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455
#9 0x0000555555d97689 in object_initialize_child (parentobj=0x555556b40fa0, propname=0x555555ff3f36 "systick-reg-ns", childobj=0x555556b42600, size=1056, type=0x555555ff3ee1 "armv7m_systick", errp=0x5555569775f8 <error_abort>) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442 #10 0x0000555555b5d049 in sysbus_init_child_obj (parent=0x555556b40fa0, childname=0x555555ff3f36 "systick-reg-ns", child=0x555556b42600, childsize=1056, childtype=0x555555ff3ee1 "armv7m_systick")
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376
#11 0x00005555559231b0 in armv7m_nvic_instance_init (obj=0x555556b40fa0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/intc/armv7m_nvic.c:2393
#12 0x0000555555d97263 in object_init_with_type (obj=0x555556b40fa0,
ti=0x5555569cbce0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#13 0x0000555555d9755f in object_initialize_with_type (data=0x555556b40fa0, size=7840, type=0x5555569cbce0) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424 #14 0x0000555555d975b0 in object_initialize (data=0x555556b40fa0, size=7840, typename=0x555556019af8 "armv7m_nvic") at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432 #15 0x0000555555d976fd in object_initialize_childv (parentobj=0x555556b40c90, propname=0x555556019b04 "nvnic", childobj=0x555556b40fa0, size=7840, type=0x555556019af8 "armv7m_nvic", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffda90)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455
#16 0x0000555555d97689 in object_initialize_child (parentobj=0x555556b40c90, propname=0x555556019b04 "nvnic", childobj=0x555556b40fa0, size=7840, type=0x555556019af8 "armv7m_nvic", errp=0x5555569775f8 <error_abort>) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442 #17 0x0000555555b5d049 in sysbus_init_child_obj (parent=0x555556b40c90, childname=0x555556019b04 "nvnic", child=0x555556b40fa0, childsize=7840, childtype=0x555556019af8 "armv7m_nvic")
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376
#18 0x00005555559c63ba in armv7m_instance_init (obj=0x555556b40c90)
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/armv7m.c:137
#19 0x0000555555d97263 in object_init_with_type (obj=0x555556b40c90,
ti=0x5555569db4c0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#20 0x0000555555d9755f in object_initialize_with_type (data=0x555556b40c90, size=11152, type=0x5555569db4c0) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424 #21 0x0000555555d975b0 in object_initialize (data=0x555556b40c90, size=11152, typename=0x555556022fd1 "armv7m") at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432 #22 0x0000555555d976fd in object_initialize_childv (parentobj=0x555556b40980, propname=0x555556022fd1 "armv7m", childobj=0x555556b40c90, size=11152, type=0x555556022fd1 "armv7m", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffdd50)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455
#23 0x0000555555d97689 in object_initialize_child (parentobj=0x555556b40980, propname=0x555556022fd1 "armv7m", childobj=0x555556b40c90, size=11152, type=0x555556022fd1 "armv7m", errp=0x5555569775f8 <error_abort>) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442 #24 0x0000555555b5d049 in sysbus_init_child_obj (parent=0x555556b40980, childname=0x555556022fd1 "armv7m", child=0x555556b40c90, childsize=11152, childtype=0x555556022fd1 "armv7m")
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376
#25 0x00005555559f3fdc in iotkit_init (obj=0x555556b40980)
at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/iotkit.c:115
#26 0x0000555555d97263 in object_init_with_type (obj=0x555556b40980,
ti=0x5555569df840)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#27 0x0000555555d9755f in object_initialize_with_type (data=0x555556b40980, size=50080, type=0x5555569df840) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424 #28 0x0000555555d97bb9 in object_new_with_type (type=0x5555569df840)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:588
#29 0x0000555555d97bf6 in object_new (typename=0x555556a2b230 "iotkit")
at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:598#30 0x0000555555aafe8c in qmp_device_list_properties (typename=0x555556a2b230 "iotkit", errp=0x7fffffffe050) at /home/petmay01/linaro/qemu-from-laptop/qemu/qmp.c:519
#31 0x0000555555a8607a in qdev_device_help (opts=0x555556a2b1c0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/qdev-monitor.c:283
#32 0x0000555555a8f77e in device_help_func (opaque=0x0, opts=0x555556a2b1c0, errp=0x0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/vl.c:2299
#33 0x0000555555ef5b21 in qemu_opts_foreach (list=0x555556787040
<qemu_device_opts>, func=0x555555a8f75e <device_help_func>,
opaque=0x0, errp=0x0)
at /home/petmay01/linaro/qemu-from-laptop/qemu/util/qemu-option.c:1171
#34 0x0000555555a94310 in main (argc=5, argv=0x7fffffffe408,
envp=0x7fffffffe438)
at /home/petmay01/linaro/qemu-from-laptop/qemu/vl.c:4323Looking at the backtrace, this seems to happen because in device_post_init we look at m->accelerator, but m->accelerator is only set when vl.c calls configure_accelerator(), so if this function gets called before then, it will cause an assert. In particular, the handling of -device foo,help happens before the accelerator is configured. (Possibly other things may cause device init before then too?)
thanks
-- PMM
Re: [Qemu-devel] [PULL v2 01/28] hw: apply accel compat properties without touching globals
Hi Peter
Quoted 25 lines · Peter Maydell
Quoted 22 lines · Marc-André Lureau
Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals.
Introduce
object_apply_global_props()function, to apply compatibility properties from a GPtrArray.hw/core/qdev.c +7
-0@@ -972,6 +972,15 @@ static void device_initfn(Object *obj)static void device_post_init (Object *obj) { +if (object_dynamic_cast (qdev_get_machine (),TYPE_MACHINE )) { +MachineState *m =MACHINE (qdev_get_machine ()); +AccelClass *ac =ACCEL_GET_CLASS (m->accelerator); + +if (ac->compat_props) { +object_apply_global_props (obj, ac->compat_props, &error_abort); + }
Quoted 8 lines
hw/core/qdev.c static void device_initfn(Object *obj) · line 985
Quoted 4 lines
hw/core/qdev.c +2
-0+ } +qdev_prop_set_globals (DEVICE (obj)); }Hi; I've just noticed that this commit seems to break "-device whatever,help" :
[Qemu-devel] [PATCH] qdev: fix -device scsi-hd,help regression
This should now be queued, afaik.
Quoted 144 lines
$ gdb --args ./build/x86/arm-softmmu/qemu-system-arm -device iotkit,help -M virt GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 [...] (gdb) r Starting program: /home/petmay01/linaro/qemu-from-laptop/qemu/build/x86/arm-softmmu/qemu-system-arm -device iotkit,help -M virt [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffce6c1700 (LWP 23277)]Thread 1 "qemu-system-arm" received signal SIGSEGV, Segmentation fault.
0x0000555555d985d1inobject_get_class(obj=0x0)at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:857 857 return obj->class; (gdb) bt #0 0x0000555555d985d1 in object_get_class (obj=0x0) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:857 #1 0x0000555555b5675d in object_apply_compat_props (obj=0x555556b42600) at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/qdev.c:978 #2 0x0000555555b567f0 in device_post_init (obj=0x555556b42600) at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/qdev.c:989 #3 0x0000555555d97294 in object_post_init_with_type (obj=0x555556b42600, ti=0x5555569f7840) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:365 #4 0x0000555555d972c2 in object_post_init_with_type (obj=0x555556b42600, ti=0x5555569f8640) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:369 #5 0x0000555555d972c2 in object_post_init_with_type (obj=0x555556b42600, ti=0x555556a12c60) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:369#6
0x0000555555d97572inobject_initialize_with_type(data=0x555556b42600, size=1056, type=0x555556a12c60) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:425#70x0000555555d975b0inobject_initialize(data=0x555556b42600, size=1056, typename=0x555555ff3ee1 "armv7m_systick") at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432#80x0000555555d976fdinobject_initialize_childv(parentobj=0x555556b40fa0, propname=0x555555ff3f36 "systick-reg-ns", childobj=0x555556b42600, size=1056, type=0x555555ff3ee1 "armv7m_systick", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffd7c0)at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455#9
0x0000555555d97689inobject_initialize_child(parentobj=0x555556b40fa0, propname=0x555555ff3f36 "systick-reg-ns", childobj=0x555556b42600, size=1056, type=0x555555ff3ee1 "armv7m_systick", errp=0x5555569775f8 <error_abort>) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442#100x0000555555b5d049insysbus_init_child_obj(parent=0x555556b40fa0, childname=0x555555ff3f36 "systick-reg-ns", child=0x555556b42600, childsize=1056, childtype=0x555555ff3ee1 "armv7m_systick")at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376 #11 0x00005555559231b0 in armv7m_nvic_instance_init (obj=0x555556b40fa0) at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/intc/armv7m_nvic.c:2393 #12 0x0000555555d97263 in object_init_with_type (obj=0x555556b40fa0, ti=0x5555569cbce0) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#13
0x0000555555d9755finobject_initialize_with_type(data=0x555556b40fa0, size=7840, type=0x5555569cbce0) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424#140x0000555555d975b0inobject_initialize(data=0x555556b40fa0, size=7840, typename=0x555556019af8 "armv7m_nvic") at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432#150x0000555555d976fdinobject_initialize_childv(parentobj=0x555556b40c90, propname=0x555556019b04 "nvnic", childobj=0x555556b40fa0, size=7840, type=0x555556019af8 "armv7m_nvic", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffda90)at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455#16
0x0000555555d97689inobject_initialize_child(parentobj=0x555556b40c90, propname=0x555556019b04 "nvnic", childobj=0x555556b40fa0, size=7840, type=0x555556019af8 "armv7m_nvic", errp=0x5555569775f8 <error_abort>) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442#170x0000555555b5d049insysbus_init_child_obj(parent=0x555556b40c90, childname=0x555556019b04 "nvnic", child=0x555556b40fa0, childsize=7840, childtype=0x555556019af8 "armv7m_nvic")at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376 #18 0x00005555559c63ba in armv7m_instance_init (obj=0x555556b40c90) at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/armv7m.c:137 #19 0x0000555555d97263 in object_init_with_type (obj=0x555556b40c90, ti=0x5555569db4c0) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#20
0x0000555555d9755finobject_initialize_with_type(data=0x555556b40c90, size=11152, type=0x5555569db4c0) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424#210x0000555555d975b0inobject_initialize(data=0x555556b40c90, size=11152, typename=0x555556022fd1 "armv7m") at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:432#220x0000555555d976fdinobject_initialize_childv(parentobj=0x555556b40980, propname=0x555556022fd1 "armv7m", childobj=0x555556b40c90, size=11152, type=0x555556022fd1 "armv7m", errp=0x5555569775f8 <error_abort>, vargs=0x7fffffffdd50)at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:455#23
0x0000555555d97689inobject_initialize_child(parentobj=0x555556b40980, propname=0x555556022fd1 "armv7m", childobj=0x555556b40c90, size=11152, type=0x555556022fd1 "armv7m", errp=0x5555569775f8 <error_abort>) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:442#240x0000555555b5d049insysbus_init_child_obj(parent=0x555556b40980, childname=0x555556022fd1 "armv7m", child=0x555556b40c90, childsize=11152, childtype=0x555556022fd1 "armv7m")at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/core/sysbus.c:376 #25 0x00005555559f3fdc in iotkit_init (obj=0x555556b40980) at /home/petmay01/linaro/qemu-from-laptop/qemu/hw/arm/iotkit.c:115 #26 0x0000555555d97263 in object_init_with_type (obj=0x555556b40980, ti=0x5555569df840) at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:358#27
0x0000555555d9755finobject_initialize_with_type(data=0x555556b40980, size=50080, type=0x5555569df840) at/home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:424#280x0000555555d97bb9inobject_new_with_type(type=0x5555569df840)at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:588 #29 0x0000555555d97bf6 in object_new (typename=0x555556a2b230 "iotkit") at /home/petmay01/linaro/qemu-from-laptop/qemu/qom/object.c:598#30
0x0000555555aafe8cinqmp_device_list_properties(typename=0x555556a2b230 "iotkit", errp=0x7fffffffe050) at/home/petmay01/linaro/qemu-from-laptop/qemu/qmp.c:519
#310x0000555555a8607ainqdev_device_help(opts=0x555556a2b1c0)
at/home/petmay01/linaro/qemu-from-laptop/qemu/qdev-monitor.c:283
#320x0000555555a8f77eindevice_help_func(opaque=0x0, opts=0x555556a2b1c0, errp=0x0)at /home/petmay01/linaro/qemu-from-laptop/qemu/vl.c:2299 #33 0x0000555555ef5b21 in qemu_opts_foreach (list=0x555556787040 <qemu_device_opts>, func=0x555555a8f75e <device_help_func>, opaque=0x0, errp=0x0) at /home/petmay01/linaro/qemu-from-laptop/qemu/util/qemu-option.c:1171 #34 0x0000555555a94310 in main (argc=5, argv=0x7fffffffe408, envp=0x7fffffffe438) at /home/petmay01/linaro/qemu-from-laptop/qemu/vl.c:4323Looking at the backtrace, this seems to happen because in
device_post_initwe look atm->accelerator, butm->acceleratoris only set whenvl.ccallsconfigure_accelerator(), so if this function gets called before then, it will cause an assert. In particular, the handling of -device foo,help happens before the accelerator is configured. (Possibly other things may cause device init before then too?)thanks
-- PMM
[Qemu-devel] [PULL v2 04/28] machine: move compat properties out of globals
In reply to Marc-André LureauMove the compat arrays inside functions that use them.
--- hw/arm/virt.c | 94 +++--- hw/i386/pc_piix.c | 607 ++++++++++++++++++------------------- hw/i386/pc_q35.c | 121 ++++---- hw/ppc/spapr.c | 254 ++++++++-------- hw/s390x/s390-virtio-ccw.c | 239 +++++++-------- hw/xen/xen-common.c | 38 ++- 6 files changed, 637 insertions(+), 716 deletions(-)
hw/arm/virt.c +40 -54
@@ -1872,98 +1872,88 @@ static void virt_machine_4_0_options(MachineClass *mc) } DEFINE_VIRT_MACHINE_AS_LATEST(4, 0) -static GlobalProperty virt_compat_3_1[] = { -HW_COMPAT_3_1 -}; -static void virt_machine_3_1_options (MachineClass *mc) { +static GlobalProperty compat[] = { +HW_COMPAT_3_1 + }; +virt_machine_4_0_options (mc); -compat_props_add (mc->compat_props, - virt_compat_3_1,G_N_ELEMENTS (virt_compat_3_1)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_VIRT_MACHINE(3, 1) -static GlobalProperty virt_compat_3_0[] = { -HW_COMPAT_3_0 -}; -static void virt_machine_3_0_options (MachineClass *mc) { +static GlobalProperty compat[] = { +HW_COMPAT_3_0 + }; +virt_machine_3_1_options (mc); -compat_props_add (mc->compat_props, - virt_compat_3_0,G_N_ELEMENTS (virt_compat_3_0)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_VIRT_MACHINE(3, 0) -static GlobalProperty virt_compat_2_12[] = { -HW_COMPAT_2_12 -}; -static void virt_machine_2_12_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +static GlobalProperty compat[] = { +HW_COMPAT_2_12 + };virt_machine_3_0_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_12,G_N_ELEMENTS (virt_compat_2_12)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); vmc->no_highmem_ecam = true; mc->max_cpus =255 ; } DEFINE_VIRT_MACHINE(2, 12) -static GlobalProperty virt_compat_2_11[] = { -HW_COMPAT_2_11 -}; -static void virt_machine_2_11_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +static GlobalProperty compat[] = { +HW_COMPAT_2_11 + };virt_machine_2_12_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_11,G_N_ELEMENTS (virt_compat_2_11)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); vmc->smbios_old_sys_ver = true; } DEFINE_VIRT_MACHINE(2, 11) -static GlobalProperty virt_compat_2_10[] = { -HW_COMPAT_2_10 -}; -static void virt_machine_2_10_options (MachineClass *mc) { +static GlobalProperty compat[] = { +HW_COMPAT_2_10 + }; +virt_machine_2_11_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_10,G_N_ELEMENTS (virt_compat_2_10)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));/* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; } DEFINE_VIRT_MACHINE(2, 10) -static GlobalProperty virt_compat_2_9[] = { -HW_COMPAT_2_9 -}; -static void virt_machine_2_9_options (MachineClass *mc) { +static GlobalProperty compat[] = { +HW_COMPAT_2_9 + }; +virt_machine_2_10_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_9,G_N_ELEMENTS (virt_compat_2_9)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_VIRT_MACHINE(2, 9) -static GlobalProperty virt_compat_2_8[] = { -HW_COMPAT_2_8 -}; -static void virt_machine_2_8_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +static GlobalProperty compat[] = { +HW_COMPAT_2_8 + };virt_machine_2_9_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_8,G_N_ELEMENTS (virt_compat_2_8)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));/* For 2.8 and earlier we falsely claimed in the DT that * our timers were edge-triggered, not level-triggered. */
@@ -1971,17 +1961,15 @@ static void virt_machine_2_8_options(MachineClass *mc) } DEFINE_VIRT_MACHINE(2, 8) -static GlobalProperty virt_compat_2_7[] = { -HW_COMPAT_2_7 -}; -static void virt_machine_2_7_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +static GlobalProperty compat[] = { +HW_COMPAT_2_7 + };virt_machine_2_8_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_7,G_N_ELEMENTS (virt_compat_2_7)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));/* ITS was introduced with 2.8 */ vmc->no_its = true;/* Stick with 1K pages for migration compatibility */
@@ -1989,17 +1977,15 @@ static void virt_machine_2_7_options(MachineClass *mc) } DEFINE_VIRT_MACHINE(2, 7) -static GlobalProperty virt_compat_2_6[] = { -HW_COMPAT_2_6 -}; -static void virt_machine_2_6_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); +static GlobalProperty compat[] = { +HW_COMPAT_2_6 + };virt_machine_2_7_options (mc); -compat_props_add (mc->compat_props, - virt_compat_2_6,G_N_ELEMENTS (virt_compat_2_6)); +compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); vmc->disallow_affinity_adjustment = true;/* Disable PMU for 2.6 as PMU support was first introduced in 2.7 */ vmc->no_pmu = true;
hw/i386/pc_piix.c +290 -317
876 lines not on this page · raw message
hw/i386/pc_q35.c +55 -66
226 lines not on this page · raw message
hw/ppc/spapr.c +122 -132
414 lines not on this page · raw message
hw/s390x/s390-virtio-ccw.c +112 -127
329 lines not on this page · raw message
hw/xen/xen-common.c +18 -20
@@ -159,27 +159,26 @@ static int xen_init(MachineState *ms)return 0 ; } -static GlobalProperty xen_compat_props[] = { - { - .driver ="migration" , - .property ="store-global-state" , - .value ="off" , - }, - { - .driver ="migration" , - .property ="send-configuration" , - .value ="off" , - }, - { - .driver ="migration" , - .property ="send-section-footer" , - .value ="off" , - } -}; -static void xen_accel_class_init (ObjectClass *oc,void *data) {AccelClass *ac =ACCEL_CLASS (oc); +static GlobalProperty compat[] = { + { + .driver ="migration" , + .property ="store-global-state" , + .value ="off" , + }, + { + .driver ="migration" , + .property ="send-configuration" , + .value ="off" , + }, + { + .driver ="migration" , + .property ="send-section-footer" , + .value ="off" , + } + }; ac->name ="Xen" ; ac->init_machine = xen_init;
@@ -187,8 +186,7 @@ static void xen_accel_class_init(ObjectClass *oc, void *data) ac->allowed = &xen_allowed; ac->compat_props =g_ptr_array_new (); -compat_props_add (ac->compat_props, - xen_compat_props,G_N_ELEMENTS (xen_compat_props)); +compat_props_add (ac->compat_props, compat,G_N_ELEMENTS (compat)); }#define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen")
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 08/28] compat: replace PC_COMPAT_2_12 & HW_COMPAT_2_12 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 27 --------------------------- include/hw/i386/pc.h | 21 ++------------------- hw/arm/virt.c | 5 +---- hw/core/machine.c | 29 +++++++++++++++++++++++++++++ hw/i386/pc.c | 21 +++++++++++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 6 +----- 10 files changed, 62 insertions(+), 66 deletions(-)
include/hw/boards.h +3 -0
@@ -294,4 +294,7 @@ extern const size_t hw_compat_3_1_len;extern GlobalProperty hw_compat_3_0[];extern const size_t hw_compat_3_0_len; +extern GlobalProperty hw_compat_2_12[]; +extern const size_t hw_compat_2_12_len; +#endif
include/hw/compat.h +0 -27
@@ -1,33 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_12 \ - {\ - .driver = "migration",\ - .property = "decompress-error-check",\ - .value = "off",\ - },{\ - .driver = "hda-audio",\ - .property = "use-timer",\ - .value = "false",\ - },{\ - .driver = "cirrus-vga",\ - .property = "global-vmstate",\ - .value = "true",\ - },{\ - .driver = "VGA",\ - .property = "global-vmstate",\ - .value = "true",\ - },{\ - .driver = "vmware-svga",\ - .property = "global-vmstate",\ - .value = "true",\ - },{\ - .driver = "qxl-vga",\ - .property = "global-vmstate",\ - .value = "true",\ - }, -#define HW_COMPAT_2_11 \ {\ .driver = "hpet",\
include/hw/i386/pc.h +2 -19
@@ -300,25 +300,8 @@ extern const size_t pc_compat_3_1_len;extern GlobalProperty pc_compat_3_0[];extern const size_t pc_compat_3_0_len; -#define PC_COMPAT_2_12 \ - HW_COMPAT_2_12 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "legacy-cache",\ - .value = "on",\ - },{\ - .driver = TYPE_X86_CPU,\ - .property = "topoext",\ - .value = "off",\ - },{\ - .driver = "EPYC-" TYPE_X86_CPU,\ - .property = "xlevel",\ - .value = stringify(0x8000000a),\ - },{\ - .driver = "EPYC-IBPB-" TYPE_X86_CPU,\ - .property = "xlevel",\ - .value = stringify(0x8000000a),\ - }, +extern GlobalProperty pc_compat_2_12[]; +extern const size_t pc_compat_2_12_len;#define PC_COMPAT_2_11 \ HW_COMPAT_2_11 \
hw/arm/virt.c +1 -4
@@ -1889,12 +1889,9 @@ DEFINE_VIRT_MACHINE(3, 0)static void virt_machine_2_12_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); -static GlobalProperty compat[] = { -HW_COMPAT_2_12 - };virt_machine_3_0_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_12, hw_compat_2_12_len); vmc->no_highmem_ecam = true; mc->max_cpus =255 ; }
hw/core/machine.c +29 -0
@@ -38,6 +38,35 @@ const size_t hw_compat_3_1_len = G_N_ELEMENTS(hw_compat_3_1);GlobalProperty hw_compat_3_0[] = {};const size_t hw_compat_3_0_len =G_N_ELEMENTS (hw_compat_3_0); +GlobalProperty hw_compat_2_12[] = { + { + .driver ="migration" , + .property ="decompress-error-check" , + .value ="off" , + },{ + .driver ="hda-audio" , + .property ="use-timer" , + .value ="false" , + },{ + .driver ="cirrus-vga" , + .property ="global-vmstate" , + .value ="true" , + },{ + .driver ="VGA" , + .property ="global-vmstate" , + .value ="true" , + },{ + .driver ="vmware-svga" , + .property ="global-vmstate" , + .value ="true" , + },{ + .driver ="qxl-vga" , + .property ="global-vmstate" , + .value ="true" , + }, +}; +const size_t hw_compat_2_12_len =G_N_ELEMENTS (hw_compat_2_12); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +21 -0
@@ -135,6 +135,27 @@ GlobalProperty pc_compat_3_0[] = { };const size_t pc_compat_3_0_len =G_N_ELEMENTS (pc_compat_3_0); +GlobalProperty pc_compat_2_12[] = { + { + .driver =TYPE_X86_CPU , + .property ="legacy-cache" , + .value ="on" , + },{ + .driver =TYPE_X86_CPU , + .property ="topoext" , + .value ="off" , + },{ + .driver ="EPYC-" TYPE_X86_CPU , + .property ="xlevel" , + .value =stringify (0x8000000a ), + },{ + .driver ="EPYC-IBPB-" TYPE_X86_CPU , + .property ="xlevel" , + .value =stringify (0x8000000a ), + }, +}; +const size_t pc_compat_2_12_len =G_N_ELEMENTS (pc_compat_2_12); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -462,12 +462,9 @@ DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,static void pc_i440fx_2_12_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_12 - }; -pc_i440fx_3_0_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_12, hw_compat_2_12_len); +compat_props_add (m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL,
hw/i386/pc_q35.c +2 -5
@@ -345,12 +345,9 @@ DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL,static void pc_q35_2_12_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_12 - }; -pc_q35_3_0_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_12, hw_compat_2_12_len); +compat_props_add (m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL,
hw/ppc/spapr.c +1 -1
@@ -4054,7 +4054,6 @@ static void spapr_machine_2_12_class_options(MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_12 { .driver =TYPE_POWERPC_CPU , .property ="pre-3.0-migration" ,
@@ -4068,6 +4067,7 @@ static void spapr_machine_2_12_class_options(MachineClass *mc) };spapr_machine_3_0_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_12, hw_compat_2_12_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));/* We depend on kvm_enabled() to choose a default value for the
hw/s390x/s390-virtio-ccw.c +1 -5
@@ -696,12 +696,8 @@ static void ccw_machine_2_12_instance_options(MachineState *machine)static void ccw_machine_2_12_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_12 - }; -ccw_machine_3_0_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_12, hw_compat_2_12_len); } DEFINE_CCW_MACHINE(2_12, "2.12", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 06/28] compat: replace PC_COMPAT_3_1 & HW_COMPAT_3_1 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 11 ----------- include/hw/i386/pc.h | 9 ++------- hw/arm/virt.c | 6 +----- hw/core/machine.c | 13 +++++++++++++ hw/i386/pc.c | 9 +++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 6 +----- hw/s390x/s390-virtio-ccw.c | 6 +----- 10 files changed, 34 insertions(+), 43 deletions(-)
include/hw/boards.h +3 -0
@@ -288,4 +288,7 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) +extern GlobalProperty hw_compat_3_1[]; +extern const size_t hw_compat_3_1_len; +#endif
include/hw/compat.h +0 -11
@@ -1,17 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_3_1 \ - {\ - .driver = "pcie-root-port",\ - .property = "x-speed",\ - .value = "2_5",\ - },{\ - .driver = "pcie-root-port",\ - .property = "x-width",\ - .value = "1",\ - }, -#define HW_COMPAT_3_0 \/* empty */
include/hw/i386/pc.h +2 -7
@@ -294,13 +294,8 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);int e820_get_num_entries (void );bool e820_get_entry (int ,uint32_t ,uint64_t *,uint64_t *); -#define PC_COMPAT_3_1 \ - HW_COMPAT_3_1 \ - {\ - .driver = "intel-iommu",\ - .property = "dma-drain",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_3_1[]; +extern const size_t pc_compat_3_1_len;#define PC_COMPAT_3_0 \ HW_COMPAT_3_0 \
hw/arm/virt.c +1 -5
@@ -1874,12 +1874,8 @@ DEFINE_VIRT_MACHINE_AS_LATEST(4, 0)static void virt_machine_3_1_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_3_1 - }; -virt_machine_4_0_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_1, hw_compat_3_1_len); }DEFINE_VIRT_MACHINE (3 ,1 )
hw/core/machine.c +13 -0
@@ -22,6 +22,19 @@#include "qemu/error-report.h" #include "sysemu/qtest.h" +GlobalProperty hw_compat_3_1[] = { + { + .driver ="pcie-root-port" , + .property ="x-speed" , + .value ="2_5" , + },{ + .driver ="pcie-root-port" , + .property ="x-width" , + .value ="1" , + }, +}; +const size_t hw_compat_3_1_len =G_N_ELEMENTS (hw_compat_3_1); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +9 -0
@@ -109,6 +109,15 @@ static struct e820_entry *e820_table;static unsigned e820_entries;struct hpet_fw_config hpet_cfg = {.count =UINT8_MAX }; +GlobalProperty pc_compat_3_1[] = { + { + .driver ="intel-iommu" , + .property ="dma-drain" , + .value ="off" , + }, +}; +const size_t pc_compat_3_1_len =G_N_ELEMENTS (pc_compat_3_1); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -440,14 +440,11 @@ DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,static void pc_i440fx_3_1_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_3_1 - }; -pc_i440fx_4_0_machine_options (m); m->is_default =0 ; m->alias =NULL ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_3_1, hw_compat_3_1_len); +compat_props_add (m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
hw/i386/pc_q35.c +2 -5
@@ -323,14 +323,11 @@ DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL,static void pc_q35_3_1_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_3_1 - }; -pc_q35_4_0_machine_options (m); m->default_kernel_irqchip_split = false; m->alias =NULL ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_3_1, hw_compat_3_1_len); +compat_props_add (m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL,
hw/ppc/spapr.c +1 -5
@@ -4023,12 +4023,8 @@ DEFINE_SPAPR_MACHINE(4_0, "4.0", true);*/ static void spapr_machine_3_1_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_3_1 - }; -spapr_machine_4_0_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_1, hw_compat_3_1_len); mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power8_v2.0" ); }
hw/s390x/s390-virtio-ccw.c +1 -5
@@ -667,12 +667,8 @@ static void ccw_machine_3_1_instance_options(MachineState *machine)static void ccw_machine_3_1_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_3_1 - }; -ccw_machine_4_0_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_1, hw_compat_3_1_len); } DEFINE_CCW_MACHINE(3_1, "3.1", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 02/28] machines: replace COMPAT define with a static array
In reply to Marc-André Lureau--- include/hw/boards.h | 10 +- hw/arm/virt.c | 45 ++-- hw/i386/pc_piix.c | 474 +++++++++++++++++++++---------------- hw/i386/pc_q35.c | 66 +++++- hw/ppc/spapr.c | 201 ++++++++-------- hw/s390x/s390-virtio-ccw.c | 219 +++++++++-------- 6 files changed, 577 insertions(+), 438 deletions(-)
include/hw/boards.h +3 -7
@@ -289,18 +289,14 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) -#define SET_MACHINE_COMPAT(m, COMPAT) \ +#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]; \ +for (i =0 ; i <G_N_ELEMENTS (compat); i++) { \ +GlobalProperty *prop = &compat[i]; \g_array_append_val (m->compat_props, prop); \ } \ }while (0 )
hw/arm/virt.c +27 -18
141 lines not on this page · raw message
hw/i386/pc_piix.c +270 -204
755 lines not on this page · raw message
hw/i386/pc_q35.c +55 -11
171 lines not on this page · raw message
hw/ppc/spapr.c +107 -94
365 lines not on this page · raw message
hw/s390x/s390-virtio-ccw.c +115 -104
291 lines not on this page · raw message
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 15/28] compat: replace PC_COMPAT_2_5 & HW_COMPAT_2_5 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 24 ------------------------ include/hw/i386/pc.h | 4 ++-- hw/core/machine.c | 26 ++++++++++++++++++++++++++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 6 ++---- hw/i386/pc_q35.c | 6 ++---- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 6 +----- 9 files changed, 40 insertions(+), 40 deletions(-)
include/hw/boards.h +3 -0
@@ -315,4 +315,7 @@ extern const size_t hw_compat_2_7_len;extern GlobalProperty hw_compat_2_6[];extern const size_t hw_compat_2_6_len; +extern GlobalProperty hw_compat_2_5[]; +extern const size_t hw_compat_2_5_len; +#endif
include/hw/compat.h +0 -24
@@ -1,30 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_5 \ - {\ - .driver = "isa-fdc",\ - .property = "fallback",\ - .value = "144",\ - },{\ - .driver = "pvscsi",\ - .property = "x-old-pci-configuration",\ - .value = "on",\ - },{\ - .driver = "pvscsi",\ - .property = "x-disable-pcie",\ - .value = "on",\ - },\ - {\ - .driver = "vmxnet3",\ - .property = "x-old-msi-offsets",\ - .value = "on",\ - },{\ - .driver = "vmxnet3",\ - .property = "x-disable-pcie",\ - .value = "on",\ - }, -#define HW_COMPAT_2_4 \ {\ .driver = "virtio-blk-device",\
include/hw/i386/pc.h +2 -2
@@ -321,8 +321,8 @@ extern const size_t pc_compat_2_7_len;extern GlobalProperty pc_compat_2_6[];extern const size_t pc_compat_2_6_len; -#define PC_COMPAT_2_5 \ - HW_COMPAT_2_5 +extern GlobalProperty pc_compat_2_5[]; +extern const size_t pc_compat_2_5_len;/* Helper for setting model-id for CPU models that changed model-id * depending on QEMU versions up to QEMU 2.4.
hw/core/machine.c +26 -0
@@ -210,6 +210,32 @@ GlobalProperty hw_compat_2_6[] = { };const size_t hw_compat_2_6_len =G_N_ELEMENTS (hw_compat_2_6); +GlobalProperty hw_compat_2_5[] = { + { + .driver ="isa-fdc" , + .property ="fallback" , + .value ="144" , + },{ + .driver ="pvscsi" , + .property ="x-old-pci-configuration" , + .value ="on" , + },{ + .driver ="pvscsi" , + .property ="x-disable-pcie" , + .value ="on" , + }, + { + .driver ="vmxnet3" , + .property ="x-old-msi-offsets" , + .value ="on" , + },{ + .driver ="vmxnet3" , + .property ="x-disable-pcie" , + .value ="on" , + }, +}; +const size_t hw_compat_2_5_len =G_N_ELEMENTS (hw_compat_2_5); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +3 -0
@@ -281,6 +281,9 @@ GlobalProperty pc_compat_2_6[] = { };const size_t pc_compat_2_6_len =G_N_ELEMENTS (pc_compat_2_6); +GlobalProperty pc_compat_2_5[] = {}; +const size_t pc_compat_2_5_len =G_N_ELEMENTS (pc_compat_2_5); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -4
@@ -539,14 +539,12 @@ DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", NULL,static void pc_i440fx_2_5_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_5 - };pc_i440fx_2_6_machine_options (m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order =1 ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_5, hw_compat_2_5_len); +compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } DEFINE_I440FX_MACHINE(v2_5, "pc-i440fx-2.5", NULL,
hw/i386/pc_q35.c +2 -4
@@ -426,14 +426,12 @@ DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL,static void pc_q35_2_5_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_5 - };pc_q35_2_6_machine_options (m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order =1 ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_5, hw_compat_2_5_len); +compat_props_add (m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL,
hw/ppc/spapr.c +1 -1
@@ -4285,7 +4285,6 @@ static void spapr_machine_2_5_class_options(MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_5 { .driver ="spapr-vlan" , .property ="use-rx-buffer-pools" ,
@@ -4295,6 +4294,7 @@ static void spapr_machine_2_5_class_options(MachineClass *mc)spapr_machine_2_6_class_options (mc); smc->use_ohci_by_default = true; +compat_props_add (mc->compat_props, hw_compat_2_5, hw_compat_2_5_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); }
hw/s390x/s390-virtio-ccw.c +1 -5
@@ -836,12 +836,8 @@ static void ccw_machine_2_5_instance_options(MachineState *machine)static void ccw_machine_2_5_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_5 - }; -ccw_machine_2_6_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_5, hw_compat_2_5_len); } DEFINE_CCW_MACHINE(2_5, "2.5", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 11/28] compat: replace PC_COMPAT_2_9 & HW_COMPAT_2_9 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 19 ------------------- include/hw/i386/pc.h | 9 ++------- hw/arm/virt.c | 6 +----- hw/core/machine.c | 21 +++++++++++++++++++++ hw/i386/pc.c | 9 +++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 42 insertions(+), 43 deletions(-)
include/hw/boards.h +3 -0
@@ -303,4 +303,7 @@ extern const size_t hw_compat_2_11_len;extern GlobalProperty hw_compat_2_10[];extern const size_t hw_compat_2_10_len; +extern GlobalProperty hw_compat_2_9[]; +extern const size_t hw_compat_2_9_len; +#endif
include/hw/compat.h +0 -19
@@ -1,25 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_9 \ - {\ - .driver = "pci-bridge",\ - .property = "shpc",\ - .value = "off",\ - },{\ - .driver = "intel-iommu",\ - .property = "pt",\ - .value = "off",\ - },{\ - .driver = "virtio-net-device",\ - .property = "x-mtu-bypass-backend",\ - .value = "off",\ - },{\ - .driver = "pcie-root-port",\ - .property = "x-migrate-msix",\ - .value = "false",\ - }, -#define HW_COMPAT_2_8 \ {\ .driver = "fw_cfg_mem",\
include/hw/i386/pc.h +2 -7
@@ -309,13 +309,8 @@ extern const size_t pc_compat_2_11_len;extern GlobalProperty pc_compat_2_10[];extern const size_t pc_compat_2_10_len; -#define PC_COMPAT_2_9 \ - HW_COMPAT_2_9 \ - {\ - .driver = "mch",\ - .property = "extended-tseg-mbytes",\ - .value = stringify(0),\ - },\ +extern GlobalProperty pc_compat_2_9[]; +extern const size_t pc_compat_2_9_len;#define PC_COMPAT_2_8 \ HW_COMPAT_2_8 \
hw/arm/virt.c +1 -5
@@ -1918,12 +1918,8 @@ DEFINE_VIRT_MACHINE(2, 10)static void virt_machine_2_9_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_9 - }; -virt_machine_2_10_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_9, hw_compat_2_9_len); }DEFINE_VIRT_MACHINE (2 ,9 )
hw/core/machine.c +21 -0
@@ -101,6 +101,27 @@ GlobalProperty hw_compat_2_10[] = { };const size_t hw_compat_2_10_len =G_N_ELEMENTS (hw_compat_2_10); +GlobalProperty hw_compat_2_9[] = { + { + .driver ="pci-bridge" , + .property ="shpc" , + .value ="off" , + },{ + .driver ="intel-iommu" , + .property ="pt" , + .value ="off" , + },{ + .driver ="virtio-net-device" , + .property ="x-mtu-bypass-backend" , + .value ="off" , + },{ + .driver ="pcie-root-port" , + .property ="x-migrate-msix" , + .value ="false" , + }, +}; +const size_t hw_compat_2_9_len =G_N_ELEMENTS (hw_compat_2_9); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +9 -0
@@ -186,6 +186,15 @@ GlobalProperty pc_compat_2_10[] = { };const size_t pc_compat_2_10_len =G_N_ELEMENTS (pc_compat_2_10); +GlobalProperty pc_compat_2_9[] = { + { + .driver ="mch" , + .property ="extended-tseg-mbytes" , + .value =stringify (0 ), + }, +}; +const size_t pc_compat_2_9_len =G_N_ELEMENTS (pc_compat_2_9); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -493,12 +493,9 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,static void pc_i440fx_2_9_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_9 - }; -pc_i440fx_2_10_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_9, hw_compat_2_9_len); +compat_props_add (m->compat_props, pc_compat_2_9, pc_compat_2_9_len); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; }
hw/i386/pc_q35.c +2 -5
@@ -380,12 +380,9 @@ DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL,static void pc_q35_2_9_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_9 - }; -pc_q35_2_10_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_9, hw_compat_2_9_len); +compat_props_add (m->compat_props, pc_compat_2_9, pc_compat_2_9_len); } DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL,
hw/ppc/spapr.c +1 -1
@@ -4127,7 +4127,6 @@ static void spapr_machine_2_9_class_options(MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_9 { .driver =TYPE_POWERPC_CPU , .property ="pre-2.10-migration" ,
@@ -4136,6 +4135,7 @@ static void spapr_machine_2_9_class_options(MachineClass *mc) };spapr_machine_2_10_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_9, hw_compat_2_9_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram; smc->pre_2_10_has_unused_icps = true;
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -752,7 +752,6 @@ static void ccw_machine_2_9_class_options(MachineClass *mc) {S390CcwMachineClass *s390mc =S390_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_9 { .driver =TYPE_S390_STATTRIB , .property ="migration-enabled" ,
@@ -761,6 +760,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc) };ccw_machine_2_10_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_9, hw_compat_2_9_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); s390mc->css_migration_enabled = false; }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 03/28] hw: apply machine compat properties without touching globals
In reply to Marc-André LureauSimilarly to accel properties, move compat properties out of globals registration, and apply the machine compat properties during device_post_init().
--- include/hw/boards.h | 3 +- hw/arm/virt.c | 27 ++++++++----- hw/core/machine.c | 19 +-------- hw/core/qdev.c | 2 + hw/i386/pc_piix.c | 81 +++++++++++++++++++++++++------------- hw/i386/pc_q35.c | 33 ++++++++++------ hw/ppc/spapr.c | 42 +++++++++++++------- hw/s390x/s390-virtio-ccw.c | 33 ++++++++++------ vl.c | 1 - 9 files changed, 148 insertions(+), 93 deletions(-)
include/hw/boards.h +1 -2
@@ -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;
hw/arm/virt.c +18 -9
@@ -1879,7 +1879,8 @@ static GlobalProperty virt_compat_3_1[] = {static void virt_machine_3_1_options (MachineClass *mc) {virt_machine_4_0_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_3_1); +compat_props_add (mc->compat_props, + virt_compat_3_1,G_N_ELEMENTS (virt_compat_3_1)); }DEFINE_VIRT_MACHINE (3 ,1 )
@@ -1890,7 +1891,8 @@ static GlobalProperty virt_compat_3_0[] = {static void virt_machine_3_0_options (MachineClass *mc) {virt_machine_3_1_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_3_0); +compat_props_add (mc->compat_props, + virt_compat_3_0,G_N_ELEMENTS (virt_compat_3_0)); }DEFINE_VIRT_MACHINE (3 ,0 )
@@ -1903,7 +1905,8 @@ static void virt_machine_2_12_options(MachineClass *mc)VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc));virt_machine_3_0_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_12); +compat_props_add (mc->compat_props, + virt_compat_2_12,G_N_ELEMENTS (virt_compat_2_12)); vmc->no_highmem_ecam = true; mc->max_cpus =255 ; }
@@ -1918,7 +1921,8 @@ static void virt_machine_2_11_options(MachineClass *mc)VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc));virt_machine_2_12_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_11); +compat_props_add (mc->compat_props, + virt_compat_2_11,G_N_ELEMENTS (virt_compat_2_11)); vmc->smbios_old_sys_ver = true; }DEFINE_VIRT_MACHINE (2 ,11 )
@@ -1930,7 +1934,8 @@ static GlobalProperty virt_compat_2_10[] = {static void virt_machine_2_10_options (MachineClass *mc) {virt_machine_2_11_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_10); +compat_props_add (mc->compat_props, + virt_compat_2_10,G_N_ELEMENTS (virt_compat_2_10));/* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; }
@@ -1943,7 +1948,8 @@ static GlobalProperty virt_compat_2_9[] = {static void virt_machine_2_9_options (MachineClass *mc) {virt_machine_2_10_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_9); +compat_props_add (mc->compat_props, + virt_compat_2_9,G_N_ELEMENTS (virt_compat_2_9)); }DEFINE_VIRT_MACHINE (2 ,9 )
@@ -1956,7 +1962,8 @@ static void virt_machine_2_8_options(MachineClass *mc)VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc));virt_machine_2_9_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_8); +compat_props_add (mc->compat_props, + virt_compat_2_8,G_N_ELEMENTS (virt_compat_2_8));/* For 2.8 and earlier we falsely claimed in the DT that * our timers were edge-triggered, not level-triggered. */
@@ -1973,7 +1980,8 @@ static void virt_machine_2_7_options(MachineClass *mc)VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc));virt_machine_2_8_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_7); +compat_props_add (mc->compat_props, + virt_compat_2_7,G_N_ELEMENTS (virt_compat_2_7));/* ITS was introduced with 2.8 */ vmc->no_its = true;/* Stick with 1K pages for migration compatibility */
@@ -1990,7 +1998,8 @@ static void virt_machine_2_6_options(MachineClass *mc)VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc));virt_machine_2_7_options (mc); -SET_MACHINE_COMPAT (mc, virt_compat_2_6); +compat_props_add (mc->compat_props, + virt_compat_2_6,G_N_ELEMENTS (virt_compat_2_6)); vmc->disallow_affinity_adjustment = true;/* Disable PMU for 2.6 as PMU support was first introduced in 2.7 */ vmc->no_pmu = true;
hw/core/machine.c +1 -18
@@ -647,6 +647,7 @@ static void machine_class_base_init(ObjectClass *oc, void *data)assert (g_str_has_suffix (cname,TYPE_MACHINE_SUFFIX )); mc->name =g_strndup (cname,strlen (cname) -strlen (TYPE_MACHINE_SUFFIX )); + mc->compat_props =g_ptr_array_new (); } }
@@ -836,24 +837,6 @@ void machine_run_board_init(MachineState *machine) machine_class->init (machine); } -void machine_register_compat_props (MachineState *machine) -{ -MachineClass *mc =MACHINE_GET_CLASS (machine); -int i; -GlobalProperty *p; - -if (!mc->compat_props) { -return ; - } - -for (i =0 ; i < mc->compat_props->len; i++) { - p = g_array_index(mc->compat_props, GlobalProperty *, i); -/* Machine compat_props must never cause errors: */ - p->errp = &error_abort; -qdev_prop_register_global (p); - } -} -static const TypeInfo machine_info = { .name =TYPE_MACHINE , .parent =TYPE_OBJECT ,
hw/core/qdev.c +2 -0
@@ -974,11 +974,13 @@ static void device_post_init(Object *obj) {if (object_dynamic_cast (qdev_get_machine (),TYPE_MACHINE )) {MachineState *m =MACHINE (qdev_get_machine ()); +MachineClass *mc =MACHINE_GET_CLASS (m);AccelClass *ac =ACCEL_GET_CLASS (m->accelerator);if (ac->compat_props) {object_apply_global_props (obj, ac->compat_props, &error_abort); } +object_apply_global_props (obj, mc->compat_props, &error_abort); }qdev_prop_set_globals (DEVICE (obj));
hw/i386/pc_piix.c +54 -27
243 lines not on this page · raw message
hw/i386/pc_q35.c +22 -11
@@ -330,7 +330,8 @@ static void pc_q35_3_1_machine_options(MachineClass *m)pc_q35_4_0_machine_options (m); m->default_kernel_irqchip_split = false; m->alias =NULL ; -SET_MACHINE_COMPAT (m, pc_compat_3_1); +compat_props_add (m->compat_props, + pc_compat_3_1,G_N_ELEMENTS (pc_compat_3_1)); } DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL,
@@ -343,7 +344,8 @@ static GlobalProperty pc_compat_3_0[] = {static void pc_q35_3_0_machine_options (MachineClass *m) {pc_q35_3_1_machine_options (m); -SET_MACHINE_COMPAT (m, pc_compat_3_0); +compat_props_add (m->compat_props, + pc_compat_3_0,G_N_ELEMENTS (pc_compat_3_0)); } DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL,
@@ -356,7 +358,8 @@ static GlobalProperty pc_compat_2_12[] = {static void pc_q35_2_12_machine_options (MachineClass *m) {pc_q35_3_0_machine_options (m); -SET_MACHINE_COMPAT (m, pc_compat_2_12); +compat_props_add (m->compat_props, + pc_compat_2_12,G_N_ELEMENTS (pc_compat_2_12)); } DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL,
@@ -372,7 +375,8 @@ static void pc_q35_2_11_machine_options(MachineClass *m)pc_q35_2_12_machine_options (m); pcmc->default_nic_model ="e1000" ; -SET_MACHINE_COMPAT (m, pc_compat_2_11); +compat_props_add (m->compat_props, + pc_compat_2_11,G_N_ELEMENTS (pc_compat_2_11)); } DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL,
@@ -385,7 +389,8 @@ static GlobalProperty pc_compat_2_10[] = {static void pc_q35_2_10_machine_options (MachineClass *m) {pc_q35_2_11_machine_options (m); -SET_MACHINE_COMPAT (m, pc_compat_2_10); +compat_props_add (m->compat_props, + pc_compat_2_10,G_N_ELEMENTS (pc_compat_2_10)); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; }
@@ -400,7 +405,8 @@ static GlobalProperty pc_compat_2_9[] = {static void pc_q35_2_9_machine_options (MachineClass *m) {pc_q35_2_10_machine_options (m); -SET_MACHINE_COMPAT (m, pc_compat_2_9); +compat_props_add (m->compat_props, + pc_compat_2_9,G_N_ELEMENTS (pc_compat_2_9)); } DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL,
@@ -413,7 +419,8 @@ static GlobalProperty pc_compat_2_8[] = {static void pc_q35_2_8_machine_options (MachineClass *m) {pc_q35_2_9_machine_options (m); -SET_MACHINE_COMPAT (m, pc_compat_2_8); +compat_props_add (m->compat_props, + pc_compat_2_8,G_N_ELEMENTS (pc_compat_2_8)); } DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL,
@@ -427,7 +434,8 @@ static void pc_q35_2_7_machine_options(MachineClass *m) {pc_q35_2_8_machine_options (m); m->max_cpus =255 ; -SET_MACHINE_COMPAT (m, pc_compat_2_7); +compat_props_add (m->compat_props, + pc_compat_2_7,G_N_ELEMENTS (pc_compat_2_7)); } DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL,
@@ -443,7 +451,8 @@ static void pc_q35_2_6_machine_options(MachineClass *m)pc_q35_2_7_machine_options (m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; -SET_MACHINE_COMPAT (m, pc_compat_2_6); +compat_props_add (m->compat_props, + pc_compat_2_6,G_N_ELEMENTS (pc_compat_2_6)); } DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL,
@@ -459,7 +468,8 @@ static void pc_q35_2_5_machine_options(MachineClass *m)pc_q35_2_6_machine_options (m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order =1 ; -SET_MACHINE_COMPAT (m, pc_compat_2_5); +compat_props_add (m->compat_props, + pc_compat_2_5,G_N_ELEMENTS (pc_compat_2_5)); } DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL,
@@ -475,7 +485,8 @@ static void pc_q35_2_4_machine_options(MachineClass *m)pc_q35_2_5_machine_options (m); m->hw_version ="2.4.0" ; pcmc->broken_reserved_end = true; -SET_MACHINE_COMPAT (m, pc_compat_2_4); +compat_props_add (m->compat_props, + pc_compat_2_4,G_N_ELEMENTS (pc_compat_2_4)); } DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
hw/ppc/spapr.c +28 -14
126 lines not on this page · raw message
hw/s390x/s390-virtio-ccw.c +22 -11
@@ -773,7 +773,8 @@ static void ccw_machine_3_1_instance_options(MachineState *machine)static void ccw_machine_3_1_class_options (MachineClass *mc) {ccw_machine_4_0_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_3_1); +compat_props_add (mc->compat_props, + ccw_compat_3_1,G_N_ELEMENTS (ccw_compat_3_1)); } DEFINE_CCW_MACHINE(3_1, "3.1", false);
@@ -788,7 +789,8 @@ static void ccw_machine_3_0_class_options(MachineClass *mc) s390mc->hpage_1m_allowed = false;ccw_machine_3_1_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_3_0); +compat_props_add (mc->compat_props, + ccw_compat_3_0,G_N_ELEMENTS (ccw_compat_3_0)); } DEFINE_CCW_MACHINE(3_0, "3.0", false);
@@ -802,7 +804,8 @@ static void ccw_machine_2_12_instance_options(MachineState *machine)static void ccw_machine_2_12_class_options (MachineClass *mc) {ccw_machine_3_0_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_12); +compat_props_add (mc->compat_props, + ccw_compat_2_12,G_N_ELEMENTS (ccw_compat_2_12)); } DEFINE_CCW_MACHINE(2_12, "2.12", false);
@@ -818,7 +821,8 @@ static void ccw_machine_2_11_instance_options(MachineState *machine)static void ccw_machine_2_11_class_options (MachineClass *mc) {ccw_machine_2_12_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_11); +compat_props_add (mc->compat_props, + ccw_compat_2_11,G_N_ELEMENTS (ccw_compat_2_11)); } DEFINE_CCW_MACHINE(2_11, "2.11", false);
@@ -830,7 +834,8 @@ static void ccw_machine_2_10_instance_options(MachineState *machine)static void ccw_machine_2_10_class_options (MachineClass *mc) {ccw_machine_2_11_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_10); +compat_props_add (mc->compat_props, + ccw_compat_2_10,G_N_ELEMENTS (ccw_compat_2_10)); } DEFINE_CCW_MACHINE(2_10, "2.10", false);
@@ -849,7 +854,8 @@ static void ccw_machine_2_9_class_options(MachineClass *mc)S390CcwMachineClass *s390mc =S390_MACHINE_CLASS (mc);ccw_machine_2_10_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_9); +compat_props_add (mc->compat_props, + ccw_compat_2_9,G_N_ELEMENTS (ccw_compat_2_9)); s390mc->css_migration_enabled = false; } DEFINE_CCW_MACHINE(2_9, "2.9", false);
@@ -862,7 +868,8 @@ static void ccw_machine_2_8_instance_options(MachineState *machine)static void ccw_machine_2_8_class_options (MachineClass *mc) {ccw_machine_2_9_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_8); +compat_props_add (mc->compat_props, + ccw_compat_2_8,G_N_ELEMENTS (ccw_compat_2_8)); } DEFINE_CCW_MACHINE(2_8, "2.8", false);
@@ -877,7 +884,8 @@ static void ccw_machine_2_7_class_options(MachineClass *mc) s390mc->cpu_model_allowed = false;ccw_machine_2_8_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_7); +compat_props_add (mc->compat_props, + ccw_compat_2_7,G_N_ELEMENTS (ccw_compat_2_7)); } DEFINE_CCW_MACHINE(2_7, "2.7", false);
@@ -892,7 +900,8 @@ static void ccw_machine_2_6_class_options(MachineClass *mc) s390mc->ri_allowed = false;ccw_machine_2_7_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_6); +compat_props_add (mc->compat_props, + ccw_compat_2_6,G_N_ELEMENTS (ccw_compat_2_6)); } DEFINE_CCW_MACHINE(2_6, "2.6", false);
@@ -904,7 +913,8 @@ static void ccw_machine_2_5_instance_options(MachineState *machine)static void ccw_machine_2_5_class_options (MachineClass *mc) {ccw_machine_2_6_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_5); +compat_props_add (mc->compat_props, + ccw_compat_2_5,G_N_ELEMENTS (ccw_compat_2_5)); } DEFINE_CCW_MACHINE(2_5, "2.5", false);
@@ -916,7 +926,8 @@ static void ccw_machine_2_4_instance_options(MachineState *machine)static void ccw_machine_2_4_class_options (MachineClass *mc) {ccw_machine_2_5_class_options (mc); -SET_MACHINE_COMPAT (mc, ccw_compat_2_4); +compat_props_add (mc->compat_props, + ccw_compat_2_4,G_N_ELEMENTS (ccw_compat_2_4)); } DEFINE_CCW_MACHINE(2_4, "2.4", false);
vl.c +0 -1
@@ -2996,7 +2996,6 @@ static void user_register_global_props(void)*/ static void register_global_properties (MachineState *ms) { -machine_register_compat_props (ms);user_register_global_props (); }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 10/28] compat: replace PC_COMPAT_2_10 & HW_COMPAT_2_10 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 11 ----------- include/hw/i386/pc.h | 17 ++--------------- hw/arm/virt.c | 6 +----- hw/core/machine.c | 13 +++++++++++++ hw/i386/pc.c | 17 +++++++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 6 +----- hw/s390x/s390-virtio-ccw.c | 6 +----- 10 files changed, 42 insertions(+), 51 deletions(-)
include/hw/boards.h +3 -0
@@ -300,4 +300,7 @@ extern const size_t hw_compat_2_12_len;extern GlobalProperty hw_compat_2_11[];extern const size_t hw_compat_2_11_len; +extern GlobalProperty hw_compat_2_10[]; +extern const size_t hw_compat_2_10_len; +#endif
include/hw/compat.h +0 -11
@@ -1,17 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_10 \ - {\ - .driver = "virtio-mouse-device",\ - .property = "wheel-axis",\ - .value = "false",\ - },{\ - .driver = "virtio-tablet-device",\ - .property = "wheel-axis",\ - .value = "false",\ - }, -#define HW_COMPAT_2_9 \ {\ .driver = "pci-bridge",\
include/hw/i386/pc.h +2 -15
@@ -306,21 +306,8 @@ extern const size_t pc_compat_2_12_len;extern GlobalProperty pc_compat_2_11[];extern const size_t pc_compat_2_11_len; -#define PC_COMPAT_2_10 \ - HW_COMPAT_2_10 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "x-hv-max-vps",\ - .value = "0x40",\ - },{\ - .driver = "i440FX-pcihost",\ - .property = "x-pci-hole64-fix",\ - .value = "off",\ - },{\ - .driver = "q35-pcihost",\ - .property = "x-pci-hole64-fix",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_2_10[]; +extern const size_t pc_compat_2_10_len;#define PC_COMPAT_2_9 \ HW_COMPAT_2_9 \
hw/arm/virt.c +1 -5
@@ -1909,12 +1909,8 @@ DEFINE_VIRT_MACHINE(2, 11)static void virt_machine_2_10_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_10 - }; -virt_machine_2_11_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_10, hw_compat_2_10_len);/* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; }
hw/core/machine.c +13 -0
@@ -88,6 +88,19 @@ GlobalProperty hw_compat_2_11[] = { };const size_t hw_compat_2_11_len =G_N_ELEMENTS (hw_compat_2_11); +GlobalProperty hw_compat_2_10[] = { + { + .driver ="virtio-mouse-device" , + .property ="wheel-axis" , + .value ="false" , + },{ + .driver ="virtio-tablet-device" , + .property ="wheel-axis" , + .value ="false" , + }, +}; +const size_t hw_compat_2_10_len =G_N_ELEMENTS (hw_compat_2_10); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +17 -0
@@ -169,6 +169,23 @@ GlobalProperty pc_compat_2_11[] = { };const size_t pc_compat_2_11_len =G_N_ELEMENTS (pc_compat_2_11); +GlobalProperty pc_compat_2_10[] = { + { + .driver =TYPE_X86_CPU , + .property ="x-hv-max-vps" , + .value ="0x40" , + },{ + .driver ="i440FX-pcihost" , + .property ="x-pci-hole64-fix" , + .value ="off" , + },{ + .driver ="q35-pcihost" , + .property ="x-pci-hole64-fix" , + .value ="off" , + }, +}; +const size_t pc_compat_2_10_len =G_N_ELEMENTS (pc_compat_2_10); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -482,12 +482,9 @@ DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL,static void pc_i440fx_2_10_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_10 - }; -pc_i440fx_2_11_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_10, hw_compat_2_10_len); +compat_props_add (m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->auto_enable_numa_with_memhp = false; }
hw/i386/pc_q35.c +2 -5
@@ -368,12 +368,9 @@ DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL,static void pc_q35_2_10_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_10 - }; -pc_q35_2_11_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_10, hw_compat_2_10_len); +compat_props_add (m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; }
hw/ppc/spapr.c +1 -5
@@ -4113,12 +4113,8 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false);static void spapr_machine_2_10_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_10 - }; -spapr_machine_2_11_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
hw/s390x/s390-virtio-ccw.c +1 -5
@@ -733,12 +733,8 @@ static void ccw_machine_2_10_instance_options(MachineState *machine)static void ccw_machine_2_10_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_10 - }; -ccw_machine_2_11_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } DEFINE_CCW_MACHINE(2_10, "2.10", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 17/28] compat: replace PC_COMPAT_2_3 & HW_COMPAT_2_3 macros
In reply to Marc-André LureauUse static arrays instead. I decided to rename the conflicting pc_compat_2_3() function with pc_compat_2_3_fn().
--- include/hw/boards.h | 3 ++ include/hw/compat.h | 39 -------------------- include/hw/i386/pc.h | 88 ++------------------------------------------ hw/core/machine.c | 41 +++++++++++++++++++++ hw/i386/pc.c | 86 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 13 +++---- hw/ppc/spapr.c | 2 +- 7 files changed, 139 insertions(+), 133 deletions(-)
include/hw/boards.h +3 -0
@@ -321,4 +321,7 @@ extern const size_t hw_compat_2_5_len;extern GlobalProperty hw_compat_2_4[];extern const size_t hw_compat_2_4_len; +extern GlobalProperty hw_compat_2_3[]; +extern const size_t hw_compat_2_3_len; +#endif
include/hw/compat.h +0 -39
@@ -1,45 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_3 \ - {\ - .driver = "virtio-blk-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "virtio-balloon-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "virtio-serial-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "virtio-9p-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "virtio-rng-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = TYPE_PCI_DEVICE,\ - .property = "x-pcie-lnksta-dllla",\ - .value = "off",\ - },{\ - .driver = "migration",\ - .property = "send-configuration",\ - .value = "off",\ - },{\ - .driver = "migration",\ - .property = "send-section-footer",\ - .value = "off",\ - },{\ - .driver = "migration",\ - .property = "store-global-state",\ - .value = "off",\ - }, -#define HW_COMPAT_2_2 \/* empty */
include/hw/i386/pc.h +3 -85
100 lines not on this page · raw message
hw/core/machine.c +41 -0
47 lines not on this page · raw message
hw/i386/pc.c +86 -0
92 lines not on this page · raw message
hw/i386/pc_piix.c +5 -8
@@ -310,7 +310,7 @@ static void pc_init1(MachineState *machine,* HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options(). */ -static void pc_compat_2_3 (MachineState *machine) +static void pc_compat_2_3_fn (MachineState *machine) {PCMachineState *pcms =PC_MACHINE (machine);if (kvm_enabled ()) {
@@ -320,7 +320,7 @@ static void pc_compat_2_3(MachineState *machine)static void pc_compat_2_2 (MachineState *machine) { -pc_compat_2_3 (machine); +pc_compat_2_3_fn (machine); }static void pc_compat_2_1 (MachineState *machine)
@@ -566,16 +566,13 @@ DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL,static void pc_i440fx_2_3_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_3 - }; -pc_i440fx_2_4_machine_options (m); m->hw_version ="2.3.0" ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_3, hw_compat_2_3_len); +compat_props_add (m->compat_props, pc_compat_2_3, pc_compat_2_3_len); } -DEFINE_I440FX_MACHINE (v2_3,"pc-i440fx-2.3" , pc_compat_2_3, +DEFINE_I440FX_MACHINE (v2_3,"pc-i440fx-2.3" , pc_compat_2_3_fn, pc_i440fx_2_3_machine_options);static void pc_i440fx_2_2_machine_options (MachineClass *m)
hw/ppc/spapr.c +1 -1
@@ -4322,7 +4322,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false);static void spapr_machine_2_3_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_3 { .driver ="spapr-pci-host-bridge" , .property ="dynamic-reconfiguration" ,
@@ -4330,6 +4329,7 @@ static void spapr_machine_2_3_class_options(MachineClass *mc) }, };spapr_machine_2_4_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_3, hw_compat_2_3_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_SPAPR_MACHINE(2_3, "2.3", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 12/28] compat: replace PC_COMPAT_2_8 & HW_COMPAT_2_8 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 43 ----------------------------------- include/hw/i386/pc.h | 29 ++---------------------- hw/arm/virt.c | 5 +---- hw/core/machine.c | 46 ++++++++++++++++++++++++++++++++++++++ hw/i386/pc.c | 29 ++++++++++++++++++++++++ hw/i386/pc_piix.c | 7 ++---- hw/i386/pc_q35.c | 7 ++---- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 87 insertions(+), 86 deletions(-)
include/hw/boards.h +3 -0
@@ -306,4 +306,7 @@ extern const size_t hw_compat_2_10_len;extern GlobalProperty hw_compat_2_9[];extern const size_t hw_compat_2_9_len; +extern GlobalProperty hw_compat_2_8[]; +extern const size_t hw_compat_2_8_len; +#endif
include/hw/compat.h +0 -43
49 lines not on this page · raw message
include/hw/i386/pc.h +2 -27
@@ -312,33 +312,8 @@ extern const size_t pc_compat_2_10_len;extern GlobalProperty pc_compat_2_9[];extern const size_t pc_compat_2_9_len; -#define PC_COMPAT_2_8 \ - HW_COMPAT_2_8 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "tcg-cpuid",\ - .value = "off",\ - },\ - {\ - .driver = "kvmclock",\ - .property = "x-mach-use-reliable-get-clock",\ - .value = "off",\ - },\ - {\ - .driver = "ICH9-LPC",\ - .property = "x-smi-broadcast",\ - .value = "off",\ - },\ - {\ - .driver = TYPE_X86_CPU,\ - .property = "vmware-cpuid-freq",\ - .value = "off",\ - },\ - {\ - .driver = "Haswell-" TYPE_X86_CPU,\ - .property = "stepping",\ - .value = "1",\ - }, +extern GlobalProperty pc_compat_2_8[]; +extern const size_t pc_compat_2_8_len;#define PC_COMPAT_2_7 \ HW_COMPAT_2_7 \
hw/arm/virt.c +1 -4
@@ -1926,12 +1926,9 @@ DEFINE_VIRT_MACHINE(2, 9)static void virt_machine_2_8_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); -static GlobalProperty compat[] = { -HW_COMPAT_2_8 - };virt_machine_2_9_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_8, hw_compat_2_8_len);/* For 2.8 and earlier we falsely claimed in the DT that * our timers were edge-triggered, not level-triggered. */
hw/core/machine.c +46 -0
58 lines not on this page · raw message
hw/i386/pc.c +29 -0
@@ -195,6 +195,35 @@ GlobalProperty pc_compat_2_9[] = { };const size_t pc_compat_2_9_len =G_N_ELEMENTS (pc_compat_2_9); +GlobalProperty pc_compat_2_8[] = { + { + .driver =TYPE_X86_CPU , + .property ="tcg-cpuid" , + .value ="off" , + }, + { + .driver ="kvmclock" , + .property ="x-mach-use-reliable-get-clock" , + .value ="off" , + }, + { + .driver ="ICH9-LPC" , + .property ="x-smi-broadcast" , + .value ="off" , + }, + { + .driver =TYPE_X86_CPU , + .property ="vmware-cpuid-freq" , + .value ="off" , + }, + { + .driver ="Haswell-" TYPE_X86_CPU , + .property ="stepping" , + .value ="1" , + }, +}; +const size_t pc_compat_2_8_len =G_N_ELEMENTS (pc_compat_2_8); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -504,12 +504,9 @@ DEFINE_I440FX_MACHINE(v2_9, "pc-i440fx-2.9", NULL,static void pc_i440fx_2_8_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_8 - }; -pc_i440fx_2_9_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_8, hw_compat_2_8_len); +compat_props_add (m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL,
hw/i386/pc_q35.c +2 -5
@@ -390,12 +390,9 @@ DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL,static void pc_q35_2_8_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_8 - }; -pc_q35_2_9_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_8, hw_compat_2_8_len); +compat_props_add (m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL,
hw/ppc/spapr.c +1 -1
@@ -4151,7 +4151,6 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false);static void spapr_machine_2_8_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_8 { .driver =TYPE_SPAPR_PCI_HOST_BRIDGE , .property ="pcie-extended-configuration-space" ,
@@ -4160,6 +4159,7 @@ static void spapr_machine_2_8_class_options(MachineClass *mc) };spapr_machine_2_9_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_8, hw_compat_2_8_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); mc->numa_mem_align_shift =23 ; }
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -774,7 +774,6 @@ static void ccw_machine_2_8_instance_options(MachineState *machine)static void ccw_machine_2_8_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_8 { .driver =TYPE_S390_FLIC_COMMON , .property ="adapter_routes_max_batch" ,
@@ -783,6 +782,7 @@ static void ccw_machine_2_8_class_options(MachineClass *mc) };ccw_machine_2_9_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_8, hw_compat_2_8_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_CCW_MACHINE(2_8, "2.8", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 13/28] compat: replace PC_COMPAT_2_7 & HW_COMPAT_2_7 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 23 ----------------------- include/hw/i386/pc.h | 34 ++-------------------------------- hw/arm/virt.c | 5 +---- hw/core/machine.c | 25 +++++++++++++++++++++++++ hw/i386/pc.c | 34 ++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 5 +---- 10 files changed, 71 insertions(+), 74 deletions(-)
include/hw/boards.h +3 -0
@@ -309,4 +309,7 @@ extern const size_t hw_compat_2_9_len;extern GlobalProperty hw_compat_2_8[];extern const size_t hw_compat_2_8_len; +extern GlobalProperty hw_compat_2_7[]; +extern const size_t hw_compat_2_7_len; +#endif
include/hw/compat.h +0 -23
@@ -1,29 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_7 \ - {\ - .driver = "virtio-pci",\ - .property = "page-per-vq",\ - .value = "on",\ - },{\ - .driver = "virtio-serial-device",\ - .property = "emergency-write",\ - .value = "off",\ - },{\ - .driver = "ioapic",\ - .property = "version",\ - .value = "0x11",\ - },{\ - .driver = "intel-iommu",\ - .property = "x-buggy-eim",\ - .value = "true",\ - },{\ - .driver = "virtio-pci",\ - .property = "x-ignore-backend-features",\ - .value = "on",\ - }, -#define HW_COMPAT_2_6 \ {\ .driver = "virtio-mmio",\
include/hw/i386/pc.h +2 -32
@@ -315,38 +315,8 @@ extern const size_t pc_compat_2_9_len;extern GlobalProperty pc_compat_2_8[];extern const size_t pc_compat_2_8_len; -#define PC_COMPAT_2_7 \ - HW_COMPAT_2_7 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "l3-cache",\ - .value = "off",\ - },\ - {\ - .driver = TYPE_X86_CPU,\ - .property = "full-cpuid-auto-level",\ - .value = "off",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "family",\ - .value = "15",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "model",\ - .value = "6",\ - },\ - {\ - .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ - .property = "stepping",\ - .value = "1",\ - },\ - {\ - .driver = "isa-pcspk",\ - .property = "migrate",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_2_7[]; +extern const size_t pc_compat_2_7_len;#define PC_COMPAT_2_6 \ HW_COMPAT_2_6 \
hw/arm/virt.c +1 -4
@@ -1939,12 +1939,9 @@ DEFINE_VIRT_MACHINE(2, 8)static void virt_machine_2_7_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); -static GlobalProperty compat[] = { -HW_COMPAT_2_7 - };virt_machine_2_8_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_7, hw_compat_2_7_len);/* ITS was introduced with 2.8 */ vmc->no_its = true;/* Stick with 1K pages for migration compatibility */
hw/core/machine.c +25 -0
@@ -168,6 +168,31 @@ GlobalProperty hw_compat_2_8[] = { };const size_t hw_compat_2_8_len =G_N_ELEMENTS (hw_compat_2_8); +GlobalProperty hw_compat_2_7[] = { + { + .driver ="virtio-pci" , + .property ="page-per-vq" , + .value ="on" , + },{ + .driver ="virtio-serial-device" , + .property ="emergency-write" , + .value ="off" , + },{ + .driver ="ioapic" , + .property ="version" , + .value ="0x11" , + },{ + .driver ="intel-iommu" , + .property ="x-buggy-eim" , + .value ="true" , + },{ + .driver ="virtio-pci" , + .property ="x-ignore-backend-features" , + .value ="on" , + }, +}; +const size_t hw_compat_2_7_len =G_N_ELEMENTS (hw_compat_2_7); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +34 -0
@@ -224,6 +224,40 @@ GlobalProperty pc_compat_2_8[] = { };const size_t pc_compat_2_8_len =G_N_ELEMENTS (pc_compat_2_8); +GlobalProperty pc_compat_2_7[] = { + { + .driver =TYPE_X86_CPU , + .property ="l3-cache" , + .value ="off" , + }, + { + .driver =TYPE_X86_CPU , + .property ="full-cpuid-auto-level" , + .value ="off" , + }, + { + .driver ="Opteron_G3" "-" TYPE_X86_CPU , + .property ="family" , + .value ="15" , + }, + { + .driver ="Opteron_G3" "-" TYPE_X86_CPU , + .property ="model" , + .value ="6" , + }, + { + .driver ="Opteron_G3" "-" TYPE_X86_CPU , + .property ="stepping" , + .value ="1" , + }, + { + .driver ="isa-pcspk" , + .property ="migrate" , + .value ="off" , + }, +}; +const size_t pc_compat_2_7_len =G_N_ELEMENTS (pc_compat_2_7); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -514,12 +514,9 @@ DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL,static void pc_i440fx_2_7_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_7 - }; -pc_i440fx_2_8_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_7, hw_compat_2_7_len); +compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", NULL,
hw/i386/pc_q35.c +2 -5
@@ -400,13 +400,10 @@ DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL,static void pc_q35_2_7_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_7 - }; -pc_q35_2_8_machine_options (m); m->max_cpus =255 ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_7, hw_compat_2_7_len); +compat_props_add (m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL,
hw/ppc/spapr.c +1 -1
@@ -4223,7 +4223,6 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_7 { .driver =TYPE_SPAPR_PCI_HOST_BRIDGE , .property ="mem_win_size" ,
@@ -4249,6 +4248,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc)spapr_machine_2_8_class_options (mc); mc->default_cpu_type =POWERPC_CPU_TYPE_NAME ("power7_v2.3" ); mc->default_machine_opts ="modern-hotplug-events=off" ; +compat_props_add (mc->compat_props, hw_compat_2_7, hw_compat_2_7_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); smc->phb_placement = phb_placement_2_7; }
hw/s390x/s390-virtio-ccw.c +1 -4
@@ -795,13 +795,10 @@ static void ccw_machine_2_7_instance_options(MachineState *machine)static void ccw_machine_2_7_class_options (MachineClass *mc) {S390CcwMachineClass *s390mc =S390_MACHINE_CLASS (mc); -static GlobalProperty compat[] = { -HW_COMPAT_2_7 - }; s390mc->cpu_model_allowed = false;ccw_machine_2_8_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_7, hw_compat_2_7_len); } DEFINE_CCW_MACHINE(2_7, "2.7", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 16/28] compat: replace PC_COMPAT_2_4 & HW_COMPAT_2_4 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 ++ include/hw/compat.h | 27 -------------- include/hw/i386/pc.h | 74 ++------------------------------------ hw/core/machine.c | 29 +++++++++++++++ hw/i386/pc.c | 71 ++++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 6 ++-- hw/i386/pc_q35.c | 6 ++-- hw/ppc/spapr.c | 5 +-- hw/s390x/s390-virtio-ccw.c | 2 +- 9 files changed, 112 insertions(+), 111 deletions(-)
include/hw/boards.h +3 -0
@@ -318,4 +318,7 @@ extern const size_t hw_compat_2_6_len;extern GlobalProperty hw_compat_2_5[];extern const size_t hw_compat_2_5_len; +extern GlobalProperty hw_compat_2_4[]; +extern const size_t hw_compat_2_4_len; +#endif
include/hw/compat.h +0 -27
@@ -1,33 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_4 \ - {\ - .driver = "virtio-blk-device",\ - .property = "scsi",\ - .value = "true",\ - },{\ - .driver = "e1000",\ - .property = "extra_mac_registers",\ - .value = "off",\ - },{\ - .driver = "virtio-pci",\ - .property = "x-disable-pcie",\ - .value = "on",\ - },{\ - .driver = "virtio-pci",\ - .property = "migrate-extra",\ - .value = "off",\ - },{\ - .driver = "fw_cfg_mem",\ - .property = "dma_enabled",\ - .value = "off",\ - },{\ - .driver = "fw_cfg_io",\ - .property = "dma_enabled",\ - .value = "off",\ - }, -#define HW_COMPAT_2_3 \ {\ .driver = "virtio-blk-pci",\
include/hw/i386/pc.h +3 -71
86 lines not on this page · raw message
hw/core/machine.c +29 -0
@@ -236,6 +236,35 @@ GlobalProperty hw_compat_2_5[] = { };const size_t hw_compat_2_5_len =G_N_ELEMENTS (hw_compat_2_5); +GlobalProperty hw_compat_2_4[] = { + { + .driver ="virtio-blk-device" , + .property ="scsi" , + .value ="true" , + },{ + .driver ="e1000" , + .property ="extra_mac_registers" , + .value ="off" , + },{ + .driver ="virtio-pci" , + .property ="x-disable-pcie" , + .value ="on" , + },{ + .driver ="virtio-pci" , + .property ="migrate-extra" , + .value ="off" , + },{ + .driver ="fw_cfg_mem" , + .property ="dma_enabled" , + .value ="off" , + },{ + .driver ="fw_cfg_io" , + .property ="dma_enabled" , + .value ="off" , + } +}; +const size_t hw_compat_2_4_len =G_N_ELEMENTS (hw_compat_2_4); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +71 -0
77 lines not on this page · raw message
hw/i386/pc_piix.c +2 -4
@@ -553,14 +553,12 @@ DEFINE_I440FX_MACHINE(v2_5, "pc-i440fx-2.5", NULL,static void pc_i440fx_2_4_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_4 - };pc_i440fx_2_5_machine_options (m); m->hw_version ="2.4.0" ; pcmc->broken_reserved_end = true; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_4, hw_compat_2_4_len); +compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL,
hw/i386/pc_q35.c +2 -4
@@ -440,14 +440,12 @@ DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL,static void pc_q35_2_4_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_4 - };pc_q35_2_5_machine_options (m); m->hw_version ="2.4.0" ; pcmc->broken_reserved_end = true; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_4, hw_compat_2_4_len); +compat_props_add (m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
hw/ppc/spapr.c +1 -4
@@ -4307,13 +4307,10 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false);static void spapr_machine_2_4_class_options (MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc); -static GlobalProperty compat[] = { -HW_COMPAT_2_4 - };spapr_machine_2_5_class_options (mc); smc->dr_lmb_enabled = false; -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_4, hw_compat_2_4_len); } DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -849,7 +849,6 @@ static void ccw_machine_2_4_instance_options(MachineState *machine)static void ccw_machine_2_4_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_4 { .driver =TYPE_S390_SKEYS , .property ="migration-enabled" ,
@@ -890,6 +889,7 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) };ccw_machine_2_5_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_4, hw_compat_2_4_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_CCW_MACHINE(2_4, "2.4", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 24/28] qdev-props: convert global_props to GPtrArray
In reply to Marc-André LureauA step towards being able to call a common function, object_apply_global_props().
--- hw/core/qdev-properties.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
hw/core/qdev-properties.c +20 -9
@@ -1173,22 +1173,32 @@ void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value) *ptr = value; } -static GList *global_props; +static GPtrArray *global_props (void ) +{ +static GPtrArray *gp; + +if (!gp) { + gp =g_ptr_array_new (); + } + +return gp; +}void qdev_prop_register_global (GlobalProperty *prop) { - global_props =g_list_append (global_props, prop); +g_ptr_array_add (global_props (), prop); }int qdev_prop_check_globals (void ) { -GList *l; -int ret =0 ; +int i, ret =0 ; -for (l = global_props; l; l = l->next) { -GlobalProperty *prop = l->data; +for (i =0 ; i <global_props ()->len; i++) { +GlobalProperty *prop;ObjectClass *oc;DeviceClass *dc; + + prop =g_ptr_array_index (global_props (), i);if (prop->used) {continue ; }
@@ -1213,12 +1223,13 @@ int qdev_prop_check_globals(void)void qdev_prop_set_globals (DeviceState *dev) { -GList *l; +int i; -for (l = global_props; l; l = l->next) { -GlobalProperty *prop = l->data; +for (i =0 ; i <global_props ()->len; i++) { +GlobalProperty *prop;Error *err =NULL ; + prop =g_ptr_array_index (global_props (), i);if (object_dynamic_cast (OBJECT (dev), prop->driver) ==NULL ) {continue ; }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 19/28] compat: replace PC_COMPAT_2_1 & HW_COMPAT_2_1 macros
In reply to Marc-André LureauUse static arrays instead. I decided to rename the conflicting pc_compat_2_1() function with pc_compat_2_1_fn().
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 31 ------------------------------- include/hw/i386/pc.h | 17 +++-------------- hw/core/machine.c | 33 +++++++++++++++++++++++++++++++++ hw/i386/pc.c | 15 +++++++++++++++ hw/i386/pc_piix.c | 12 +++++------- hw/ppc/spapr.c | 6 +----- 7 files changed, 60 insertions(+), 57 deletions(-)
include/hw/boards.h +3 -0
@@ -327,4 +327,7 @@ extern const size_t hw_compat_2_3_len;extern GlobalProperty hw_compat_2_2[];extern const size_t hw_compat_2_2_len; +extern GlobalProperty hw_compat_2_1[]; +extern const size_t hw_compat_2_1_len; +#endif
include/hw/compat.h +0 -31
@@ -1,35 +1,4 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_1 \ - {\ - .driver = "intel-hda",\ - .property = "old_msi_addr",\ - .value = "on",\ - },{\ - .driver = "VGA",\ - .property = "qemu-extended-regs",\ - .value = "off",\ - },{\ - .driver = "secondary-vga",\ - .property = "qemu-extended-regs",\ - .value = "off",\ - },{\ - .driver = "virtio-scsi-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "usb-mouse",\ - .property = "usb_version",\ - .value = stringify(1),\ - },{\ - .driver = "usb-kbd",\ - .property = "usb_version",\ - .value = stringify(1),\ - },{\ - .driver = "virtio-pci",\ - .property = "virtio-pci-bus-master-bug-migration",\ - .value = "on",\ - }, -#endif /* HW_COMPAT_H */
include/hw/i386/pc.h +3 -14
@@ -333,6 +333,9 @@ extern const size_t pc_compat_2_3_len;extern GlobalProperty pc_compat_2_2[];extern const size_t pc_compat_2_2_len; +extern GlobalProperty pc_compat_2_1[]; +extern const size_t pc_compat_2_1_len; +/* Helper for setting model-id for CPU models that changed model-id * depending on QEMU versions up to QEMU 2.4. */
@@ -353,20 +356,6 @@ extern const size_t pc_compat_2_2_len; .value = "QEMU Virtual CPU version " v,\ }, -#define PC_COMPAT_2_1 \ - HW_COMPAT_2_1 \ - PC_CPU_MODEL_IDS("2.1.0") \ - {\ - .driver = "coreduo" "-" TYPE_X86_CPU,\ - .property = "vmx",\ - .value = "on",\ - },\ - {\ - .driver = "core2duo" "-" TYPE_X86_CPU,\ - .property = "vmx",\ - .value = "on",\ - }, -#define PC_COMPAT_2_0 \ PC_CPU_MODEL_IDS("2.0.0") \ {\
hw/core/machine.c +33 -0
@@ -309,6 +309,39 @@ const size_t hw_compat_2_3_len = G_N_ELEMENTS(hw_compat_2_3);GlobalProperty hw_compat_2_2[] = {};const size_t hw_compat_2_2_len =G_N_ELEMENTS (hw_compat_2_2); +GlobalProperty hw_compat_2_1[] = { + { + .driver ="intel-hda" , + .property ="old_msi_addr" , + .value ="on" , + },{ + .driver ="VGA" , + .property ="qemu-extended-regs" , + .value ="off" , + },{ + .driver ="secondary-vga" , + .property ="qemu-extended-regs" , + .value ="off" , + },{ + .driver ="virtio-scsi-pci" , + .property ="any_layout" , + .value ="off" , + },{ + .driver ="usb-mouse" , + .property ="usb_version" , + .value =stringify (1 ), + },{ + .driver ="usb-kbd" , + .property ="usb_version" , + .value =stringify (1 ), + },{ + .driver ="virtio-pci" , + .property ="virtio-pci-bus-master-bug-migration" , + .value ="on" , + }, +}; +const size_t hw_compat_2_1_len =G_N_ELEMENTS (hw_compat_2_1); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +15 -0
@@ -536,6 +536,21 @@ GlobalProperty pc_compat_2_2[] = { };const size_t pc_compat_2_2_len =G_N_ELEMENTS (pc_compat_2_2); +GlobalProperty pc_compat_2_1[] = { + PC_CPU_MODEL_IDS("2.1.0") + { + .driver ="coreduo" "-" TYPE_X86_CPU , + .property ="vmx" , + .value ="on" , + }, + { + .driver ="core2duo" "-" TYPE_X86_CPU , + .property ="vmx" , + .value ="on" , + }, +}; +const size_t pc_compat_2_1_len =G_N_ELEMENTS (pc_compat_2_1); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +5 -7
@@ -323,7 +323,7 @@ static void pc_compat_2_2_fn(MachineState *machine)pc_compat_2_3_fn (machine); } -static void pc_compat_2_1 (MachineState *machine) +static void pc_compat_2_1_fn (MachineState *machine) {pc_compat_2_2_fn (machine);x86_cpu_change_kvm_default ("svm" ,NULL );
@@ -331,7 +331,7 @@ static void pc_compat_2_1(MachineState *machine)static void pc_compat_2_0 (MachineState *machine) { -pc_compat_2_1 (machine); +pc_compat_2_1_fn (machine); }static void pc_compat_1_7 (MachineState *machine)
@@ -593,19 +593,17 @@ DEFINE_I440FX_MACHINE(v2_2, "pc-i440fx-2.2", pc_compat_2_2_fn,static void pc_i440fx_2_1_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_1 - };pc_i440fx_2_2_machine_options (m); m->hw_version ="2.1.0" ; m->default_display =NULL ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_1, hw_compat_2_1_len); +compat_props_add (m->compat_props, pc_compat_2_1, pc_compat_2_1_len); pcmc->smbios_uuid_encoded = false; pcmc->enforce_aligned_dimm = false; } -DEFINE_I440FX_MACHINE (v2_1,"pc-i440fx-2.1" , pc_compat_2_1, +DEFINE_I440FX_MACHINE (v2_1,"pc-i440fx-2.1" , pc_compat_2_1_fn, pc_i440fx_2_1_machine_options);static void pc_i440fx_2_0_machine_options (MachineClass *m)
hw/ppc/spapr.c +1 -5
@@ -4361,12 +4361,8 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false);static void spapr_machine_2_1_class_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_2_1 - }; -spapr_machine_2_2_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_1, hw_compat_2_1_len); } DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 07/28] compat: replace PC_COMPAT_3_0 & HW_COMPAT_3_0 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 3 --- include/hw/i386/pc.h | 17 ++--------------- hw/arm/virt.c | 6 +----- hw/core/machine.c | 3 +++ hw/i386/pc.c | 17 +++++++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 5 +---- hw/s390x/s390-virtio-ccw.c | 5 +---- 10 files changed, 32 insertions(+), 41 deletions(-)
include/hw/boards.h +3 -0
@@ -291,4 +291,7 @@ struct MachineState {extern GlobalProperty hw_compat_3_1[];extern const size_t hw_compat_3_1_len; +extern GlobalProperty hw_compat_3_0[]; +extern const size_t hw_compat_3_0_len; +#endif
include/hw/compat.h +0 -3
@@ -1,9 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_3_0 \ -/* empty */ -#define HW_COMPAT_2_12 \ {\ .driver = "migration",\
include/hw/i386/pc.h +2 -15
@@ -297,21 +297,8 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);extern GlobalProperty pc_compat_3_1[];extern const size_t pc_compat_3_1_len; -#define PC_COMPAT_3_0 \ - HW_COMPAT_3_0 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "x-hv-synic-kvm-only",\ - .value = "on",\ - },{\ - .driver = "Skylake-Server" "-" TYPE_X86_CPU,\ - .property = "pku",\ - .value = "off",\ - },{\ - .driver = "Skylake-Server-IBRS" "-" TYPE_X86_CPU,\ - .property = "pku",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_3_0[]; +extern const size_t pc_compat_3_0_len;#define PC_COMPAT_2_12 \ HW_COMPAT_2_12 \
hw/arm/virt.c +1 -5
@@ -1881,12 +1881,8 @@ DEFINE_VIRT_MACHINE(3, 1)static void virt_machine_3_0_options (MachineClass *mc) { -static GlobalProperty compat[] = { -HW_COMPAT_3_0 - }; -virt_machine_3_1_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_0, hw_compat_3_0_len); }DEFINE_VIRT_MACHINE (3 ,0 )
hw/core/machine.c +3 -0
@@ -35,6 +35,9 @@ GlobalProperty hw_compat_3_1[] = { };const size_t hw_compat_3_1_len =G_N_ELEMENTS (hw_compat_3_1); +GlobalProperty hw_compat_3_0[] = {}; +const size_t hw_compat_3_0_len =G_N_ELEMENTS (hw_compat_3_0); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +17 -0
@@ -118,6 +118,23 @@ GlobalProperty pc_compat_3_1[] = { };const size_t pc_compat_3_1_len =G_N_ELEMENTS (pc_compat_3_1); +GlobalProperty pc_compat_3_0[] = { + { + .driver =TYPE_X86_CPU , + .property ="x-hv-synic-kvm-only" , + .value ="on" , + },{ + .driver ="Skylake-Server" "-" TYPE_X86_CPU , + .property ="pku" , + .value ="off" , + },{ + .driver ="Skylake-Server-IBRS" "-" TYPE_X86_CPU , + .property ="pku" , + .value ="off" , + }, +}; +const size_t pc_compat_3_0_len =G_N_ELEMENTS (pc_compat_3_0); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -452,12 +452,9 @@ DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,static void pc_i440fx_3_0_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_3_0 - }; -pc_i440fx_3_1_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_3_0, hw_compat_3_0_len); +compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL,
hw/i386/pc_q35.c +2 -5
@@ -335,12 +335,9 @@ DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL,static void pc_q35_3_0_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_3_0 - }; -pc_q35_3_1_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_3_0, hw_compat_3_0_len); +compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL,
hw/ppc/spapr.c +1 -4
@@ -4037,12 +4037,9 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", false);static void spapr_machine_3_0_class_options (MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc); -static GlobalProperty compat[] = { -HW_COMPAT_3_0 - };spapr_machine_3_1_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_0, hw_compat_3_0_len); smc->legacy_irq_allocation = true; smc->irq = &spapr_irq_xics_legacy;
hw/s390x/s390-virtio-ccw.c +1 -4
@@ -680,13 +680,10 @@ static void ccw_machine_3_0_instance_options(MachineState *machine)static void ccw_machine_3_0_class_options (MachineClass *mc) {S390CcwMachineClass *s390mc =S390_MACHINE_CLASS (mc); -static GlobalProperty compat[] = { -HW_COMPAT_3_0 - }; s390mc->hpage_1m_allowed = false;ccw_machine_3_1_class_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_3_0, hw_compat_3_0_len); } DEFINE_CCW_MACHINE(3_0, "3.0", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 05/28] hw: remove SET_MACHINE_COMPAT
In reply to Marc-André LureauNo longer needed.
--- include/hw/boards.h | 12 ------------ 1 file changed, 12 deletions(-)
include/hw/boards.h +0 -12
@@ -288,16 +288,4 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) -#define SET_MACHINE_COMPAT (m, compat) \ - do { \ - int i; \ - if (!m->compat_props) { \ - m->compat_props = g_array_new(false, false, sizeof(void *)); \ - } \ - for (i = 0; i < G_N_ELEMENTS(compat); i++) { \ - GlobalProperty *prop = &compat[i]; \ - g_array_append_val(m->compat_props, prop); \ - } \ - } while (0) -#endif
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 09/28] compat: replace PC_COMPAT_2_11 & HW_COMPAT_2_11 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 19 ------------------- include/hw/i386/pc.h | 13 ++----------- hw/arm/virt.c | 5 +---- hw/core/machine.c | 21 +++++++++++++++++++++ hw/i386/pc.c | 13 +++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 5 +---- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 46 insertions(+), 49 deletions(-)
include/hw/boards.h +3 -0
@@ -297,4 +297,7 @@ extern const size_t hw_compat_3_0_len;extern GlobalProperty hw_compat_2_12[];extern const size_t hw_compat_2_12_len; +extern GlobalProperty hw_compat_2_11[]; +extern const size_t hw_compat_2_11_len; +#endif
include/hw/compat.h +0 -19
@@ -1,25 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_11 \ - {\ - .driver = "hpet",\ - .property = "hpet-offset-saved",\ - .value = "false",\ - },{\ - .driver = "virtio-blk-pci",\ - .property = "vectors",\ - .value = "2",\ - },{\ - .driver = "vhost-user-blk-pci",\ - .property = "vectors",\ - .value = "2",\ - },{\ - .driver = "e1000",\ - .property = "migrate_tso_props",\ - .value = "off",\ - }, -#define HW_COMPAT_2_10 \ {\ .driver = "virtio-mouse-device",\
include/hw/i386/pc.h +2 -11
@@ -303,17 +303,8 @@ extern const size_t pc_compat_3_0_len;extern GlobalProperty pc_compat_2_12[];extern const size_t pc_compat_2_12_len; -#define PC_COMPAT_2_11 \ - HW_COMPAT_2_11 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "x-migrate-smi-count",\ - .value = "off",\ - },{\ - .driver = "Skylake-Server" "-" TYPE_X86_CPU,\ - .property = "clflushopt",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_2_11[]; +extern const size_t pc_compat_2_11_len;#define PC_COMPAT_2_10 \ HW_COMPAT_2_10 \
hw/arm/virt.c +1 -4
@@ -1900,12 +1900,9 @@ DEFINE_VIRT_MACHINE(2, 12)static void virt_machine_2_11_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); -static GlobalProperty compat[] = { -HW_COMPAT_2_11 - };virt_machine_2_12_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_11, hw_compat_2_11_len); vmc->smbios_old_sys_ver = true; }DEFINE_VIRT_MACHINE (2 ,11 )
hw/core/machine.c +21 -0
@@ -67,6 +67,27 @@ GlobalProperty hw_compat_2_12[] = { };const size_t hw_compat_2_12_len =G_N_ELEMENTS (hw_compat_2_12); +GlobalProperty hw_compat_2_11[] = { + { + .driver ="hpet" , + .property ="hpet-offset-saved" , + .value ="false" , + },{ + .driver ="virtio-blk-pci" , + .property ="vectors" , + .value ="2" , + },{ + .driver ="vhost-user-blk-pci" , + .property ="vectors" , + .value ="2" , + },{ + .driver ="e1000" , + .property ="migrate_tso_props" , + .value ="off" , + }, +}; +const size_t hw_compat_2_11_len =G_N_ELEMENTS (hw_compat_2_11); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +13 -0
@@ -156,6 +156,19 @@ GlobalProperty pc_compat_2_12[] = { };const size_t pc_compat_2_12_len =G_N_ELEMENTS (pc_compat_2_12); +GlobalProperty pc_compat_2_11[] = { + { + .driver =TYPE_X86_CPU , + .property ="x-migrate-smi-count" , + .value ="off" , + },{ + .driver ="Skylake-Server" "-" TYPE_X86_CPU , + .property ="clflushopt" , + .value ="off" , + }, +}; +const size_t pc_compat_2_11_len =G_N_ELEMENTS (pc_compat_2_11); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -5
@@ -472,12 +472,9 @@ DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL,static void pc_i440fx_2_11_machine_options (MachineClass *m) { -static GlobalProperty compat[] = { -PC_COMPAT_2_11 - }; -pc_i440fx_2_12_machine_options (m); -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_11, hw_compat_2_11_len); +compat_props_add (m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL,
hw/i386/pc_q35.c +2 -5
@@ -356,14 +356,11 @@ DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL,static void pc_q35_2_11_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_11 - }; -pc_q35_2_12_machine_options (m); pcmc->default_nic_model ="e1000" ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_11, hw_compat_2_11_len); +compat_props_add (m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL,
hw/ppc/spapr.c +1 -4
@@ -4099,13 +4099,10 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false);static void spapr_machine_2_11_class_options (MachineClass *mc) {sPAPRMachineClass *smc =SPAPR_MACHINE_CLASS (mc); -static GlobalProperty compat[] = { -HW_COMPAT_2_11 - };spapr_machine_2_12_class_options (mc); smc->default_caps.caps[SPAPR_CAP_HTM ] =SPAPR_CAP_ON ; -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_11, hw_compat_2_11_len); } DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -713,7 +713,6 @@ static void ccw_machine_2_11_instance_options(MachineState *machine)static void ccw_machine_2_11_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_11 { .driver =TYPE_SCLP_EVENT_FACILITY , .property ="allow_all_mask_sizes" ,
@@ -722,6 +721,7 @@ static void ccw_machine_2_11_class_options(MachineClass *mc) };ccw_machine_2_12_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_11, hw_compat_2_11_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_CCW_MACHINE(2_11, "2.11", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 18/28] compat: replace PC_COMPAT_2_2 & HW_COMPAT_2_2 macros
In reply to Marc-André LureauUse static arrays instead. I decided to rename the conflicting pc_compat_2_2() function with pc_compat_2_2_fn().
--- include/hw/boards.h | 3 ++ include/hw/compat.h | 3 -- include/hw/i386/pc.h | 97 ++------------------------------------------ hw/core/machine.c | 3 ++ hw/i386/pc.c | 95 +++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 12 +++--- hw/ppc/spapr.c | 2 +- 7 files changed, 110 insertions(+), 105 deletions(-)
include/hw/boards.h +3 -0
@@ -324,4 +324,7 @@ extern const size_t hw_compat_2_4_len;extern GlobalProperty hw_compat_2_3[];extern const size_t hw_compat_2_3_len; +extern GlobalProperty hw_compat_2_2[]; +extern const size_t hw_compat_2_2_len; +#endif
include/hw/compat.h +0 -3
@@ -1,9 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_2 \ -/* empty */ -#define HW_COMPAT_2_1 \ {\ .driver = "intel-hda",\
include/hw/i386/pc.h +3 -94
109 lines not on this page · raw message
hw/core/machine.c +3 -0
@@ -306,6 +306,9 @@ GlobalProperty hw_compat_2_3[] = { };const size_t hw_compat_2_3_len =G_N_ELEMENTS (hw_compat_2_3); +GlobalProperty hw_compat_2_2[] = {}; +const size_t hw_compat_2_2_len =G_N_ELEMENTS (hw_compat_2_2); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +95 -0
101 lines not on this page · raw message
hw/i386/pc_piix.c +5 -7
@@ -318,14 +318,14 @@ static void pc_compat_2_3_fn(MachineState *machine) } } -static void pc_compat_2_2 (MachineState *machine) +static void pc_compat_2_2_fn (MachineState *machine) {pc_compat_2_3_fn (machine); }static void pc_compat_2_1 (MachineState *machine) { -pc_compat_2_2 (machine); +pc_compat_2_2_fn (machine);x86_cpu_change_kvm_default ("svm" ,NULL ); }
@@ -578,18 +578,16 @@ DEFINE_I440FX_MACHINE(v2_3, "pc-i440fx-2.3", pc_compat_2_3_fn,static void pc_i440fx_2_2_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_2 - };pc_i440fx_2_3_machine_options (m); m->hw_version ="2.2.0" ; m->default_machine_opts ="firmware=bios-256k.bin,suppress-vmdesc=on" ; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_2, hw_compat_2_2_len); +compat_props_add (m->compat_props, pc_compat_2_2, pc_compat_2_2_len); pcmc->rsdp_in_ram = false; } -DEFINE_I440FX_MACHINE (v2_2,"pc-i440fx-2.2" , pc_compat_2_2, +DEFINE_I440FX_MACHINE (v2_2,"pc-i440fx-2.2" , pc_compat_2_2_fn, pc_i440fx_2_2_machine_options);static void pc_i440fx_2_1_machine_options (MachineClass *m)
hw/ppc/spapr.c +1 -1
@@ -4341,7 +4341,6 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false);static void spapr_machine_2_2_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_2 { .driver =TYPE_SPAPR_PCI_HOST_BRIDGE , .property ="mem_win_size" ,
@@ -4350,6 +4349,7 @@ static void spapr_machine_2_2_class_options(MachineClass *mc) };spapr_machine_2_3_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_2, hw_compat_2_2_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); mc->default_machine_opts ="modern-hotplug-events=off,suppress-vmdesc=on" ; }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 21/28] compat: remove remaining PC_COMPAT macros
In reply to Marc-André LureauUse static arrays instead. I decided to rename the conflicting pc_compat_2_1() function with pc_compat_2_1_fn().
--- include/hw/i386/pc.h | 236 +++---------------------------------------- hw/i386/pc.c | 232 ++++++++++++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 57 ++++------- 3 files changed, 267 insertions(+), 258 deletions(-)
include/hw/i386/pc.h +15 -221
@@ -335,6 +335,21 @@ extern const size_t pc_compat_2_2_len;extern GlobalProperty pc_compat_2_1[];extern const size_t pc_compat_2_1_len; +extern GlobalProperty pc_compat_2_0[]; +extern const size_t pc_compat_2_0_len; + +extern GlobalProperty pc_compat_1_7[]; +extern const size_t pc_compat_1_7_len; + +extern GlobalProperty pc_compat_1_6[]; +extern const size_t pc_compat_1_6_len; + +extern GlobalProperty pc_compat_1_5[]; +extern const size_t pc_compat_1_5_len; + +extern GlobalProperty pc_compat_1_4[]; +extern const size_t pc_compat_1_4_len; +/* Helper for setting model-id for CPU models that changed model-id * depending on QEMU versions up to QEMU 2.4. */
@@ -355,227 +370,6 @@ extern const size_t pc_compat_2_1_len; .value = "QEMU Virtual CPU version " v,\ }, -#define PC_COMPAT_2_0 \ - PC_CPU_MODEL_IDS("2.0.0") \ - {\ - .driver = "virtio-scsi-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = "PIIX4_PM",\ - .property = "memory-hotplug-support",\ - .value = "off",\ - },\ - {\ - .driver = "apic",\ - .property = "version",\ - .value = stringify(0x11),\ - },\ - {\ - .driver = "nec-usb-xhci",\ - .property = "superspeed-ports-first",\ - .value = "off",\ - },\ - {\ - .driver = "nec-usb-xhci",\ - .property = "force-pcie-endcap",\ - .value = "on",\ - },\ - {\ - .driver = "pci-serial",\ - .property = "prog_if",\ - .value = stringify(0),\ - },\ - {\ - .driver = "pci-serial-2x",\ - .property = "prog_if",\ - .value = stringify(0),\ - },\ - {\ - .driver = "pci-serial-4x",\ - .property = "prog_if",\ - .value = stringify(0),\ - },\ - {\ - .driver = "virtio-net-pci",\ - .property = "guest_announce",\ - .value = "off",\ - },\ - {\ - .driver = "ICH9-LPC",\ - .property = "memory-hotplug-support",\ - .value = "off",\ - },{\ - .driver = "xio3130-downstream",\ - .property = COMPAT_PROP_PCP,\ - .value = "off",\ - },{\ - .driver = "ioh3420",\ - .property = COMPAT_PROP_PCP,\ - .value = "off",\ - }, - -#define PC_COMPAT_1_7 \ - PC_CPU_MODEL_IDS("1.7.0") \ - {\ - .driver = TYPE_USB_DEVICE,\ - .property = "msos-desc",\ - .value = "no",\ - },\ - {\ - .driver = "PIIX4_PM",\ - .property = "acpi-pci-hotplug-with-bridge-support",\ - .value = "off",\ - },\ - {\ - .driver = "hpet",\ - .property = HPET_INTCAP,\ - .value = stringify(4),\ - }, - -#define PC_COMPAT_1_6 \ - PC_CPU_MODEL_IDS("1.6.0") \ - {\ - .driver = "e1000",\ - .property = "mitigation",\ - .value = "off",\ - },{\ - .driver = "qemu64-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(2),\ - },{\ - .driver = "qemu32-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(3),\ - },{\ - .driver = "i440FX-pcihost",\ - .property = "short_root_bus",\ - .value = stringify(1),\ - },{\ - .driver = "q35-pcihost",\ - .property = "short_root_bus",\ - .value = stringify(1),\ - }, - -#define PC_COMPAT_1_5 \ - PC_CPU_MODEL_IDS("1.5.0") \ - {\ - .driver = "Conroe-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(2),\ - },{\ - .driver = "Conroe-" TYPE_X86_CPU,\ - .property = "min-level",\ - .value = stringify(2),\ - },{\ - .driver = "Penryn-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(2),\ - },{\ - .driver = "Penryn-" TYPE_X86_CPU,\ - .property = "min-level",\ - .value = stringify(2),\ - },{\ - .driver = "Nehalem-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(2),\ - },{\ - .driver = "Nehalem-" TYPE_X86_CPU,\ - .property = "min-level",\ - .value = stringify(2),\ - },{\ - .driver = "virtio-net-pci",\ - .property = "any_layout",\ - .value = "off",\ - },{\ - .driver = TYPE_X86_CPU,\ - .property = "pmu",\ - .value = "on",\ - },{\ - .driver = "i440FX-pcihost",\ - .property = "short_root_bus",\ - .value = stringify(0),\ - },{\ - .driver = "q35-pcihost",\ - .property = "short_root_bus",\ - .value = stringify(0),\ - }, - -#define PC_COMPAT_1_4 \ - PC_CPU_MODEL_IDS("1.4.0") \ - {\ - .driver = "scsi-hd",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "scsi-cd",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "scsi-disk",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "ide-hd",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "ide-cd",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "ide-drive",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "virtio-blk-pci",\ - .property = "discard_granularity",\ - .value = stringify(0),\ - },{\ - .driver = "virtio-serial-pci",\ - .property = "vectors",\ - /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\ - .value = stringify(0xFFFFFFFF),\ - },{ \ - .driver = "virtio-net-pci", \ - .property = "ctrl_guest_offloads", \ - .value = "off", \ - },{\ - .driver = "e1000",\ - .property = "romfile",\ - .value = "pxe-e1000.rom",\ - },{\ - .driver = "ne2k_pci",\ - .property = "romfile",\ - .value = "pxe-ne2k_pci.rom",\ - },{\ - .driver = "pcnet",\ - .property = "romfile",\ - .value = "pxe-pcnet.rom",\ - },{\ - .driver = "rtl8139",\ - .property = "romfile",\ - .value = "pxe-rtl8139.rom",\ - },{\ - .driver = "virtio-net-pci",\ - .property = "romfile",\ - .value = "pxe-virtio.rom",\ - },{\ - .driver = "486-" TYPE_X86_CPU,\ - .property = "model",\ - .value = stringify(0),\ - },\ - {\ - .driver = "n270" "-" TYPE_X86_CPU,\ - .property = "movbe",\ - .value = "off",\ - },\ - {\ - .driver = "Westmere" "-" TYPE_X86_CPU,\ - .property = "pclmulqdq",\ - .value = "off",\ - }, -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \
hw/i386/pc.c +232 -0
244 lines not on this page · raw message
hw/i386/pc_piix.c +20 -37
141 lines not on this page · raw message
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 20/28] include: remove compat.h
In reply to Marc-André LureauThe header is now empty.
--- include/hw/compat.h | 4 ---- include/hw/i386/pc.h | 1 - hw/arm/virt.c | 1 - hw/ppc/spapr.c | 1 - hw/s390x/s390-virtio-ccw.c | 1 - 5 files changed, 8 deletions(-) delete mode 100644 include/hw/compat.h
include/hw/compat.h deleted +0 -4
@@ -1,4 +0,0 @@ -#ifndef HW_COMPAT_H -#define HW_COMPAT_H - -#endif /* HW_COMPAT_H */
include/hw/i386/pc.h +0 -1
@@ -13,7 +13,6 @@#include "qemu/bitmap.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" -#include "hw/compat.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" #include "hw/acpi/acpi_dev_interface.h"
hw/arm/virt.c +0 -1
@@ -43,7 +43,6 @@#include "sysemu/numa.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" -#include "hw/compat.h" #include "hw/loader.h" #include "exec/address-spaces.h" #include "qemu/bitops.h"
hw/ppc/spapr.c +0 -1
@@ -70,7 +70,6 @@#include "hw/nmi.h" #include "hw/intc/intc.h" -#include "hw/compat.h" #include "qemu/cutils.h" #include "hw/ppc/spapr_cpu_core.h" #include "hw/mem/memory-device.h"
hw/s390x/s390-virtio-ccw.c +0 -1
@@ -28,7 +28,6 @@#include "hw/s390x/storage-keys.h" #include "hw/s390x/storage-attributes.h" #include "hw/s390x/event-facility.h" -#include "hw/compat.h" #include "ipl.h" #include "hw/s390x/s390-virtio-ccw.h" #include "hw/s390x/css-bridge.h"
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 14/28] compat: replace PC_COMPAT_2_6 & HW_COMPAT_2_6 macros
In reply to Marc-André LureauUse static arrays instead.
--- include/hw/boards.h | 3 +++ include/hw/compat.h | 15 --------------- include/hw/i386/pc.h | 23 ++--------------------- hw/arm/virt.c | 5 +---- hw/core/machine.c | 17 +++++++++++++++++ hw/i386/pc.c | 23 +++++++++++++++++++++++ hw/i386/pc_piix.c | 6 ++---- hw/i386/pc_q35.c | 6 ++---- hw/ppc/spapr.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- 10 files changed, 52 insertions(+), 50 deletions(-)
include/hw/boards.h +3 -0
@@ -312,4 +312,7 @@ extern const size_t hw_compat_2_8_len;extern GlobalProperty hw_compat_2_7[];extern const size_t hw_compat_2_7_len; +extern GlobalProperty hw_compat_2_6[]; +extern const size_t hw_compat_2_6_len; +#endif
include/hw/compat.h +0 -15
@@ -1,21 +1,6 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_6 \ - {\ - .driver = "virtio-mmio",\ - .property = "format_transport_address",\ - .value = "off",\ - },{\ - .driver = "virtio-pci",\ - .property = "disable-modern",\ - .value = "on",\ - },{\ - .driver = "virtio-pci",\ - .property = "disable-legacy",\ - .value = "off",\ - }, -#define HW_COMPAT_2_5 \ {\ .driver = "isa-fdc",\
include/hw/i386/pc.h +2 -21
@@ -318,27 +318,8 @@ extern const size_t pc_compat_2_8_len;extern GlobalProperty pc_compat_2_7[];extern const size_t pc_compat_2_7_len; -#define PC_COMPAT_2_6 \ - HW_COMPAT_2_6 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "cpuid-0xb",\ - .value = "off",\ - },{\ - .driver = "vmxnet3",\ - .property = "romfile",\ - .value = "",\ - },\ - {\ - .driver = TYPE_X86_CPU,\ - .property = "fill-mtrr-mask",\ - .value = "off",\ - },\ - {\ - .driver = "apic-common",\ - .property = "legacy-instance-id",\ - .value = "on",\ - }, +extern GlobalProperty pc_compat_2_6[]; +extern const size_t pc_compat_2_6_len;#define PC_COMPAT_2_5 \ HW_COMPAT_2_5
hw/arm/virt.c +1 -4
@@ -1952,12 +1952,9 @@ DEFINE_VIRT_MACHINE(2, 7)static void virt_machine_2_6_options (MachineClass *mc) {VirtMachineClass *vmc =VIRT_MACHINE_CLASS (OBJECT_CLASS (mc)); -static GlobalProperty compat[] = { -HW_COMPAT_2_6 - };virt_machine_2_7_options (mc); -compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (mc->compat_props, hw_compat_2_6, hw_compat_2_6_len); vmc->disallow_affinity_adjustment = true;/* Disable PMU for 2.6 as PMU support was first introduced in 2.7 */ vmc->no_pmu = true;
hw/core/machine.c +17 -0
@@ -193,6 +193,23 @@ GlobalProperty hw_compat_2_7[] = { };const size_t hw_compat_2_7_len =G_N_ELEMENTS (hw_compat_2_7); +GlobalProperty hw_compat_2_6[] = { + { + .driver ="virtio-mmio" , + .property ="format_transport_address" , + .value ="off" , + },{ + .driver ="virtio-pci" , + .property ="disable-modern" , + .value ="on" , + },{ + .driver ="virtio-pci" , + .property ="disable-legacy" , + .value ="off" , + }, +}; +const size_t hw_compat_2_6_len =G_N_ELEMENTS (hw_compat_2_6); +static char *machine_get_accel (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
hw/i386/pc.c +23 -0
@@ -258,6 +258,29 @@ GlobalProperty pc_compat_2_7[] = { };const size_t pc_compat_2_7_len =G_N_ELEMENTS (pc_compat_2_7); +GlobalProperty pc_compat_2_6[] = { + { + .driver =TYPE_X86_CPU , + .property ="cpuid-0xb" , + .value ="off" , + },{ + .driver ="vmxnet3" , + .property ="romfile" , + .value ="" , + }, + { + .driver =TYPE_X86_CPU , + .property ="fill-mtrr-mask" , + .value ="off" , + }, + { + .driver ="apic-common" , + .property ="legacy-instance-id" , + .value ="on" , + } +}; +const size_t pc_compat_2_6_len =G_N_ELEMENTS (pc_compat_2_6); +void gsi_handler (void *opaque,int n,int level) {GSIState *s = opaque;
hw/i386/pc_piix.c +2 -4
@@ -525,14 +525,12 @@ DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", NULL,static void pc_i440fx_2_6_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_6 - };pc_i440fx_2_7_machine_options (m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_6, hw_compat_2_6_len); +compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", NULL,
hw/i386/pc_q35.c +2 -4
@@ -412,14 +412,12 @@ DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL,static void pc_q35_2_6_machine_options (MachineClass *m) {PCMachineClass *pcmc =PC_MACHINE_CLASS (m); -static GlobalProperty compat[] = { -PC_COMPAT_2_6 - };pc_q35_2_7_machine_options (m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; -compat_props_add (m->compat_props, compat,G_N_ELEMENTS (compat)); +compat_props_add (m->compat_props, hw_compat_2_6, hw_compat_2_6_len); +compat_props_add (m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL,
hw/ppc/spapr.c +1 -1
@@ -4262,7 +4262,6 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false);static void spapr_machine_2_6_class_options (MachineClass *mc) {static GlobalProperty compat[] = { -HW_COMPAT_2_6 { .driver =TYPE_SPAPR_PCI_HOST_BRIDGE , .property ="ddw" ,
@@ -4272,6 +4271,7 @@ static void spapr_machine_2_6_class_options(MachineClass *mc)spapr_machine_2_7_class_options (mc); mc->has_hotpluggable_cpus = false; +compat_props_add (mc->compat_props, hw_compat_2_6, hw_compat_2_6_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); }
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -811,7 +811,6 @@ static void ccw_machine_2_6_class_options(MachineClass *mc) {S390CcwMachineClass *s390mc =S390_MACHINE_CLASS (mc);static GlobalProperty compat[] = { -HW_COMPAT_2_6 { .driver =TYPE_S390_IPL , .property ="iplbext_migration" ,
@@ -825,6 +824,7 @@ static void ccw_machine_2_6_class_options(MachineClass *mc) s390mc->ri_allowed = false;ccw_machine_2_7_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_2_6, hw_compat_2_6_len);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat)); } DEFINE_CCW_MACHINE(2_6, "2.6", false);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 26/28] qdev-props: call object_apply_global_props()
In reply to Marc-André LureauIt's now possible to use the common function.
Teach object_apply_global_props() to warn if Error argument is NULL.
--- hw/core/qdev-properties.c | 24 ++---------------------- qom/object.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 23 deletions(-)
hw/core/qdev-properties.c +2 -22
@@ -1223,28 +1223,8 @@ int qdev_prop_check_globals(void)void qdev_prop_set_globals (DeviceState *dev) { -int i; - -for (i =0 ; i <global_props ()->len; i++) { -GlobalProperty *prop; -Error *err =NULL ; - - prop =g_ptr_array_index (global_props (), i); -if (object_dynamic_cast (OBJECT (dev), prop->driver) ==NULL ) { -continue ; - } - prop->used = true; -object_property_parse (OBJECT (dev), prop->value, prop->property, &err); -if (err !=NULL ) { -error_prepend (&err,"can't apply global %s.%s=%s: " , - prop->driver, prop->property, prop->value); -if (!dev->hotplugged) { -error_propagate (&error_fatal, err); - }else { -warn_report_err (err); - } - } - } +object_apply_global_props (OBJECT (dev),global_props (), + dev->hotplugged ?NULL : &error_fatal); }/* --- 64bit unsigned int 'size' type --- */
qom/object.c +11 -1
@@ -390,7 +390,17 @@ void object_apply_global_props(Object *obj, const GPtrArray *props, Error **errpif (err !=NULL ) {error_prepend (&err,"can't apply global %s.%s=%s: " , p->driver, p->property, p->value); -error_propagate (errp, err); +/* +* If errp != NULL, propagate error and return. +* If errp == NULL, report a warning, but keep going +* with the remaining globals. +*/ +if (errp) { +error_propagate (errp, err); +return ; + }else { +warn_report_err (err); + } } } }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 22/28] qdev: make a separate helper function to apply compat properties
In reply to Marc-André LureauThis will allow to apply compat properties on other objects than QDev easily.
--- include/hw/qdev-core.h | 2 ++ hw/core/qdev.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-)
include/hw/qdev-core.h +2 -0
@@ -422,6 +422,8 @@ const char *qdev_fw_name(DeviceState *dev);Object *qdev_get_machine (void ); +void object_apply_compat_props (Object *obj); +/* FIXME: make this a link<> */ void qdev_set_parent_bus (DeviceState *dev,BusState *bus);
hw/core/qdev.c +5 -1
@@ -970,7 +970,7 @@ static void device_initfn(Object *obj)QLIST_INIT (&dev->gpios); } -static void device_post_init (Object *obj) +void object_apply_compat_props (Object *obj) {if (object_dynamic_cast (qdev_get_machine (),TYPE_MACHINE )) {MachineState *m =MACHINE (qdev_get_machine ());
@@ -982,7 +982,11 @@ static void device_post_init(Object *obj) }object_apply_global_props (obj, mc->compat_props, &error_abort); } +} +static void device_post_init (Object *obj) +{ +object_apply_compat_props (obj);qdev_prop_set_globals (DEVICE (obj)); }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 23/28] qdev: all globals are now user-provided
In reply to Marc-André LureauAll globals are now either provided via -global or through -cpu features (CPU features are implemented by registering globals).
If the global isn't being used, it should warn in either case.
We can thus consider that all global_props are "user-provided" globals. No need to track this per-globals anymore.
--- 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(-)
include/hw/qdev-core.h +0 -3
@@ -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;
hw/core/qdev-properties.c +0 -4
@@ -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); } }
tests/test-qdev-global-props.c +6 -51
75 lines not on this page · raw message
vl.c +0 -1
@@ -2964,7 +2964,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 ;
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 25/28] qdev-props: remove errp from GlobalProperty
In reply to Marc-André LureauAll qdev_prop_register_global() set &error_fatal for errp, except '-rtc driftfix=slew', which arguably should also use &error_fatal, as otherwise failing to apply the property would only report a warning.
--- include/hw/qdev-core.h | 8 ++------ hw/core/qdev-properties.c | 4 ++-- qom/cpu.c | 1 - target/i386/cpu.c | 1 - target/sparc/cpu.c | 1 - vl.c | 1 - 6 files changed, 4 insertions(+), 12 deletions(-)
include/hw/qdev-core.h +2 -6
@@ -250,18 +250,14 @@ struct PropertyInfo {/** * GlobalProperty: * @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 -* print warnings instead of ignoring errors silently. For -* hotplugged devices, errp is always ignored and warnings are -* printed instead. +* +* An error is fatal for non-hotplugged devices, when the global is applied. */ typedef struct GlobalProperty {const char *driver;const char *property;const char *value;bool used; -Error **errp; }GlobalProperty ; static inline void
hw/core/qdev-properties.c +2 -2
@@ -1238,8 +1238,8 @@ void qdev_prop_set_globals(DeviceState *dev)if (err !=NULL ) {error_prepend (&err,"can't apply global %s.%s=%s: " , prop->driver, prop->property, prop->value); -if (!dev->hotplugged && prop->errp) { -error_propagate (prop->errp, err); +if (!dev->hotplugged) { +error_propagate (&error_fatal, err); }else {warn_report_err (err); }
qom/cpu.c +0 -1
@@ -312,7 +312,6 @@ static void cpu_common_parse_features(const char *typename, char *features, prop->driver = typename; prop->property =g_strdup (featurestr); prop->value =g_strdup (val); - prop->errp = &error_fatal;qdev_prop_register_global (prop); }else { error_setg(errp, "Expected key=value format, found %s.",
target/i386/cpu.c +0 -1
@@ -3568,7 +3568,6 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features, prop->driver = typename; prop->property =g_strdup (name); prop->value =g_strdup (val); - prop->errp = &error_fatal;qdev_prop_register_global (prop); }
target/sparc/cpu.c +0 -1
@@ -111,7 +111,6 @@ cpu_add_feat_as_prop(const char *typename, const char *name, const char *val) prop->driver = typename; prop->property =g_strdup (name); prop->value =g_strdup (val); - prop->errp = &error_fatal;qdev_prop_register_global (prop); }
vl.c +0 -1
@@ -2964,7 +2964,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->errp = &error_fatal;qdev_prop_register_global (g);return 0 ; }
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 28/28] hostmem: use object id for memory region name with >= 4.0
In reply to Marc-André Lureauhostmem-file and hostmem-memfd use the whole object path for the memory region name, and hostname-ram uses only the path component (the object id, or canonical path basename):
qemu -m 1024 -object memory-backend-file,id=mem,size=1G,mem-path=/tmp/foo -numa node,memdev=mem -monitor stdio (qemu) info ramblock
Block Name PSize Offset Used Total
/objects/mem 4 KiB 0x0000000000000000 0x0000000040000000 0x0000000040000000
qemu -m 1024 -object memory-backend-memfd,id=mem,size=1G -numa node,memdev=mem -monitor stdio (qemu) info ramblock
Block Name PSize Offset Used Total
/objects/mem 4 KiB 0x0000000000000000 0x0000000040000000 0x0000000040000000
qemu -m 1024 -object memory-backend-ram,id=mem,size=1G -numa node,memdev=mem -monitor stdio (qemu) info ramblock
Block Name PSize Offset Used Total
mem 4 KiB 0x0000000000000000 0x0000000040000000 0x0000000040000000
For consistency, change to use object id for -file and -memfd as well with >= 4.0.
Having a consistent naming allows to migrate to different hostmem backends.
--- include/sysemu/hostmem.h | 3 ++- backends/hostmem-file.c | 8 ++++---- backends/hostmem-memfd.c | 2 +- backends/hostmem-ram.c | 9 ++++----- backends/hostmem.c | 36 ++++++++++++++++++++++++++++++++++++ hw/core/machine.c | 8 ++++++++ 6 files changed, 55 insertions(+), 11 deletions(-)
include/sysemu/hostmem.h +2 -1
@@ -53,7 +53,7 @@ struct HostMemoryBackend {/* protected */ uint64_t size; -bool merge, dump; +bool merge, dump, use_canonical_path;bool prealloc, force_prealloc, is_mapped, share;DECLARE_BITMAP (host_nodes,MAX_NODES +1 );HostMemPolicy policy;
@@ -67,5 +67,6 @@ MemoryRegion *host_memory_backend_get_memory(HostMemoryBackend *backend);void host_memory_backend_set_mapped (HostMemoryBackend *backend,bool mapped);bool host_memory_backend_is_mapped (HostMemoryBackend *backend);size_t host_memory_backend_pagesize (HostMemoryBackend *memdev); +char *host_memory_backend_get_name (HostMemoryBackend *backend);#endif
backends/hostmem-file.c +4 -4
@@ -43,7 +43,7 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp) {HostMemoryBackendFile *fb =MEMORY_BACKEND_FILE (backend);#ifdef CONFIG_POSIX -gchar *path; +gchar *name;#endif if (!backend->size) {
@@ -58,14 +58,14 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)error_setg (errp,"-mem-path not supported on this host" );#else backend->force_prealloc = mem_prealloc; - path =object_get_canonical_path (OBJECT (backend)); + name =host_memory_backend_get_name (backend);memory_region_init_ram_from_file (&backend->mr,OBJECT (backend), - path, + name, backend->size, fb->align, (backend->share ?RAM_SHARED :0 ) | (fb->is_pmem ?RAM_PMEM :0 ), fb->mem_path, errp); -g_free (path); +g_free (name);#endif }
backends/hostmem-memfd.c +1 -1
@@ -53,7 +53,7 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)return ; } - name =object_get_canonical_path (OBJECT (backend)); + name =host_memory_backend_get_name (backend);memory_region_init_ram_from_fd (&backend->mr,OBJECT (backend), name, backend->size, backend->share, fd, errp);
backends/hostmem-ram.c +4 -5
@@ -16,21 +16,20 @@#define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram" -static void ram_backend_memory_alloc (HostMemoryBackend *backend,Error **errp) { -char *path; +char *name;if (!backend->size) {error_setg (errp,"can't create backend with size 0" );return ; } - path =object_get_canonical_path_component (OBJECT (backend)); -memory_region_init_ram_shared_nomigrate (&backend->mr,OBJECT (backend), path, + name =host_memory_backend_get_name (backend); +memory_region_init_ram_shared_nomigrate (&backend->mr,OBJECT (backend), name, backend->size, backend->share, errp); -g_free (path); +g_free (name); } static void
backends/hostmem.c +36 -0
@@ -28,6 +28,16 @@ QEMU_BUILD_BUG_ON(HOST_MEM_POLICY_BIND != MPOL_BIND);QEMU_BUILD_BUG_ON (HOST_MEM_POLICY_INTERLEAVE !=MPOL_INTERLEAVE );#endif +char * +host_memory_backend_get_name (HostMemoryBackend *backend) +{ +if (!backend->use_canonical_path) { +return object_get_canonical_path_component (OBJECT (backend)); + } + +return object_get_canonical_path (OBJECT (backend)); +} +static void host_memory_backend_get_size (Object *obj,Visitor *v,const char *name,void *opaque,Error **errp)
@@ -247,6 +257,11 @@ static void host_memory_backend_init(Object *obj) backend->prealloc = mem_prealloc; } +static void host_memory_backend_post_init (Object *obj) +{ +object_apply_compat_props (obj); +} +bool host_memory_backend_mr_inited (HostMemoryBackend *backend) {/*
@@ -395,6 +410,23 @@ static void host_memory_backend_set_share(Object *o, bool value, Error **errp) backend->share = value; } +static bool +host_memory_backend_get_use_canonical_path (Object *obj,Error **errp) +{ +HostMemoryBackend *backend =MEMORY_BACKEND (obj); + +return backend->use_canonical_path; +} + +static void +host_memory_backend_set_use_canonical_path (Object *obj,bool value, +Error **errp) +{ +HostMemoryBackend *backend =MEMORY_BACKEND (obj); + + backend->use_canonical_path = value; +} +static void host_memory_backend_class_init (ObjectClass *oc,void *data) {
@@ -441,6 +473,9 @@ host_memory_backend_class_init(ObjectClass *oc, void *data) &error_abort);object_class_property_set_description (oc,"share" ,"Mark the memory as private to QEMU or shared" , &error_abort); +object_class_property_add_bool (oc,"x-use-canonical-path-for-ramblock-id" , + host_memory_backend_get_use_canonical_path, + host_memory_backend_set_use_canonical_path, &error_abort); }static const TypeInfo host_memory_backend_info = {
@@ -451,6 +486,7 @@ static const TypeInfo host_memory_backend_info = { .class_init = host_memory_backend_class_init, .instance_size = sizeof(HostMemoryBackend), .instance_init = host_memory_backend_init, + .instance_post_init = host_memory_backend_post_init, .interfaces = (InterfaceInfo []) { {TYPE_USER_CREATABLE }, { }
hw/core/machine.c +8 -0
@@ -32,6 +32,14 @@ GlobalProperty hw_compat_3_1[] = { .driver = "pcie-root-port", .property = "x-width", .value = "1", + },{ + .driver = "memory-backend-file", + .property = "x-use-canonical-path-for-ramblock-id", + .value = "true", + },{ + .driver = "memory-backend-memfd", + .property = "x-use-canonical-path-for-ramblock-id", + .value = "true", }, };const size_t hw_compat_3_1_len =G_N_ELEMENTS (hw_compat_3_1);
Signature · 1 line
2.20.1.2.gb21ebb671b
[Qemu-devel] [PULL v2 27/28] arm: replace instance_post_init()
In reply to Marc-André LureauReplace arm_cpu_post_init() instance callback by calling it from leaf classes, to avoid potential ordering issue with other post_init callbacks.
--- target/arm/cpu-qom.h | 3 +++ target/arm/cpu.h | 2 ++ target/arm/cpu.c | 30 ++++++++++++++++++++++++------ target/arm/cpu64.c | 24 ++++++++++++++++++++---- 4 files changed, 49 insertions(+), 10 deletions(-)
target/arm/cpu-qom.h +3 -0
@@ -35,6 +35,8 @@ struct arm_boot_info;#define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU +typedef struct ARMCPUInfo ARMCPUInfo ; +/** * ARMCPUClass: * @parent_realize: The parent class' realize handler.
@@ -47,6 +49,7 @@ typedef struct ARMCPUClass {CPUClass parent_class;/*< public >*/ +const ARMCPUInfo *info;DeviceRealize parent_realize;void (*parent_reset)(CPUState *cpu); } ARMCPUClass;
target/arm/cpu.h +2 -0
@@ -884,6 +884,8 @@ static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)return container_of (env,ARMCPU , env); } +void arm_cpu_post_init (Object *obj); +uint64_t arm_cpu_mp_affinity (int idx,uint8_t clustersz);#define ENV_GET_CPU (e) CPU(arm_env_get_cpu(e))
target/arm/cpu.c +24 -6
@@ -740,7 +740,7 @@ static Property arm_cpu_pmsav7_dregion_property =static Property arm_cpu_initsvtor_property =DEFINE_PROP_UINT32 ("init-svtor" ,ARMCPU , init_svtor,0 ); -static void arm_cpu_post_init (Object *obj) +void arm_cpu_post_init (Object *obj) {ARMCPU *cpu =ARM_CPU (obj);
@@ -1457,8 +1457,10 @@ static void cortex_m33_initfn(Object *obj)static void arm_v7m_class_init (ObjectClass *oc,void *data) { +ARMCPUClass *acc =ARM_CPU_CLASS (oc);CPUClass *cc =CPU_CLASS (oc); + acc->info = data;#ifndef CONFIG_USER_ONLY cc->do_interrupt = arm_v7m_cpu_do_interrupt;#endif
@@ -1959,11 +1961,11 @@ static void arm_max_initfn(Object *obj)#endif /* !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) */ -typedef struct ARMCPUInfo { +struct ARMCPUInfo {const char *name;void (*initfn)(Object *obj);void (*class_init)(ObjectClass *oc,void *data); -}ARMCPUInfo ; +};static const ARMCPUInfo arm_cpus[] = { #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64)
@@ -2113,6 +2115,7 @@ static void arm_host_initfn(Object *obj)ARMCPU *cpu =ARM_CPU (obj);kvm_arm_set_cpu_features_from_host (cpu); +arm_cpu_post_init (obj); }static const TypeInfo host_arm_cpu_type_info = {
@@ -2127,14 +2130,30 @@ static const TypeInfo host_arm_cpu_type_info = {#endif +static void arm_cpu_instance_init (Object *obj) +{ +ARMCPUClass *acc =ARM_CPU_GET_CLASS (obj); + + acc->info->initfn (obj); +arm_cpu_post_init (obj); +} + +static void cpu_register_class_init (ObjectClass *oc,void *data) +{ +ARMCPUClass *acc =ARM_CPU_CLASS (oc); + + acc->info = data; +} +static void cpu_register (const ARMCPUInfo *info) {TypeInfo type_info = { .parent =TYPE_ARM_CPU , .instance_size =sizeof (ARMCPU ), - .instance_init = info->initfn, + .instance_init = arm_cpu_instance_init, .class_size =sizeof (ARMCPUClass), - .class_init = info->class_init, + .class_init = info->class_init ?: cpu_register_class_init, + .class_data = (void *)info, }; type_info.name =g_strdup_printf ("%s-" TYPE_ARM_CPU , info->name);
@@ -2147,7 +2166,6 @@ static const TypeInfo arm_cpu_type_info = { .parent = TYPE_CPU, .instance_size = sizeof(ARMCPU), .instance_init = arm_cpu_initfn, - .instance_post_init = arm_cpu_post_init, .instance_finalize = arm_cpu_finalizefn, .abstract = true, .class_size = sizeof(ARMCPUClass),
target/arm/cpu64.c +20 -4
@@ -364,11 +364,11 @@ static void aarch64_max_initfn(Object *obj) } } -typedef struct ARMCPUInfo { +struct ARMCPUInfo {const char *name;void (*initfn)(Object *obj);void (*class_init)(ObjectClass *oc,void *data); -}ARMCPUInfo ; +};static const ARMCPUInfo aarch64_cpus[] = { { .name ="cortex-a57" , .initfn = aarch64_a57_initfn },
@@ -452,14 +452,30 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_arch_name = aarch64_gdb_arch_name; } +static void aarch64_cpu_instance_init (Object *obj) +{ +ARMCPUClass *acc =ARM_CPU_GET_CLASS (obj); + + acc->info->initfn (obj); +arm_cpu_post_init (obj); +} + +static void cpu_register_class_init (ObjectClass *oc,void *data) +{ +ARMCPUClass *acc =ARM_CPU_CLASS (oc); + + acc->info = data; +} +static void aarch64_cpu_register (const ARMCPUInfo *info) {TypeInfo type_info = { .parent =TYPE_AARCH64_CPU , .instance_size =sizeof (ARMCPU ), - .instance_init = info->initfn, + .instance_init = aarch64_cpu_instance_init, .class_size =sizeof (ARMCPUClass), - .class_init = info->class_init, + .class_init = info->class_init ?: cpu_register_class_init, + .class_data = (void *)info, }; type_info.name =g_strdup_printf ("%s-" TYPE_ARM_CPU , info->name);
Signature · 1 line
2.20.1.2.gb21ebb671b
Peter Maydell
AppliedQuoted 31 lines · Marc-André Lureau
The following changes since commit
e59dbbac0364344a3ad84c3497a98c56003d3fb8:Merge remote-tracking branch 'remotes/philmd/tags/fw_cfg-20190104-pull-request' into staging (2019-01-04 18:23:13 +0000)
are available in the Git repository at:
https://github.com/elmarco/qemu.git tags/machine-props-pull-request
for you to fetch changes up to
fa0cb34d2210cc749b9a70db99bb41c56ad20831:hostmem: use object id for memory region name with >= 4.0 (2019-01-07 16:18:42 +0400)
----------------------------------------------------------------
Generalize machine compatibility propertiesDuring "[PATCH v2 05/10] qom/globals: generalize
object_property_set_globals()" review, Eduardo suggested to rework the GlobalProperty handling, so that -global is limited to QDev only and we avoid mixing the machine compats and the user-provided -global properties (instead of generalizing -global to various object kinds, like I proposed in v2)."qdev: do not mix compat props with global props" patch decouples a bit user-provided -global from machine compat properties. This allows to get rid of "
user_provided" and "errp" fields in following patches.A new compat property "x-use-canonical-path-for-ramblock-id" is added to hostmem for legacy canonical path names, set to true for -file and -memfd with qemu < 4.0.
Quoted 5 lines
(this series was initially titled "[PATCH v2 00/10] hostmem: use object "id" for memory region name with >= 3.1", but its focus is more in refactoring the global and compatilibity properties handling now)
----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.
-- PMM
Quoted 14 lines · Marc-André Lureau
----------------------------------------------------------------
Generalize machine compatibility propertiesDuring "[PATCH v2 05/10] qom/globals: generalize
object_property_set_globals()" review, Eduardo suggested to rework the GlobalProperty handling, so that -global is limited to QDev only and we avoid mixing the machine compats and the user-provided -global properties (instead of generalizing -global to various object kinds, like I proposed in v2)."qdev: do not mix compat props with global props" patch decouples a bit user-provided -global from machine compat properties. This allows to get rid of "
user_provided" and "errp" fields in following patches.
Quoted 7 lines
A new compat property "x-use-canonical-path-for-ramblock-id" is added to hostmem for legacy canonical path names, set to true for -file and -memfd with qemu < 4.0.
(this series was initially titled "[PATCH v2 00/10] hostmem: use object "id" for memory region name with >= 3.1", but its focus is more in refactoring the global and compatilibity properties handling now)
Hi; I've just noticed that this refactoring that removed all the HW_COMPAT and PC_COMPAT macros left a couple of references to them behind in documentation/comments:
$ git grep HW_COMPAT docs/devel/migration.rst: b) Add an entry to the ``HW_COMPAT_`` for the previous version that sets hw/i386/pc_piix.c: * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options().
Could you write a patch which updates these bits of documentation to refer to the new scheme, please?
thanks
-- PMM
Hi
Quoted 29 lines · Peter Maydell
Quoted 14 lines · Marc-André Lureau
----------------------------------------------------------------
Generalize machine compatibility propertiesDuring "[PATCH v2 05/10] qom/globals: generalize
object_property_set_globals()" review, Eduardo suggested to rework the GlobalProperty handling, so that -global is limited to QDev only and we avoid mixing the machine compats and the user-provided -global properties (instead of generalizing -global to various object kinds, like I proposed in v2)."qdev: do not mix compat props with global props" patch decouples a bit user-provided -global from machine compat properties. This allows to get rid of "
user_provided" and "errp" fields in following patches.Quoted 7 lines
A new compat property "x-use-canonical-path-for-ramblock-id" is added to hostmem for legacy canonical path names, set to true for -file and -memfd with qemu < 4.0.
(this series was initially titled "[PATCH v2 00/10] hostmem: use object "id" for memory region name with >= 3.1", but its focus is more in refactoring the global and compatilibity properties handling now)
Hi; I've just noticed that this refactoring that removed all the
HW_COMPATandPC_COMPATmacros left a couple of references to them behind in documentation/comments:
Quoted 7 lines
$ git grep HW_COMPAT docs/devel/migration.rst: b) Add an entry to the ``HW_COMPAT_`` for the previous version that sets hw/i386/pc_piix.c: * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options().Could you write a patch which updates these bits of documentation to refer to the new scheme, please?
Ok, patch sent. (it is trivial, as I didn't see any need to change the documentation further)
thanks
Signature · 1 line
Marc-André Lureau