qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] Mostly revert "qemu-help: Sort devices by l


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 1/2] Mostly revert "qemu-help: Sort devices by logical functionality"
Date: Fri, 11 Oct 2013 08:41:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Marcel Apfelbaum <address@hidden> writes:

> On Thu, 2013-10-10 at 15:00 +0200, address@hidden wrote:
>> From: Markus Armbruster <address@hidden>
>> 
>> This reverts most of commit 3d1237fb2ab4edb926c717767bb5e31d6053a7c5.
>> 
>> The commit claims to sort the output of "-device help" "by
>> functionality rather than alphabetical".  Issues:
>> 
>> * The output was unsorted before, not alphabetically sorted.
>>   Misleading, but harmless enough.
> I meant that will be sorted, but the sorting will be by functionality
> rather than alphabetical. I can understand the confusion.

Happens :)

>> * The commit doesn't just sort the output of "-device help" as it
>>   claims, it adds categories to each line of "-device help", and it
>>   prints devices once per category.  In particular, devices without a
>>   category aren't shown anymore.  Maybe such devices should not exist,
>>   but they do.  Regression.
> Yes - :(, it was a drawback that devices with no category are not
> printed. On the other hand all devices must be attached to a category,
> otherwise we will have again a lot of devices with no category.

s/otherweise will have again/but unfortunately we still have/

> I suppose your approach lets us at least with the possibility to see
> these devices giving us a chance to attach them to their category.

Yes.

If you want to enforce "no uncategorized devices", you need to catch
them reliably at compile time or "make check" time.  Once that's done,
we can simplify my qdev_print_class_devinfos() not to look for such
devices.  Patches welcome :)

>> * Categories are also added to the output of "info qdm".  Silent
>>   change, not nice.  Output remains unsorted, unlike "-device help".
>
> I checked libvirt and the parsing of the output is not affected
> by adding the category. 

I didn't claim actual harm, just pointed out that you should've
mentioned it in the commit message, and that the reasons for improving
"device_add help" equally apply to "info qdm".

> I still think that adding the category in each line may be
> useful when using grep, but I suppose that we can grep by category 
> with -A x.

Yes, repeating the categories on each line can be convenient when the
lines are fed to programs, but help output is primarily for humans.

Try 'sed -n "/^$cat devices:/,/^\$/p"' instead of 'grep $cat'.

[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]