All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: Amit Shah <amit.shah@redhat.com>,
	alevy@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/4] virtio-serial: Clean up virtser_bus_dev_print() output
Date: Wed, 29 Jun 2011 11:22:07 +0200	[thread overview]
Message-ID: <m3tyb9q9fk.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <E364E707-BB98-46B5-A840-B6D6E9324F47@web.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Mon, 27 Jun 2011 21:32:57 +0200")

Andreas Färber <andreas.faerber@web.de> writes:

> Am 19.05.2011 um 16:18 schrieb Markus Armbruster:
>
>> Amit Shah <amit.shah@redhat.com> writes:
>>
>>> On (Thu) 19 May 2011 [13:37:15], Markus Armbruster wrote:
>>>> Old version looks like this in info qtree (last four lines):
>>>>
>>>>          dev: virtconsole, id ""
>>>>            dev-prop: is_console = 1
>>>>            dev-prop: nr = 0
>>>>            dev-prop: chardev = <null>
>>>>            dev-prop: name = <null>
>>>>             dev-prop-int: id: 0
>>>>             dev-prop-int: guest_connected: 1
>>>>             dev-prop-int: host_connected: 0
>>>>             dev-prop-int: throttled: 0
>>>>
>>>> Indentation is off, and "dev-prop-int" suggests these are properties
>>>> you can configure with -device, which isn't the case.  The other
>>>> buses' print_dev() callbacks don't do that.  For instance, PCI's
>>>> output looks like this:
>>>>
>>>>        class Ethernet controller, addr 00:03.0, pci id 1af4:1000
>>>> (sub 1af4:0001)
>>>>        bar 0: i/o at 0xffffffffffffffff [0x1e]
>>>>        bar 1: mem at 0xffffffffffffffff [0xffe]
>>>>        bar 6: mem at 0xffffffffffffffff [0xfffe]
>>>>
>>>> Change virtser_bus_dev_print() to that style.  Result:
>>>>
>>>>          dev: virtconsole, id ""
>>>>            dev-prop: is_console = 1
>>>>            dev-prop: nr = 0
>>>>            dev-prop: chardev = <null>
>>>>            dev-prop: name = <null>
>>>>            port 0, guest on, host off, throttle off
>>>
>>> Here the original guest_connected and host_connected meant whether
>>> the
>>> endpoints were open.  guest on/off, host on/off don't convey that
>>> meaning.  Can't think of a short version, can you?
>>
>> I chose on/off to stay consistent with how qdev shows bool properties
>> (print_bit() in qdev-properties.c).  May be misguided.  Like you, I'm
>> having difficulties coming up with a better version that is still
>> consise.
>
> Erm, I'm not aware that my qdev bool patch got committed yet, so the
> question of how to parse/print bool properties (on/off vs. yes/no) is
> still undecided, no comments so far.

No, there is precedence: PROP_TYPE_BIT's parse_bit(), print_bit().  The
fact that it's a bit within a uint32_t rather than bool is
implementation detail that shouldn't matter at the -device / info qtree
level.

>                                      It would be entirely possible to
> let the author decide that on a case-by-case basis by using different
> property type enums for the same 'bool' type.

Possible, but is it wise?

  parent reply	other threads:[~2011-06-29  9:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 11:37 [Qemu-devel] [PATCH 0/4] A few cleanups of qdev users Markus Armbruster
2011-05-19 11:37 ` [Qemu-devel] [PATCH 1/4] usb-ccid: Drop unused CCIDCardInfo callback print() Markus Armbruster
2011-05-19 11:49   ` Alon Levy
2011-05-19 11:37 ` [Qemu-devel] [PATCH 2/4] virtio-serial: Clean up virtser_bus_dev_print() output Markus Armbruster
2011-05-19 13:10   ` Amit Shah
2011-05-19 14:18     ` Markus Armbruster
2011-05-19 14:24       ` Amit Shah
2011-06-27 19:32       ` Andreas Färber
2011-06-29  8:33         ` Gerd Hoffmann
2011-06-29  9:26           ` Markus Armbruster
2011-06-29 18:33           ` Andreas Färber
2011-06-29  9:22         ` Markus Armbruster [this message]
2011-05-19 11:37 ` [Qemu-devel] [PATCH 3/4] virtio-serial: Turn props any virtio-serial-bus device must have into bus props Markus Armbruster
2011-05-19 13:11   ` Amit Shah
2011-05-19 14:05     ` Markus Armbruster
2011-05-19 14:08       ` Amit Shah
2011-05-19 11:37 ` [Qemu-devel] [PATCH 4/4] ide: Turn properties any IDE device must have into bus properties Markus Armbruster
2011-05-19 12:11 ` [Qemu-devel] [PATCH 0/4] A few cleanups of qdev users Gerd Hoffmann
2011-06-24 11:57 ` Markus Armbruster
2011-06-27  9:54   ` Amit Shah
2011-06-27 12:36     ` Markus Armbruster
2011-06-28 11:26       ` Amit Shah
2011-06-28 12:24         ` Markus Armbruster
2011-06-28 12:34           ` Amit Shah
2011-07-23 16:54 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3tyb9q9fk.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alevy@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=andreas.faerber@web.de \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.