* [Qemu-devel] [PATCH ] qemu-help: add category headlines
@ 2013-08-22 12:48 Marcel Apfelbaum
2013-08-22 14:00 ` Andreas Färber
2013-08-28 8:10 ` Marcel Apfelbaum
0 siblings, 2 replies; 7+ messages in thread
From: Marcel Apfelbaum @ 2013-08-22 12:48 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, Marcel Apfelbaum, mst, armbru, pbonzini, afaerber
This patch follows Markus Armbruster suggestion:
A possibly better way to group help by category: instead of adding
categories to each line, add category headlines, like this:
Controller/Bridge/Hub devices:
name "NAME", bus "BUS"...
...
USB devices:
name "NAME", bus "BUS"...
...
Storage devices:
...
This way, showing devices with multiple categories once per category
actually makes sense.
Note that the "categories to each line" is kept for 2 reasons:
1. Preparation for multifunction devices
2. Ability to grep by category
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
---
qdev-monitor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 410cdcb..a7329b0 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
DeviceClass *dc;
GSList *list, *curr;
+ error_printf("%s devices:\n", qdev_category_get_name(category));
+
list = object_class_get_list(TYPE_DEVICE, false);
for (curr = list; curr; curr = g_slist_next(curr)) {
dc = (DeviceClass *)object_class_dynamic_cast(curr->data, TYPE_DEVICE);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 12:48 [Qemu-devel] [PATCH ] qemu-help: add category headlines Marcel Apfelbaum
@ 2013-08-22 14:00 ` Andreas Färber
2013-08-22 14:13 ` Markus Armbruster
2013-08-28 8:10 ` Marcel Apfelbaum
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Färber @ 2013-08-22 14:00 UTC (permalink / raw)
To: Marcel Apfelbaum; +Cc: pbonzini, aliguori, mst, qemu-devel, armbru
Am 22.08.2013 14:48, schrieb Marcel Apfelbaum:
> This patch follows Markus Armbruster suggestion:
>
> A possibly better way to group help by category: instead of adding
> categories to each line, add category headlines, like this:
>
> Controller/Bridge/Hub devices:
> name "NAME", bus "BUS"...
> ...
> USB devices:
> name "NAME", bus "BUS"...
> ...
> Storage devices:
> ...
>
> This way, showing devices with multiple categories once per category
> actually makes sense.
>
> Note that the "categories to each line" is kept for 2 reasons:
> 1. Preparation for multifunction devices
> 2. Ability to grep by category
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
> qdev-monitor.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/qdev-monitor.c b/qdev-monitor.c
> index 410cdcb..a7329b0 100644
> --- a/qdev-monitor.c
> +++ b/qdev-monitor.c
> @@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
> DeviceClass *dc;
> GSList *list, *curr;
>
> + error_printf("%s devices:\n", qdev_category_get_name(category));
Why is that an error? Shouldn't it go to stdout?
Andreas
> +
> list = object_class_get_list(TYPE_DEVICE, false);
> for (curr = list; curr; curr = g_slist_next(curr)) {
> dc = (DeviceClass *)object_class_dynamic_cast(curr->data, TYPE_DEVICE);
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 14:00 ` Andreas Färber
@ 2013-08-22 14:13 ` Markus Armbruster
2013-08-22 15:34 ` Eric Blake
0 siblings, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2013-08-22 14:13 UTC (permalink / raw)
To: Andreas Färber; +Cc: pbonzini, aliguori, mst, qemu-devel, Marcel Apfelbaum
Andreas Färber <afaerber@suse.de> writes:
> Am 22.08.2013 14:48, schrieb Marcel Apfelbaum:
>> This patch follows Markus Armbruster suggestion:
>>
>> A possibly better way to group help by category: instead of adding
>> categories to each line, add category headlines, like this:
>>
>> Controller/Bridge/Hub devices:
>> name "NAME", bus "BUS"...
>> ...
>> USB devices:
>> name "NAME", bus "BUS"...
>> ...
>> Storage devices:
>> ...
>>
>> This way, showing devices with multiple categories once per category
>> actually makes sense.
>>
>> Note that the "categories to each line" is kept for 2 reasons:
>> 1. Preparation for multifunction devices
>> 2. Ability to grep by category
>>
>> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
>> ---
>> qdev-monitor.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/qdev-monitor.c b/qdev-monitor.c
>> index 410cdcb..a7329b0 100644
>> --- a/qdev-monitor.c
>> +++ b/qdev-monitor.c
>> @@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
>> DeviceClass *dc;
>> GSList *list, *curr;
>>
>> + error_printf("%s devices:\n", qdev_category_get_name(category));
>
> Why is that an error? Shouldn't it go to stdout?
Output of -device help has always gone to stderr, and that has always
annoyed me. Just not enough to fix it.
[...]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 14:13 ` Markus Armbruster
@ 2013-08-22 15:34 ` Eric Blake
2013-08-22 17:18 ` Marcel Apfelbaum
0 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2013-08-22 15:34 UTC (permalink / raw)
To: Markus Armbruster
Cc: aliguori, Marcel Apfelbaum, mst, qemu-devel, pbonzini,
Andreas Färber
[-- Attachment #1: Type: text/plain, Size: 854 bytes --]
On 08/22/2013 08:13 AM, Markus Armbruster wrote:
>>> +++ b/qdev-monitor.c
>>> @@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
>>> DeviceClass *dc;
>>> GSList *list, *curr;
>>>
>>> + error_printf("%s devices:\n", qdev_category_get_name(category));
>>
>> Why is that an error? Shouldn't it go to stdout?
>
> Output of -device help has always gone to stderr, and that has always
> annoyed me. Just not enough to fix it.
Back when libvirt scraped -help output, changing it to use stdout would
be an incompatible change. But now that libvirt uses QMP, I would also
welcome a change to use stdout (but also fall in the category of "not
enough of a bother for ME to fix it).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 15:34 ` Eric Blake
@ 2013-08-22 17:18 ` Marcel Apfelbaum
2013-08-22 17:47 ` Markus Armbruster
0 siblings, 1 reply; 7+ messages in thread
From: Marcel Apfelbaum @ 2013-08-22 17:18 UTC (permalink / raw)
To: Eric Blake
Cc: aliguori, mst, qemu-devel, Markus Armbruster, pbonzini,
Andreas Färber
On Thu, 2013-08-22 at 09:34 -0600, Eric Blake wrote:
> On 08/22/2013 08:13 AM, Markus Armbruster wrote:
>
> >>> +++ b/qdev-monitor.c
> >>> @@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
> >>> DeviceClass *dc;
> >>> GSList *list, *curr;
> >>>
> >>> + error_printf("%s devices:\n", qdev_category_get_name(category));
> >>
> >> Why is that an error? Shouldn't it go to stdout?
> >
> > Output of -device help has always gone to stderr, and that has always
> > annoyed me. Just not enough to fix it.
>
> Back when libvirt scraped -help output, changing it to use stdout would
> be an incompatible change. But now that libvirt uses QMP, I would also
> welcome a change to use stdout (but also fall in the category of "not
> enough of a bother for ME to fix it).
It really bothers me. I need to use the help (being new to qemu ...)
and I am always forgetting "2>&1".
Anyone can think of a reason for not sending the help to stdout?
Marcel
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 17:18 ` Marcel Apfelbaum
@ 2013-08-22 17:47 ` Markus Armbruster
0 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2013-08-22 17:47 UTC (permalink / raw)
To: Marcel Apfelbaum; +Cc: aliguori, mst, qemu-devel, pbonzini, Andreas Färber
Marcel Apfelbaum <marcel.a@redhat.com> writes:
> On Thu, 2013-08-22 at 09:34 -0600, Eric Blake wrote:
>> On 08/22/2013 08:13 AM, Markus Armbruster wrote:
>>
>> >>> +++ b/qdev-monitor.c
>> >>> @@ -156,6 +156,8 @@ static void
>> >>> qdev_print_category_devices(DeviceCategory category)
>> >>> DeviceClass *dc;
>> >>> GSList *list, *curr;
>> >>>
>> >>> + error_printf("%s devices:\n", qdev_category_get_name(category));
>> >>
>> >> Why is that an error? Shouldn't it go to stdout?
>> >
>> > Output of -device help has always gone to stderr, and that has always
>> > annoyed me. Just not enough to fix it.
>>
>> Back when libvirt scraped -help output, changing it to use stdout would
>> be an incompatible change. But now that libvirt uses QMP, I would also
>> welcome a change to use stdout (but also fall in the category of "not
>> enough of a bother for ME to fix it).
> It really bothers me. I need to use the help (being new to qemu ...)
> and I am always forgetting "2>&1".
>
> Anyone can think of a reason for not sending the help to stdout?
Post a patch and find out ;)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH ] qemu-help: add category headlines
2013-08-22 12:48 [Qemu-devel] [PATCH ] qemu-help: add category headlines Marcel Apfelbaum
2013-08-22 14:00 ` Andreas Färber
@ 2013-08-28 8:10 ` Marcel Apfelbaum
1 sibling, 0 replies; 7+ messages in thread
From: Marcel Apfelbaum @ 2013-08-28 8:10 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, aliguori, mst, armbru, afaerber
On Thu, 2013-08-22 at 15:48 +0300, Marcel Apfelbaum wrote:
> This patch follows Markus Armbruster suggestion:
>
> A possibly better way to group help by category: instead of adding
> categories to each line, add category headlines, like this:
>
> Controller/Bridge/Hub devices:
> name "NAME", bus "BUS"...
> ...
> USB devices:
> name "NAME", bus "BUS"...
> ...
> Storage devices:
> ...
>
> This way, showing devices with multiple categories once per category
> actually makes sense.
>
> Note that the "categories to each line" is kept for 2 reasons:
> 1. Preparation for multifunction devices
> 2. Ability to grep by category
ping
Marcel
>
> Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
> ---
> qdev-monitor.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/qdev-monitor.c b/qdev-monitor.c
> index 410cdcb..a7329b0 100644
> --- a/qdev-monitor.c
> +++ b/qdev-monitor.c
> @@ -156,6 +156,8 @@ static void qdev_print_category_devices(DeviceCategory category)
> DeviceClass *dc;
> GSList *list, *curr;
>
> + error_printf("%s devices:\n", qdev_category_get_name(category));
> +
> list = object_class_get_list(TYPE_DEVICE, false);
> for (curr = list; curr; curr = g_slist_next(curr)) {
> dc = (DeviceClass *)object_class_dynamic_cast(curr->data, TYPE_DEVICE);
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-28 8:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 12:48 [Qemu-devel] [PATCH ] qemu-help: add category headlines Marcel Apfelbaum
2013-08-22 14:00 ` Andreas Färber
2013-08-22 14:13 ` Markus Armbruster
2013-08-22 15:34 ` Eric Blake
2013-08-22 17:18 ` Marcel Apfelbaum
2013-08-22 17:47 ` Markus Armbruster
2013-08-28 8:10 ` Marcel Apfelbaum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).