* [PULL 00/10] machine + QOM queue, 2020-10-14
@ 2020-10-14 14:34 Eduardo Habkost
2020-10-14 14:34 ` [PULL 01/10] rng-egd: Register "chardev" as class property Eduardo Habkost
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
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(-)
--
2.28.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PULL 01/10] rng-egd: Register "chardev" as class property
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 02/10] rng-random: register "filename" " Eduardo Habkost
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-4-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
backends/rng-egd.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index 20198ff26e..4de142b9dc 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -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,
};
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 02/10] rng-random: register "filename" as class property
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
2020-10-14 14:34 ` [PULL 01/10] rng-egd: Register "chardev" as class property Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 03/10] rng: Register "opened" " Eduardo Habkost
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-5-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
backends/rng-random.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 245b12ab24..7add272edd 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -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 = {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 03/10] rng: Register "opened" as class property
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
2020-10-14 14:34 ` [PULL 01/10] rng-egd: Register "chardev" as class property Eduardo Habkost
2020-10-14 14:34 ` [PULL 02/10] rng-random: register "filename" " Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 04/10] input-linux: Register properties as class properties Eduardo Habkost
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-8-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
backends/rng.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/backends/rng.c b/backends/rng.c
index 484f04e891..3757b04485 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -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 = {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 04/10] input-linux: Register properties as class properties
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (2 preceding siblings ...)
2020-10-14 14:34 ` [PULL 03/10] rng: Register "opened" " Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 05/10] input-barrier: " Eduardo Habkost
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-10-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
ui/input-linux.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/ui/input-linux.c b/ui/input-linux.c
index ab351a4187..a339c52cb8 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -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 = {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 05/10] input-barrier: Register properties as class properties
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (3 preceding siblings ...)
2020-10-14 14:34 ` [PULL 04/10] input-linux: Register properties as class properties Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 06/10] i386: Register most CPU " Eduardo Habkost
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Paolo Bonzini, Daniel P. Berrange
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200921221045.699690-11-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
ui/input-barrier.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/ui/input-barrier.c b/ui/input-barrier.c
index a047919fde..81b8d04ec8 100644
--- a/ui/input-barrier.c
+++ b/ui/input-barrier.c
@@ -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 = {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 06/10] i386: Register most CPU properties as class properties
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (4 preceding siblings ...)
2020-10-14 14:34 ` [PULL 05/10] input-barrier: " Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property Eduardo Habkost
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: Paolo Bonzini, Daniel P. Berrange, Igor Mammedov
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20200921221045.699690-14-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
target/i386/cpu.c | 66 ++++++++++++++++++++++++-----------------------
1 file changed, 34 insertions(+), 32 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 9eafbe3690..5d713c8528 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -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 = {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (5 preceding siblings ...)
2020-10-14 14:34 ` [PULL 06/10] i386: Register most CPU " Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 08/10] vhost-user: Register "chardev" " Eduardo Habkost
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: Paolo Bonzini, Daniel P. Berrange, Marc-André Lureau
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200921221045.699690-22-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/display/vga-pci.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index e5d9af5868..48d29630ab 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -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,
};
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 08/10] vhost-user: Register "chardev" as class property
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (6 preceding siblings ...)
2020-10-14 14:34 ` [PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 09/10] authz-list-file: Fix crash when filename is not set Eduardo Habkost
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: Paolo Bonzini, Daniel P. Berrange, Marc-André Lureau
Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200921221045.699690-6-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
backends/vhost-user.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/backends/vhost-user.c b/backends/vhost-user.c
index ae8362d721..b366610e16 100644
--- a/backends/vhost-user.c
+++ b/backends/vhost-user.c
@@ -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,
};
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 09/10] authz-list-file: Fix crash when filename is not set
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (7 preceding siblings ...)
2020-10-14 14:34 ` [PULL 08/10] vhost-user: Register "chardev" " Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-14 14:34 ` [PULL 10/10] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
2020-10-15 19:30 ` [PULL 00/10] machine + QOM queue, 2020-10-14 Peter Maydell
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: Paolo Bonzini, Li Qiang, Daniel P. Berrange,
Philippe Mathieu-Daudé
Fix 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)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20201008202713.1416823-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
authz/listfile.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/authz/listfile.c b/authz/listfile.c
index cd6163aa40..aaf930453d 100644
--- a/authz/listfile.c
+++ b/authz/listfile.c
@@ -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) {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PULL 10/10] can-host-socketcan: Fix crash when 'if' option is not set
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (8 preceding siblings ...)
2020-10-14 14:34 ` [PULL 09/10] authz-list-file: Fix crash when filename is not set Eduardo Habkost
@ 2020-10-14 14:34 ` Eduardo Habkost
2020-10-15 19:30 ` [PULL 00/10] machine + QOM queue, 2020-10-14 Peter Maydell
10 siblings, 0 replies; 12+ messages in thread
From: Eduardo Habkost @ 2020-10-14 14:34 UTC (permalink / raw)
To: qemu-devel, Peter Maydell
Cc: Paolo Bonzini, Li Qiang, Daniel P. Berrange, Pavel Pisa
Fix the following crash:
$ qemu-system-x86_64 -object can-host-socketcan,id=obj0
Segmentation fault (core dumped)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Message-Id: <20201008202713.1416823-3-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
net/can/can_socketcan.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c
index 92b1f79385..4b68f60c6b 100644
--- a/net/can/can_socketcan.c
+++ b/net/can/can_socketcan.c
@@ -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) {
--
2.28.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PULL 00/10] machine + QOM queue, 2020-10-14
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
` (9 preceding siblings ...)
2020-10-14 14:34 ` [PULL 10/10] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
@ 2020-10-15 19:30 ` Peter Maydell
10 siblings, 0 replies; 12+ messages in thread
From: Peter Maydell @ 2020-10-15 19:30 UTC (permalink / raw)
To: Eduardo Habkost; +Cc: Paolo Bonzini, Daniel P. Berrange, QEMU Developers
On Wed, 14 Oct 2020 at 15:34, Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> 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)
>
> ----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2020-10-15 19:32 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-14 14:34 [PULL 00/10] machine + QOM queue, 2020-10-14 Eduardo Habkost
2020-10-14 14:34 ` [PULL 01/10] rng-egd: Register "chardev" as class property Eduardo Habkost
2020-10-14 14:34 ` [PULL 02/10] rng-random: register "filename" " Eduardo Habkost
2020-10-14 14:34 ` [PULL 03/10] rng: Register "opened" " Eduardo Habkost
2020-10-14 14:34 ` [PULL 04/10] input-linux: Register properties as class properties Eduardo Habkost
2020-10-14 14:34 ` [PULL 05/10] input-barrier: " Eduardo Habkost
2020-10-14 14:34 ` [PULL 06/10] i386: Register most CPU " Eduardo Habkost
2020-10-14 14:34 ` [PULL 07/10] vga-pci: Register "big-endian-framebuffer" as class property Eduardo Habkost
2020-10-14 14:34 ` [PULL 08/10] vhost-user: Register "chardev" " Eduardo Habkost
2020-10-14 14:34 ` [PULL 09/10] authz-list-file: Fix crash when filename is not set Eduardo Habkost
2020-10-14 14:34 ` [PULL 10/10] can-host-socketcan: Fix crash when 'if' option " Eduardo Habkost
2020-10-15 19:30 ` [PULL 00/10] machine + QOM queue, 2020-10-14 Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).