> From: Markus Armbruster [mailto:arm...@redhat.com] > Sent: Tuesday, September 16, 2014 3:21 PM > To: Michael S. Tsirkin > Subject: Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties > > "Michael S. Tsirkin" <m...@redhat.com> writes: > > > On Mon, Sep 15, 2014 at 05:57:51PM +0200, Paolo Bonzini wrote: > >> Il 15/09/2014 16:44, arei.gong...@huawei.com ha scritto: > >> > From: Gonglei <arei.gong...@huawei.com> > >> > > >> > At present, people have no way to know they should > >> > have a specific format for alias properties. > >> > > >> > Example: > >> > > >> > before output: > >> > > >> > virtio-blk-pci.physical_block_size=uint16 > >> > virtio-blk-pci.logical_block_size=uint16 > >> > virtio-blk-pci.drive=str > >> > > >> > after output applied this patch series: > >> > > >> > virtio-blk-pci.physical_block_size=blocksize > >> > virtio-blk-pci.logical_block_size=blocksize > >> > virtio-blk-pci.drive=drive > >> > >> Is there actually anyone that is relying on the legacy_names of > >> properties? I would be inclined to drop them altogether... > >> > >> Paolo > > > > What makes these legacy? > > Rebasing qdev on top of QOM produced a bit of cruft. > > PropertyInfo defines a kind of property. It used to look like this: > > struct PropertyInfo { > const char *name; > size_t size; > enum PropertyType type; > int (*parse)(DeviceState *dev, Property *prop, const char *str); > int (*print)(DeviceState *dev, Property *prop, char *dest, size_t > len); > }; > > Lets generic code parse, unparse and copy properties. > > Commit 922910c added the -device FOO,? feature, using member name to > give a hint on possible property values. > > The rebase onto QOM renamed name to legacy_name, to free name for use as > QOM type name (commit cafe5bd). > > Current code uses legacy_name as follows: > > * QMP command device-list-properties > > Returns a list of DevicePropertyInfo, whose member "type" is > PropertyInfo's legacy_name if set, else its name. > > * -device FOO,help > > Prints FOO.NAME=TYPE, where NAME is the property's name (not to be > confused with PropertyInfo's name), and TYPE is PropertyInfo's legacy > name if set, else its name. > > -device FOO,? is an outmoded way to say -device FOO,help. No plans to > drop support for it. > > The second is actually built on top of the first. > > > How do you expect users to find out about the properties? > >>qemu -device virtio-blk-pci.? > > is not the correct way anymore? > > As far as I can tell, libvirt uses both device-list-properties and > "-device,?". It doesn't appear to use the returned "type". > > Human users do, however. I'd object to a degradation of -device > FOO,help. Changing it is fine, but it should remain at least as helpful > as it is now. > > > How the time flies, it seems only yesterday this was the > > new way, -help was the old one ... > > Everything must change, so that everything can stay the same.
What detailed explanation it is! Thanks. :) Best regards, -Gonglei