[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 15/19] s390x: print CPU definitions in sorted
From: |
David Hildenbrand |
Subject: |
Re: [Qemu-devel] [PATCH v2 15/19] s390x: print CPU definitions in sorted order |
Date: |
Thu, 7 Sep 2017 22:04:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
>> + CPUListState *s = user_data;
>> + const S390CPUClass *scc = S390_CPU_CLASS((ObjectClass *)data);
>> + char *name = g_strdup(object_class_get_name((ObjectClass *)data));
>>
>> /* strip off the -s390-cpu */
>> g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
>> - (*info->print)(info->f, "s390 %-15s %-35s %s\n", name, scc->desc,
>> - details);
>> + (*s->cpu_fprintf)(s->file, "s390 %-15s %-35s (%smigration-safe)\n",
>> name,
>> + scc->desc, scc->is_static ? "static, " : "");
>
> Hm, that now prints 's390 host' as 'migration safe'...
Very good point, will fix, thanks!
>
>> g_free(name);
>> }
>>
>> +static gint s390_cpu_list_compare(gconstpointer a, gconstpointer b)
>> +{
>> + const S390CPUClass *cc_a = S390_CPU_CLASS((ObjectClass *)a);
>> + const S390CPUClass *cc_b = S390_CPU_CLASS((ObjectClass *)b);
>> + const char *name_a = object_class_get_name((ObjectClass *)a);
>> + const char *name_b = object_class_get_name((ObjectClass *)b);
>> +
>> + /* move qemu and host to the top of the list, qemu first, host second */
>> + if (name_a[0] == 'q') {
>> + return -1;
>> + } else if (name_b[0] == 'q') {
>> + return 1;
>> + } else if (name_a[0] == 'h') {
>> + return -1;
>> + } else if (name_b[0] == 'h') {
>> + return 1;
>> + }
>
> Are we sure that there will never be models starting with q or h? But
> we can worry about that later.
Could be but unlikely. In the worst case sorting would be wrong, I think
we can live with that :)
--
Thanks,
David
- Re: [Qemu-devel] [PATCH v2 11/19] s390x: allow only 1 CPU with TCG, (continued)
- [Qemu-devel] [PATCH v2 12/19] target/s390x: set cpu->id for linux user when realizing, David Hildenbrand, 2017/09/04
- [Qemu-devel] [PATCH v2 14/19] target/s390x: rename next_cpu_id to next_core_id, David Hildenbrand, 2017/09/04
- [Qemu-devel] [PATCH v2 13/19] target/s390x: use "core-id" for cpu number/address/id handling, David Hildenbrand, 2017/09/04
- [Qemu-devel] [PATCH v2 15/19] s390x: print CPU definitions in sorted order, David Hildenbrand, 2017/09/04
- [Qemu-devel] [PATCH v2 16/19] s390x: allow cpu hotplug via device_add, David Hildenbrand, 2017/09/04
- [Qemu-devel] [PATCH v2 17/19] s390x: CPU hot unplug via device_del cannot work, David Hildenbrand, 2017/09/04
Re: [Qemu-devel] [PATCH v2 17/19] s390x: CPU hot unplug via device_del cannot work, Matthew Rosato, 2017/09/06