The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with. Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step. This is the step for qapi/qdev.json and
qapi/qom.json.
Said commit explains the transformation in more detail. The invariant
violations mentioned there do not occur here.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Eduardo Habkost <eduardo@habkost.net>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <
20221104160712.
3005652-21-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
*/
qapi_event_send_mem_unplug_error(dev->id ? : "",
error_get_pretty(local_err));
- qapi_event_send_device_unplug_guest_error(!!dev->id, dev->id,
+ qapi_event_send_device_unplug_guest_error(dev->id,
dev->canonical_path);
error_free(local_err);
break;
if (dev->pending_deleted_event) {
g_assert(dev->canonical_path);
- qapi_event_send_device_deleted(!!dev->id, dev->id, dev->canonical_path);
+ qapi_event_send_device_deleted(dev->id, dev->canonical_path);
g_free(dev->canonical_path);
dev->canonical_path = NULL;
}
qapi_event_send_mem_unplug_error(dev->id ? : "", qapi_error);
- qapi_event_send_device_unplug_guest_error(!!dev->id, dev->id,
+ qapi_event_send_device_unplug_guest_error(dev->id,
dev->canonical_path);
}
"for device %s", drc->dev->id);
}
- qapi_event_send_device_unplug_guest_error(!!drc->dev->id,
- drc->dev->id,
+ qapi_event_send_device_unplug_guest_error(drc->dev->id,
drc->dev->canonical_path);
}
info->name = g_strdup(object_class_get_name(klass));
info->has_abstract = info->abstract = object_class_is_abstract(klass);
if (parent) {
- info->has_parent = true;
info->parent = g_strdup(object_class_get_name(parent));
}
QAPI_LIST_PREPEND(*pret, info);
}
-ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
- const char *implements,
+ObjectTypeInfoList *qmp_qom_list_types(const char *implements,
bool has_abstract,
bool abstract,
Error **errp)
info = g_new0(ObjectPropertyInfo, 1);
info->name = g_strdup(prop->name);
info->type = g_strdup(prop->type);
- info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
info->default_value = qobject_ref(prop->defval);
- info->has_default_value = !!info->default_value;
QAPI_LIST_PREPEND(prop_list, info);
}
info = g_malloc0(sizeof(*info));
info->name = g_strdup(prop->name);
info->type = g_strdup(prop->type);
- info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
QAPI_LIST_PREPEND(prop_list, info);
assert self.type
# Temporary hack to support dropping the has_FOO in reviewable chunks
opt_out = [
- 'qapi/qdev.json',
- 'qapi/qom.json',
'qapi/replay.json',
'qapi/rocker.json',
'qapi/run-state.json',
#include "qemu/osdep.h"
#include "qapi/qapi-events-qdev.h"
-void qapi_event_send_device_deleted(bool has_device,
- const char *device,
+void qapi_event_send_device_deleted(const char *device,
const char *path)
{
/* Nothing to do. */
}
-void qapi_event_send_device_unplug_guest_error(bool has_device,
- const char *device,
+void qapi_event_send_device_unplug_guest_error(const char *device,
const char *path)
{
/* Nothing to do. */
machines_apply_to_node(mach_info);
qapi_free_MachineInfoList(mach_info);
- type_info = qmp_qom_list_types(true, "device", true, true,
- &error_abort);
+ type_info = qmp_qom_list_types("device", true, true, &error_abort);
types_apply_to_node(type_info);
qapi_free_ObjectTypeInfoList(type_info);
}