[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v2] usb: Remove legacy -usbdevice option

From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2] usb: Remove legacy -usbdevice option
Date: Fri, 05 Jan 2018 11:09:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> On 05/01/2018 09:18, Markus Armbruster wrote:
>>>> Would it be possible to make this automatic?  Before I could tell people
>>>> "use -usbdevice braille to test braille", and now it would be
>>>> "use -chardev braille,chardev=foobar -device usb-braille,chardev=foobar"
>>> Maybe we can add "-braille" instead.  Something like this:
>> More sugar, ugh!
>> What about giving braille property chardev a sensible default?
>> Ideally in a self-documenting way, so that -device usb-braille,help
>> shows the default.
> That would mean automatically creating a back-end in a device's realize
> property.  I'd rather avoid that,

That's one way to do it.  A perhaps less odious way would be to make
qdev core support chardev defaults just like it supports integer
defaults.  For integers, we specify the default value as parameter for
DEFINE_PROP_INT64() & friends.  For chardevs, we'd can't specify the
value, but we could specify the option string to use for creating it.

One reason I like sane defaults better than sugar: users can more easily
grow from

    -device usb-braille


    -device usb-braille,chardev=braille-be -chardev id=braille-be,...

than from


>                                   sugar is not bad per se.

Stirring a teaspoon of sugar into your tea may be of debatable taste,
but I certainly wouldn't call it bad per se.  However, we're already
closer to upending the sugar bowl, then raiding the pantry for more.

reply via email to

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