On Thu, 30 Jan 2014 14:09:42 +0100 Paolo Bonzini <pbonz...@redhat.com> wrote:
> The conversion of qdev to QOM brought with it legacy properties. > Legacy properties are always have a string type (the accessors always > call visit_type_str), and were used to support -device syntax while > keeping QOM properties strongly typed. For example, an hex8 property > is registered twice, once as an integer-typed property and once as a > legacy property that enforces base 16 for its input. > > However, when introducing legacy properties, the hex8/32/64 had a small > change applied: the previously-optional "0x" prefix became mandatory, > and an error was raised if you omitted it. This was in preparation > for making the legacy properties read-only, and changing the hex8/32/64 > properties to uint8/32/64. This series does exactly this in patches 1-6. > > On the printing side, legacy properties are used by "info qtree" to > tweak its presentation: strings are quoted, hex8/32/64 properties are > printed in hexadecimal, and so on. In this series, patches 7-10 add a > "human" mode to StringOutputVisitors. This mode employs a slightly > different presentation, more suitable for human consumption, but its > output cannot be sent back to a StringInputVisitor. The main change > is that numbers are printed in both decimal and 0x-prefixed hexadecimal. > This lets us drop hex8/32/64 property types. > > Finally, patches 11-12 clean up the type names used for properties. > These are always QAPI names, so that in the future QOM introspection > can piggyback on QAPI introspection for describing property types. > > Paolo Bonzini (12): > qapi: add size parser to StringInputVisitor > qdev: sizes are now parsed by StringInputVisitor > qdev: remove legacy parsers for hex8/32/64 > qdev: legacy properties are now read-only > qdev: legacy properties are just strings > qdev: inline qdev_prop_parse > qapi: add human mode to StringOutputVisitor > qdev: use human mode in "info qtree" > qdev: remove most legacy printers > qdev: remove hex8/32/64 property types > qdev: add enum property types to QAPI schema > qdev: use QAPI type names for properties > > hw/audio/adlib.c | 2 +- > hw/audio/cs4231a.c | 2 +- > hw/audio/gus.c | 2 +- > hw/audio/pcspk.c | 2 +- > hw/audio/sb16.c | 4 +- > hw/block/fdc.c | 2 +- > hw/char/debugcon.c | 4 +- > hw/char/parallel.c | 2 +- > hw/char/serial-isa.c | 2 +- > hw/core/qdev-properties-system.c | 12 ++- > hw/core/qdev-properties.c | 204 > +++-------------------------------- > hw/core/qdev.c | 38 +------ > hw/display/g364fb.c | 2 +- > hw/display/tcx.c | 4 +- > hw/dma/i82374.c | 2 +- > hw/dma/sun4m_iommu.c | 2 +- > hw/i386/kvm/i8254.c | 8 +- > hw/ide/isa.c | 4 +- > hw/ide/qdev.c | 2 +- > hw/intc/i8259_common.c | 6 +- > hw/isa/pc87312.c | 2 +- > hw/misc/applesmc.c | 2 +- > hw/misc/debugexit.c | 4 +- > hw/misc/eccmemctl.c | 2 +- > hw/net/ne2000-isa.c | 2 +- > hw/nvram/fw_cfg.c | 4 +- > hw/ppc/spapr_pci.c | 16 +-- > hw/scsi/megasas.c | 2 +- > hw/scsi/scsi-disk.c | 6 +- > hw/sd/sdhci.c | 4 +- > hw/timer/i8254.c | 2 +- > hw/timer/m48t59.c | 4 +- > hw/timer/mc146818rtc.c | 14 +-- > hw/usb/host-libusb.c | 4 +- > hw/virtio/virtio-pci.c | 6 +- > include/hw/block/block.h | 6 -- > include/hw/qdev-core.h | 1 - > include/hw/qdev-dma.h | 2 +- > include/hw/qdev-properties.h | 11 -- > include/qapi/string-output-visitor.h | 2 +- > include/qemu-common.h | 8 -- > include/qom/object.h | 3 +- > qapi-schema.json | 58 ++++++++++ > qapi/string-input-visitor.c | 24 +++++ > qapi/string-output-visitor.c | 55 +++++++++- > qdev-monitor.c | 6 +- > qom/object.c | 4 +- > tests/test-string-output-visitor.c | 2 +- > tests/test-visitor-serialization.c | 2 +- > 49 files changed, 235 insertions(+), 329 deletions(-) > with fixed checkpatch error in 13/12 Reviewed-By: Igor Mammedov <imamm...@redhat.com>