hw/cpu/cluster: Mark the cpu-cluster device with user_creatable = false
PATCH 1/1 hw/cpu/cluster: Mark the cpu-cluster device with user_creatable = false
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)
Since this is an internal device only, mark it with user_creatable = false.
--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)
hw/cpu/cluster.c +3 -0
@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = {
Signature · 1 line
1.8.3.1
Quoted 21 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +0
-0
hw/cpu/cluster.c static void cpu_cluster_class_init(ObjectClass *klass, void *data)
Quoted 10 lines
hw/cpu/cluster.c +3
-1@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = { --
Would it be possible to add a 'make check' test that every device we claim to be user-creatable can be created without crashing ?
thanks
-- PMM
Quoted 30 lines · Peter Maydell
Quoted 29 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +3
-0@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }
Quoted 8 lines
hw/cpu/cluster.c static void cpu_cluster_class_init(ObjectClass *klass, void *data)
Quoted 2 lines
hw/cpu/cluster.c +0
-1static const TypeInfo cpu_cluster_type_info = { --Reviewed-by Peter Maydell <[email protected]>Would it be possible to add a 'make check' test that every device we claim to be user-creatable can be created without crashing ?
That's what Eduardo's scripts/device-crash-test is good for. It's just too slow to run during "make check" currently, since it checks each device with each machine type... But IIRC Eduardo once had ideas to improve this...?
Thomas
Quoted 11 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>
Quoted 19 lines
--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +3
-0@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = {
Quoted 11 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>
Quoted 19 lines
--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +3
-0@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = {
Alistair Francis
Reviewed-byQuoted 12 lines · Luc Michel
Quoted 8 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)
Quoted 4 lines
Quoted 3 lines
Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>Reviewed-by Luc Michel <[email protected]>
Alistair
Quoted 21 lines
Quoted 20 lines
--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +3
-0@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = {
Laurent Vivier
AppliedQuoted 21 lines · Thomas Huth
The device can not be instantiated by the user and QEMU currently aborts when you try to use it:
$ x86_64-softmmu/qemu-system-x86_64 -device cpu-cluster qemu-system-x86_64: hw/cpu/cluster.c:73: cpu_cluster_realize: Assertion `cbdata.cpu_count > 0' failed. Aborted (core dumped)Since this is an internal device only, mark it with
user_creatable= false.Signed-off-by Thomas Huth <[email protected]>--- hw/cpu/cluster.c | 3 +++ 1 file changed, 3 insertions(+)hw/cpu/cluster.c +0
-0
hw/cpu/cluster.c static void cpu_cluster_class_init(ObjectClass *klass, void *data) · line 87
Quoted 9 lines
hw/cpu/cluster.c +3
-0@@ -79,6 +79,9 @@ static void cpu_cluster_class_init(ObjectClass *klass, void *data) dc->props = cpu_cluster_properties; dc->realize = cpu_cluster_realize; + +/* This is not directly for users, CPU children must be attached by code */ + dc->user_creatable = false; }static const TypeInfo cpu_cluster_type_info = {
Applied to my trivial-patches branch.
Thanks,
Laurent