qom/object: Remove type_register()
authorZhao Liu <zhao1.liu@intel.com>
Tue, 29 Oct 2024 08:59:34 +0000 (16:59 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 10 Dec 2024 17:49:25 +0000 (18:49 +0100)
commit281305d3e08ac7330dfe7cf7b3978c119a888bad
tree5ba562f52b60a80a672eea42ccdab1bedf5c2315
parent4e40d50558432c0e2344ee1838e58e6299e63884
qom/object: Remove type_register()

At present, type_register() and type_register_static() are identical,
although their documentation expects the *_static variant to accept
the Typeinfo with the strings that have the static lifetime.

However, the code implementation doesn't have any check or guarantee for
static lifetime. In fact, this is unnecessary because type_new()
duplicates all strings, thereby taking ownership of them.

Therefore, type_register() and type_register_static() are redundant, so
one of them should be removed.

Since the changes required to remove type_register() were smaller,
type_register() was replaced with type_register_static() throughout the
code base.  Drop its definition, and delete the requirement about string
lifetime from the documentation.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20241029085934.2799066-17-zhao1.liu@intel.com
include/qom/object.h
qom/object.c