From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Yonggang Luo" <luoyonggang@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 4/4] qom: drop the 'is_available' callback from TypeInfo
Date: Thu, 5 Nov 2026 10:24:32 +0000 [thread overview]
Message-ID: <20261105102432.1131493-5-berrange@redhat.com> (raw)
In-Reply-To: <20261105102432.1131493-1-berrange@redhat.com>
For the purposes of introspection, a binary must always register
all compiled in types (classes). Any filtering of what is
permitted with a given selected target should happen at time of
use/query. As such the 'is_available' callback on TypeInfo is
an undesirable design pattern and with Machine classes converted
it can be removed.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
include/qom/object.h | 3 ---
qom/object.c | 4 ----
rust/qom/src/qom.rs | 1 -
3 files changed, 8 deletions(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 70d8ea3e299..06a55b410ba 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -475,8 +475,6 @@ struct Object
* @class_data: Data to pass to the @class_init,
* @class_base_init. This can be useful when building dynamic
* classes.
- * @is_available: callback invoked at registration time, to dynamically check if
- * this type should be available or not.
* @interfaces: The list of interfaces associated with this type. This
* should point to a static array that's terminated with a zero filled
* element.
@@ -500,7 +498,6 @@ struct TypeInfo
void (*class_base_init)(ObjectClass *klass, const void *data);
const void *class_data;
- bool (*is_available)(void);
const InterfaceInfo *interfaces;
};
diff --git a/qom/object.c b/qom/object.c
index cd0590c3fd0..1d9ff06cacf 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -167,10 +167,6 @@ static TypeImpl *type_register_internal(const TypeInfo *info)
abort();
}
- if (info->is_available && !info->is_available()) {
- return NULL;
- }
-
ti = type_new(info);
type_table_add(ti);
diff --git a/rust/qom/src/qom.rs b/rust/qom/src/qom.rs
index 81449eeefad..372be188622 100644
--- a/rust/qom/src/qom.rs
+++ b/rust/qom/src/qom.rs
@@ -695,7 +695,6 @@ pub trait ObjectImpl: ObjectType + IsA<Object> {
class_init: Some(rust_class_init::<Self>),
class_base_init: Self::CLASS_BASE_INIT,
class_data: core::ptr::null(),
- is_available: None,
interfaces: core::ptr::null(),
};
--
2.56.0
next prev parent reply other threads:[~2026-11-05 10:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 10:24 [PATCH 0/4] hw: support machine filtering without is_available Daniel P. Berrangé
2026-11-05 10:24 ` [PATCH 1/4] hw/core: record permitted targets against MachineClass Daniel P. Berrangé
2026-11-05 10:24 ` [PATCH 2/4] hw: replace 'is_available' with 'targets' in machines Daniel P. Berrangé
2026-11-05 10:24 ` [PATCH 3/4] target/riscv: remove 'is_available' from riscv CPUs Daniel P. Berrangé
2026-11-05 10:24 ` Daniel P. Berrangé [this message]
2026-11-05 17:25 ` [PATCH 0/4] hw: support machine filtering without is_available Pierrick Bouvier
2026-11-06 15:35 ` Daniel P. Berrangé
2026-11-06 16:28 ` Yonggang Luo
2026-11-06 17:13 ` Pierrick Bouvier
2026-11-05 19:18 ` Yonggang Luo
2026-11-05 19:24 ` Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261105102432.1131493-5-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=luoyonggang@gmail.com \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.