b1987a25 | 18-Dec-2024 |
Richard Henderson <richard.henderson@linaro.org> |
Constify all opaque Property pointers
Via sed "s/ Property [*]/ const Property */".
The opaque pointers passed to ObjectProperty callbacks are the last instances of non-const Property pointers in
Constify all opaque Property pointers
Via sed "s/ Property [*]/ const Property */".
The opaque pointers passed to ObjectProperty callbacks are the last instances of non-const Property pointers in the tree. For the most part, these callbacks only use object_field_prop_ptr, which now takes a const pointer itself.
This logically should have accompanied d36f165d952 which allowed const Property to be registered.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Link: https://lore.kernel.org/r/20241218134251.4724-25-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
857c4a8a | 18-Dec-2024 |
Richard Henderson <richard.henderson@linaro.org> |
hw/core/qdev-properties: Constify Property argument to PropertyInfo.print
This logically should have accompanied d36f165d952 which allowed const Property to be registered.
There is exactly one inst
hw/core/qdev-properties: Constify Property argument to PropertyInfo.print
This logically should have accompanied d36f165d952 which allowed const Property to be registered.
There is exactly one instance of this method: print_pci_devfn.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Link: https://lore.kernel.org/r/20241218134251.4724-24-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
e9c0346a | 18-Dec-2024 |
Richard Henderson <richard.henderson@linaro.org> |
hw/core/qdev-properties: Constify Property argument to object_field_prop_ptr
This logically should have accompanied d36f165d952 which allowed const Property to be registered.
Signed-off-by: Richard
hw/core/qdev-properties: Constify Property argument to object_field_prop_ptr
This logically should have accompanied d36f165d952 which allowed const Property to be registered.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Link: https://lore.kernel.org/r/20241218134251.4724-23-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
cb9f4b28 | 18-Dec-2024 |
Richard Henderson <richard.henderson@linaro.org> |
hw/core: Introduce device_class_set_props_n
Record the size of the array in DeviceClass.props_count_. Iterate with known count in qdev_prop_walk.
Signed-off-by: Richard Henderson <richard.henderson
hw/core: Introduce device_class_set_props_n
Record the size of the array in DeviceClass.props_count_. Iterate with known count in qdev_prop_walk.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Lei Yang <leiyang@redhat.com> Link: https://lore.kernel.org/r/20241218134251.4724-14-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
7d95502c | 28-Nov-2024 |
Paolo Bonzini <pbonzini@redhat.com> |
clock: inline most of qdev_init_clocklist
Move object creation out of qdev_init_clocklist. The input/output cases are very simple, and the aliases are completely different.
Reviewed-by: Philippe M
clock: inline most of qdev_init_clocklist
Move object creation out of qdev_init_clocklist. The input/output cases are very simple, and the aliases are completely different.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
5102f9df | 19-Nov-2024 |
Kevin Wolf <kwolf@redhat.com> |
qdev: Fix set_pci_devfn() to visit option only once
pci_devfn properties accept either a string or an integer as input. To implement this, set_pci_devfn() first tries to visit the option as a string
qdev: Fix set_pci_devfn() to visit option only once
pci_devfn properties accept either a string or an integer as input. To implement this, set_pci_devfn() first tries to visit the option as a string, and if that fails, it visits it as an integer instead. While the QemuOpts visitor happens to accept this, it is invalid according to the visitor interface. QObject input visitors run into an assertion failure when this is done.
QObject input visitors are used with the JSON syntax version of -device on the command line:
$ ./qemu-system-x86_64 -enable-kvm -M q35 -device pcie-pci-bridge,id=pci.1,bus=pcie.0 -blockdev null-co,node-name=disk -device '{ "driver": "virtio-blk-pci", "drive": "disk", "id": "virtio-disk0", "bus": "pci.1", "addr": 1 }' qemu-system-x86_64: ../qapi/qobject-input-visitor.c:143: QObject *qobject_input_try_get_object(QObjectInputVisitor *, const char *, _Bool): Assertion `removed' failed.
The proper way to accept both strings and integers is using the alternate mechanism, which tells us the type of the input before it's visited. With this information, we can directly visit it as the right type.
This fixes set_pci_devfn() by using the alternate mechanism.
Cc: qemu-stable@nongnu.org Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-ID: <20241119120353.57812-1-kwolf@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
37ee17ee | 10-Nov-2024 |
Zhao Liu <zhao1.liu@intel.com> |
hw/core/machine-smp: Fix error message parameter
In the loop checking smp cache support, the error message should report the current cache level and type.
Fix the parameter of error_setg() to ensur
hw/core/machine-smp: Fix error message parameter
In the loop checking smp cache support, the error message should report the current cache level and type.
Fix the parameter of error_setg() to ensure it reports the correct cache level and type.
Resolves: Coverity CID 1565391 Fixes: f35c0221fef8 ("hw/core: Check smp cache topology support for machine") Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/r/20241110150901.130647-3-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
b7e55bd9 | 05-Nov-2024 |
Paolo Bonzini <pbonzini@redhat.com> |
eif: cope with huge section sizes
Check for overflow as well as allocation failure. Resolves Coverity CID 1564859.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Dorjoy C
eif: cope with huge section sizes
Check for overflow as well as allocation failure. Resolves Coverity CID 1564859.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Dorjoy Chowdhury <dorjoychy111@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|