Message ID | 20220814145522.1474927-3-i.qemu@xen0n.name (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Last-minute LoongArch CPU model naming tweaks | expand |
On 8/14/22 09:55, WANG Xuerui wrote: > From: WANG Xuerui <git@xen0n.name> > > Also add a header and indentation for each entry, while at it. > > Signed-off-by: WANG Xuerui <git@xen0n.name> > --- > target/loongarch/cpu.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c > index dc233ee209..4663539443 100644 > --- a/target/loongarch/cpu.c > +++ b/target/loongarch/cpu.c > @@ -416,13 +416,15 @@ static void loongarch_la464_initfn(Object *obj) > static void loongarch_cpu_list_entry(gpointer data, gpointer user_data) > { > const char *typename = object_class_get_name(OBJECT_CLASS(data)); > + int len = strlen(typename) - strlen(LOONGARCH_CPU_TYPE_SUFFIX); > > - qemu_printf("%s\n", typename); > + qemu_printf(" %.*s\n", len, typename); > } > > void loongarch_cpu_list(void) > { > GSList *list; > + qemu_printf("Available CPUs:\n"); > list = object_class_get_list_sorted(TYPE_LOONGARCH_CPU, false); > g_slist_foreach(list, loongarch_cpu_list_entry, NULL); > g_slist_free(list); This should be merged with the previous patch, so that we don't have an intermediate state where help and loongarch_cpu_class_by_name disagree. r~
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index dc233ee209..4663539443 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -416,13 +416,15 @@ static void loongarch_la464_initfn(Object *obj) static void loongarch_cpu_list_entry(gpointer data, gpointer user_data) { const char *typename = object_class_get_name(OBJECT_CLASS(data)); + int len = strlen(typename) - strlen(LOONGARCH_CPU_TYPE_SUFFIX); - qemu_printf("%s\n", typename); + qemu_printf(" %.*s\n", len, typename); } void loongarch_cpu_list(void) { GSList *list; + qemu_printf("Available CPUs:\n"); list = object_class_get_list_sorted(TYPE_LOONGARCH_CPU, false); g_slist_foreach(list, loongarch_cpu_list_entry, NULL); g_slist_free(list);