]> git.proxmox.com Git - mirror_qemu.git/commit
qom/object: Use common get/set uint helpers
authorFelipe Franciosi <felipe@nutanix.com>
Tue, 4 Feb 2020 13:16:01 +0000 (13:16 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 22:02:24 +0000 (23:02 +0100)
commit64a7b8de42aff54dce4d82585f25060a741531d1
tree2b26324498aa1417e0dfc2f86d7143593c49e151
parenta8c1e3bbeeb567239cd5a7f0910ab87b91b0872d
qom/object: Use common get/set uint helpers

Several objects implemented their own uint property getters and setters,
despite them being straightforward (without any checks/validations on
the values themselves) and identical across objects. This makes use of
an enhanced API for object_property_add_uintXX_ptr() which offers
default setters.

Some of these setters used to update the value even if the type visit
failed (eg. because the value being set overflowed over the given type).
The new setter introduces a check for these errors, not updating the
value if an error occurred. The error is propagated.

Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/acpi/ich9.c
hw/isa/lpc_ich9.c
hw/misc/edu.c
hw/pci-host/q35.c
hw/ppc/spapr.c
memory.c
target/arm/cpu.c
target/i386/sev.c