};
typedef struct ChadevClassFE {
- void (*fn)(const char *name, void *opaque);
+ void (*fn)(const char *name, bool is_cli_alias, void *opaque);
void *opaque;
} ChadevClassFE;
return;
}
- fe->fn(object_class_get_name(klass) + 8, fe->opaque);
+ fe->fn(object_class_get_name(klass) + 8, false, fe->opaque);
}
static void
-chardev_name_foreach(void (*fn)(const char *name, void *opaque), void *opaque)
+chardev_name_foreach(void (*fn)(const char *name, bool is_cli_alias,
+ void *opaque),
+ void *opaque)
{
ChadevClassFE fe = { .fn = fn, .opaque = opaque };
int i;
object_class_foreach(chardev_class_foreach, TYPE_CHARDEV, false, &fe);
for (i = 0; i < (int)ARRAY_SIZE(chardev_alias_table); i++) {
- fn(chardev_alias_table[i].alias, opaque);
+ fn(chardev_alias_table[i].alias, true, opaque);
}
}
static void
-help_string_append(const char *name, void *opaque)
+help_string_append(const char *name, bool is_cli_alias, void *opaque)
{
GString *str = opaque;
}
static void
-qmp_prepend_backend(const char *name, void *opaque)
+qmp_prepend_backend(const char *name, bool is_cli_alias, void *opaque)
{
ChardevBackendInfoList **list = opaque;
- ChardevBackendInfo *value = g_new0(ChardevBackendInfo, 1);
+ ChardevBackendInfo *value;
+ if (is_cli_alias) {
+ return;
+ }
+
+ value = g_new0(ChardevBackendInfo, 1);
value->name = g_strdup(name);
QAPI_LIST_PREPEND(*list, value);
}