@@ -3,6 +3,7 @@
#include "qemu/queue.h"
#include "qemu/bitmap.h"
+#include "qemu/support-state.h"
#include "qom/object.h"
#include "hw/irq.h"
#include "hw/hotplug.h"
@@ -105,6 +106,7 @@ typedef struct DeviceClass {
*/
bool user_creatable;
bool hotpluggable;
+ QemuSupportState supported;
/* callbacks */
DeviceReset reset;
@@ -133,11 +133,17 @@ DeviceState *qdev_create(BusState *bus, const char *name)
DeviceState *qdev_try_create(BusState *bus, const char *type)
{
+ DeviceClass *dc;
DeviceState *dev;
- if (object_class_by_name(type) == NULL) {
+ dc = DEVICE_CLASS(object_class_by_name(type));
+ if (dc == NULL) {
return NULL;
}
+ if (qemu_is_deprecated(&dc->supported) ||
+ qemu_is_obsolete(&dc->supported)) {
+ qemu_warn_support_state("device", type, &dc->supported);
+ }
dev = DEVICE(object_new(type));
if (!dev) {
return NULL;
@@ -128,6 +128,9 @@ static void qdev_print_devinfo(DeviceClass *dc)
if (!dc->user_creatable) {
out_printf(", no-user");
}
+ if (dc->supported.state != SUPPORT_STATE_UNKNOWN) {
+ out_printf(", %s", SupportState_str(dc->supported.state));
+ }
out_printf("\n");
}
@@ -579,6 +582,10 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
if (!dc) {
return NULL;
}
+ if (qemu_is_deprecated(&dc->supported) ||
+ qemu_is_obsolete(&dc->supported)) {
+ qemu_warn_support_state("device", driver, &dc->supported);
+ }
/* find bus */
path = qemu_opt_get(opts, "bus");
So we can tag device support state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- include/hw/qdev-core.h | 2 ++ hw/core/qdev.c | 8 +++++++- qdev-monitor.c | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-)