machine + QOM queue, 2020-10-14
The following changes since commit 96292515c07e3a99f5a29540ed2f257b1ff75111:
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging (2020-10-13 14:06:22 +0100)
are available in the Git repository at:
git://github.com/ehabkost/qemu.git tags/machine-next-pull-request
for you to fetch changes up to d9753cca6b0db724bc6d15e60cfad1705f800b96:
can-host-socketcan: Fix crash when 'if' option is not set (2020-10-13 15:56:30 -0400)
----------------------------------------------------------------
machine + QOM queue, 2020-10-14
* Register some properties as class properties (Eduardo Habkost)
* authz-list-file: Fix crash when filename is not set (Eduardo Habkost)
* can-host-socketcan: Fix crash when 'if' option is not set (Eduardo Habkost)
----------------------------------------------------------------
Eduardo Habkost (10):
rng-egd: Register "chardev" as class property
rng-random: register "filename" as class property
rng: Register "opened" as class property
input-linux: Register properties as class properties
input-barrier: Register properties as class properties
i386: Register most CPU properties as class properties
vga-pci: Register "big-endian-framebuffer" as class property
vhost-user: Register "chardev" as class property
authz-list-file: Fix crash when filename is not set
can-host-socketcan: Fix crash when 'if' option is not set
authz/listfile.c | 5 ++++ backends/rng-egd.c | 9 ++---- backends/rng-random.c | 8 ++--- backends/rng.c | 8 ++--- backends/vhost-user.c | 6 ++-- hw/display/vga-pci.c | 12 +++----- net/can/can_socketcan.c | 5 ++++ target/i386/cpu.c | 66 +++++++++++++++++++++-------------------- ui/input-barrier.c | 44 +++++++++++++-------------- ui/input-linux.c | 27 +++++++++-------- 10 files changed, 97 insertions(+), 93 deletions(-)
Signature · 1 line
2.28.0
[PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- hw/display/vga-pci.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
hw/display/vga-pci.c +4 -8
@@ -267,13 +267,6 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp) } } -static void pci_std_vga_init (Object *obj) -{ -/* Expose framebuffer byteorder via QOM */ -object_property_add_bool (obj,"big-endian-framebuffer" , - vga_get_big_endian_fb, vga_set_big_endian_fb); -} -static void pci_secondary_vga_realize (PCIDevice *dev,Error **errp) {PCIVGAState *d =PCI_VGA (dev);
@@ -386,6 +379,10 @@ static void vga_class_init(ObjectClass *klass, void *data) k->class_id =PCI_CLASS_DISPLAY_VGA ;device_class_set_props (dc, vga_pci_properties); dc->hotpluggable = false; + +/* Expose framebuffer byteorder via QOM */ +object_class_property_add_bool (klass,"big-endian-framebuffer" , + vga_get_big_endian_fb, vga_set_big_endian_fb); }static void secondary_class_init (ObjectClass *klass,void *data)
@@ -403,7 +400,6 @@ static void secondary_class_init(ObjectClass *klass, void *data)static const TypeInfo vga_info = { .name ="VGA" , .parent =TYPE_PCI_VGA , - .instance_init = pci_std_vga_init, .class_init = vga_class_init, };
Signature · 1 line
2.28.0
[PULL 02/10] rng-random: register "filename" as class property
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- backends/rng-random.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
backends/rng-random.c +4 -4
@@ -108,10 +108,6 @@ static void rng_random_init(Object *obj) {RngRandom *s =RNG_RANDOM (obj); -object_property_add_str (obj,"filename" , - rng_random_get_filename, - rng_random_set_filename); - s->filename =g_strdup ("/dev/urandom" ); s->fd =-1 ; }
@@ -134,6 +130,10 @@ static void rng_random_class_init(ObjectClass *klass, void *data) rbc->request_entropy = rng_random_request_entropy; rbc->opened = rng_random_opened; +object_class_property_add_str (klass,"filename" , + rng_random_get_filename, + rng_random_set_filename); + }static const TypeInfo rng_random_info = {
Signature · 1 line
2.28.0
[PULL 04/10] input-linux: Register properties as class properties
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- ui/input-linux.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
ui/input-linux.c +14 -13
@@ -489,19 +489,6 @@ static void input_linux_set_grab_toggle(Object *obj, int value,static void input_linux_instance_init (Object *obj) { -object_property_add_str (obj,"evdev" , - input_linux_get_evdev, - input_linux_set_evdev); -object_property_add_bool (obj,"grab_all" , - input_linux_get_grab_all, - input_linux_set_grab_all); -object_property_add_bool (obj,"repeat" , - input_linux_get_repeat, - input_linux_set_repeat); -object_property_add_enum (obj,"grab-toggle" ,"GrabToggleKeys" , - &GrabToggleKeys_lookup, - input_linux_get_grab_toggle, - input_linux_set_grab_toggle); }static void input_linux_class_init (ObjectClass *oc,void *data)
@@ -509,6 +496,20 @@ static void input_linux_class_init(ObjectClass *oc, void *data)UserCreatableClass *ucc =USER_CREATABLE_CLASS (oc); ucc->complete = input_linux_complete; + +object_class_property_add_str (oc,"evdev" , + input_linux_get_evdev, + input_linux_set_evdev); +object_class_property_add_bool (oc,"grab_all" , + input_linux_get_grab_all, + input_linux_set_grab_all); +object_class_property_add_bool (oc,"repeat" , + input_linux_get_repeat, + input_linux_set_repeat); +object_class_property_add_enum (oc,"grab-toggle" ,"GrabToggleKeys" , + &GrabToggleKeys_lookup, + input_linux_get_grab_toggle, + input_linux_set_grab_toggle); }static const TypeInfo input_linux_info = {
Signature · 1 line
2.28.0
[PULL 05/10] input-barrier: Register properties as class properties
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- ui/input-barrier.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-)
ui/input-barrier.c +22 -22
@@ -689,28 +689,6 @@ static void input_barrier_instance_init(Object *obj) ib->y_origin =0 ; ib->width =1920 ; ib->height =1080 ; - -object_property_add_str (obj,"name" , - input_barrier_get_name, - input_barrier_set_name); -object_property_add_str (obj,"server" , - input_barrier_get_server, - input_barrier_set_server); -object_property_add_str (obj,"port" , - input_barrier_get_port, - input_barrier_set_port); -object_property_add_str (obj,"x-origin" , - input_barrier_get_x_origin, - input_barrier_set_x_origin); -object_property_add_str (obj,"y-origin" , - input_barrier_get_y_origin, - input_barrier_set_y_origin); -object_property_add_str (obj,"width" , - input_barrier_get_width, - input_barrier_set_width); -object_property_add_str (obj,"height" , - input_barrier_get_height, - input_barrier_set_height); }static void input_barrier_class_init (ObjectClass *oc,void *data)
@@ -718,6 +696,28 @@ static void input_barrier_class_init(ObjectClass *oc, void *data)UserCreatableClass *ucc =USER_CREATABLE_CLASS (oc); ucc->complete = input_barrier_complete; + +object_class_property_add_str (oc,"name" , + input_barrier_get_name, + input_barrier_set_name); +object_class_property_add_str (oc,"server" , + input_barrier_get_server, + input_barrier_set_server); +object_class_property_add_str (oc,"port" , + input_barrier_get_port, + input_barrier_set_port); +object_class_property_add_str (oc,"x-origin" , + input_barrier_get_x_origin, + input_barrier_set_x_origin); +object_class_property_add_str (oc,"y-origin" , + input_barrier_get_y_origin, + input_barrier_set_y_origin); +object_class_property_add_str (oc,"width" , + input_barrier_get_width, + input_barrier_set_width); +object_class_property_add_str (oc,"height" , + input_barrier_get_height, + input_barrier_set_height); }static const TypeInfo input_barrier_info = {
Signature · 1 line
2.28.0
[PULL 10/10] can-host-socketcan: Fix crash when 'if' option is not set
In reply to Eduardo HabkostFix the following crash:
$ qemu-system-x86_64 -object can-host-socketcan,id=obj0 Segmentation fault (core dumped)
Message-Id: <[email protected]>
--- net/can/can_socketcan.c | 5 +++++ 1 file changed, 5 insertions(+)
net/can/can_socketcan.c +5 -0
@@ -194,6 +194,11 @@ static void can_host_socketcan_connect(CanHostState *ch, Error **errp)struct sockaddr_can addr;struct ifreq ifr; +if (!c->ifname) { +error_setg (errp,"'if' property not set" ); +return ; + } +/* open socket */ s =qemu_socket (PF_CAN ,SOCK_RAW ,CAN_RAW );if (s <0 ) {
Signature · 1 line
2.28.0
[PULL 01/10] rng-egd: Register "chardev" as class property
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- backends/rng-egd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
backends/rng-egd.c +2 -7
@@ -135,12 +135,6 @@ static char *rng_egd_get_chardev(Object *obj, Error **errp)return NULL ; } -static void rng_egd_init (Object *obj) -{ -object_property_add_str (obj,"chardev" , - rng_egd_get_chardev, rng_egd_set_chardev); -} -static void rng_egd_finalize (Object *obj) {RngEgd *s =RNG_EGD (obj);
@@ -155,6 +149,8 @@ static void rng_egd_class_init(ObjectClass *klass, void *data) rbc->request_entropy = rng_egd_request_entropy; rbc->opened = rng_egd_opened; +object_class_property_add_str (klass,"chardev" , + rng_egd_get_chardev, rng_egd_set_chardev); }static const TypeInfo rng_egd_info = {
@@ -162,7 +158,6 @@ static const TypeInfo rng_egd_info = { .parent = TYPE_RNG_BACKEND, .instance_size = sizeof(RngEgd), .class_init = rng_egd_class_init, - .instance_init = rng_egd_init, .instance_finalize = rng_egd_finalize, };
Signature · 1 line
2.28.0
[PULL 09/10] authz-list-file: Fix crash when filename is not set
In reply to Eduardo HabkostFix the following crash:
$ qemu-system-x86_64 -object authz-list-file,id=obj0 qemu-system-x86_64: -object authz-list-file,id=obj0: GLib: g_file_get_contents: assertion 'filename != NULL' failed Segmentation fault (core dumped)
Message-Id: <[email protected]>
--- authz/listfile.c | 5 +++++ 1 file changed, 5 insertions(+)
authz/listfile.c +5 -0
@@ -122,6 +122,11 @@ qauthz_list_file_complete(UserCreatable *uc, Error **errp)QAuthZListFile *fauthz =QAUTHZ_LIST_FILE (uc);gchar *dir =NULL , *file =NULL ; +if (!fauthz->filename) { +error_setg (errp,"filename not provided" ); +return ; + } + fauthz->list =qauthz_list_file_load (fauthz, errp);if (!fauthz->refresh) {
Signature · 1 line
2.28.0
[PULL 03/10] rng: Register "opened" as class property
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- backends/rng.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
backends/rng.c +4 -4
@@ -105,10 +105,6 @@ static void rng_backend_init(Object *obj)RngBackend *s =RNG_BACKEND (obj);QSIMPLEQ_INIT (&s->requests); - -object_property_add_bool (obj,"opened" , - rng_backend_prop_get_opened, - rng_backend_prop_set_opened); }static void rng_backend_finalize (Object *obj)
@@ -123,6 +119,10 @@ static void rng_backend_class_init(ObjectClass *oc, void *data)UserCreatableClass *ucc =USER_CREATABLE_CLASS (oc); ucc->complete = rng_backend_complete; + +object_class_property_add_bool (oc,"opened" , + rng_backend_prop_get_opened, + rng_backend_prop_set_opened); }static const TypeInfo rng_backend_info = {
Signature · 1 line
2.28.0
[PULL 06/10] i386: Register most CPU properties as class properties
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- target/i386/cpu.c | 66 ++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 32 deletions(-)
target/i386/cpu.c +34 -32
@@ -6925,44 +6925,12 @@ static void x86_cpu_initfn(Object *obj) env->nr_dies =1 ;cpu_set_cpustate_pointers (cpu); -object_property_add (obj,"family" ,"int" , - x86_cpuid_version_get_family, - x86_cpuid_version_set_family,NULL ,NULL ); -object_property_add (obj,"model" ,"int" , - x86_cpuid_version_get_model, - x86_cpuid_version_set_model,NULL ,NULL ); -object_property_add (obj,"stepping" ,"int" , - x86_cpuid_version_get_stepping, - x86_cpuid_version_set_stepping,NULL ,NULL ); -object_property_add_str (obj,"vendor" , - x86_cpuid_get_vendor, - x86_cpuid_set_vendor); -object_property_add_str (obj,"model-id" , - x86_cpuid_get_model_id, - x86_cpuid_set_model_id); -object_property_add (obj,"tsc-frequency" ,"int" , - x86_cpuid_get_tsc_freq, - x86_cpuid_set_tsc_freq,NULL ,NULL );object_property_add (obj,"feature-words" ,"X86CPUFeatureWordInfo" , x86_cpu_get_feature_words,NULL ,NULL , (void *)env->features);object_property_add (obj,"filtered-features" ,"X86CPUFeatureWordInfo" , x86_cpu_get_feature_words,NULL ,NULL , (void *)cpu->filtered_features); -/* -* The "unavailable-features" property has the same semantics as -* CpuDefinitionInfo.unavailable-features on the "query-cpu-definitions" -* QMP command: they list the features that would have prevented the -* CPU from running if the "enforce" flag was set. -*/ -object_property_add (obj,"unavailable-features" ,"strList" , - x86_cpu_get_unavailable_features, -NULL ,NULL ,NULL ); - -#if !defined(CONFIG_USER_ONLY ) -object_property_add (obj,"crash-information" ,"GuestPanicInformation" , - x86_cpu_get_crash_info_qom,NULL ,NULL ,NULL ); -#endif for (w =0 ; w <FEATURE_WORDS ; w++) {int bitnr;
@@ -7312,6 +7280,40 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->disas_set_info = x86_disas_set_info; dc->user_creatable = true; + +object_class_property_add (oc,"family" ,"int" , + x86_cpuid_version_get_family, + x86_cpuid_version_set_family,NULL ,NULL ); +object_class_property_add (oc,"model" ,"int" , + x86_cpuid_version_get_model, + x86_cpuid_version_set_model,NULL ,NULL ); +object_class_property_add (oc,"stepping" ,"int" , + x86_cpuid_version_get_stepping, + x86_cpuid_version_set_stepping,NULL ,NULL ); +object_class_property_add_str (oc,"vendor" , + x86_cpuid_get_vendor, + x86_cpuid_set_vendor); +object_class_property_add_str (oc,"model-id" , + x86_cpuid_get_model_id, + x86_cpuid_set_model_id); +object_class_property_add (oc,"tsc-frequency" ,"int" , + x86_cpuid_get_tsc_freq, + x86_cpuid_set_tsc_freq,NULL ,NULL ); +/* +* The "unavailable-features" property has the same semantics as +* CpuDefinitionInfo.unavailable-features on the "query-cpu-definitions" +* QMP command: they list the features that would have prevented the +* CPU from running if the "enforce" flag was set. +*/ +object_class_property_add (oc,"unavailable-features" ,"strList" , + x86_cpu_get_unavailable_features, +NULL ,NULL ,NULL ); + +#if !defined(CONFIG_USER_ONLY ) +object_class_property_add (oc,"crash-information" ,"GuestPanicInformation" , + x86_cpu_get_crash_info_qom,NULL ,NULL ,NULL ); +#endif + }static const TypeInfo x86_cpu_type_info = {
Signature · 1 line
2.28.0
[PULL 08/10] vhost-user: Register "chardev" as class property
In reply to Eduardo HabkostClass properties make QOM introspection simpler and easier, as they don't require an object to be instantiated.
Message-Id: <[email protected]>
--- backends/vhost-user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
backends/vhost-user.c +3 -3
@@ -175,9 +175,9 @@ static char *get_chardev(Object *obj, Error **errp)return NULL ; } -static void vhost_user_backend_init (Object *obj) +static void vhost_user_backend_class_init (ObjectClass *oc,void *data) { -object_property_add_str (obj,"chardev" , get_chardev, set_chardev); +object_class_property_add_str (oc,"chardev" , get_chardev, set_chardev); }static void vhost_user_backend_finalize (Object *obj)
@@ -195,7 +195,7 @@ static const TypeInfo vhost_user_backend_info = { .name = TYPE_VHOST_USER_BACKEND, .parent = TYPE_OBJECT, .instance_size = sizeof(VhostUserBackend), - .instance_init = vhost_user_backend_init, + .class_init = vhost_user_backend_class_init, .instance_finalize = vhost_user_backend_finalize, };
Signature · 1 line
2.28.0
Peter Maydell
AppliedQuoted 13 lines · Eduardo Habkost
The following changes since commit
96292515c07e3a99f5a29540ed2f257b1ff75111:Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging (2020-10-13 14:06:22 +0100)
are available in the Git repository at:
git://github.com/ehabkost/qemu.gittags/machine-next-pull-requestfor you to fetch changes up to
d9753cca6b0db724bc6d15e60cfad1705f800b96:can-host-socketcan: Fix crash when 'if' option is not set (2020-10-13 15:56:30 -0400)
Quoted 8 lines
----------------------------------------------------------------
machine + QOM queue, 2020-10-14* Register some properties as class properties (Eduardo Habkost)
* authz-list-file: Fix crash when filename is not set (Eduardo Habkost)
* can-host-socketcan: Fix crash when 'if' option is not set (Eduardo Habkost)----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.
-- PMM