qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC] QEMU Object Model status/merge plan


From: Anthony Liguori
Subject: [Qemu-devel] [RFC] QEMU Object Model status/merge plan
Date: Mon, 12 Dec 2011 13:36:12 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13

Hi,

I've spent the past week aggressively converting the tree to QEMU Object Model and was successful in doing a mostly complete conversion. There are a couple of outstanding issues regarding devices that are doing Bad Things but they aren't that hard to fix up.

This is my development head:

https://github.com/aliguori/qemu/tree/qom-next

In this tree, you will see:

 - Full conversion of qdev devices to QOM
 - Relaxed bus constraints so that you can now have devices without busses
 - Refactored serial to take advantage of QOM

I choose the serial device to showcase what we'll eventually be able to do. The three relevant files are:

https://github.com/aliguori/qemu/blob/qom-next/hw/isa-serial.c

https://github.com/aliguori/qemu/blob/qom-next/hw/mm-serial.c

https://github.com/aliguori/qemu/blob/qom-next/hw/serial.c

I chose to model mm-serial via inheritance although I think it should be through composition. I mainly did this to illustrate the possibility.

The diffstat is epic as a lot of automated code conversion was used. I've included the python scripts in the tree for historic purposes. I've included the diffstat to give people an idea what to expect.

In terms of merging, I've setup another tree that I've been rebasing in:

https://github.com/aliguori/qemu/tree/qom-rebase.5

I feel pretty good about the structure of this tree. It basically has four parts that I plan to turn into four series:

1) Basic infrastructure/properties.  No automated conversions

2) Modeling of qdev-base classes in QOM, eliminate sub classes of DeviceInfo. The later is a scripted conversion.

3) Various cleanups to make scripting possible, then scripted removal of per-bus type registration functions

4) Scripted conversion of DeviceInfo to TypeInfo followed changes to qdev to make all objects creatable by QOM directly.

There's more details, but for the most part, QOM conversion is done at the end of this. Once we get this all merged, we can then start the big cleanups like I did above with the serial device.

After series (2), there's enough QOM infrastructure to start using it in other places in the tree.

I sent out a v3 of (1) and hope to merge that soon. I would like to get all four series merged ASAP as they are challenging to rebase because the sheer amount of change.

Obviously, I'm looking for feedback about the best way to make this digestable. I think it's impossible to realistically review the automated changes so my current is to keep all automated changes in each series as one patch so that people can review a representative set of changes.

Regards,

Anthony Liguori

 b/Makefile.objs              |   10
 b/Makefile.target            |    3
 b/QMP/qmp.py                 |    6
 b/QMP/qom-get                |   26 +
 b/QMP/qom-list               |   30 +
 b/QMP/qom-set                |   21
 b/VERSION                    |    2
 b/hw/9pfs/virtio-9p-device.c |   46 +
 b/hw/a9mpcore.c              |   29 -
 b/hw/ac97.c                  |   43 +
 b/hw/acpi_piix4.c            |   70 +-
 b/hw/ads7846.c               |   20
 b/hw/alpha_dp264.c           |    7
 b/hw/alpha_typhoon.c         |   21
 b/hw/apb_pci.c               |   82 ++-
 b/hw/apic.c                  |   37 -
 b/hw/applesmc.c              |   34 -
 b/hw/arm11mpcore.c           |   58 +-
 b/hw/arm_sysctl.c            |   35 -
 b/hw/arm_timer.c             |   32 +
 b/hw/armv7m.c                |   29 -
 b/hw/armv7m_nvic.c           |   16
 b/hw/bitbang_i2c.c           |   21
 b/hw/bonito.c                |   55 +-
 b/hw/ccid-card-emulated.c    |   48 +
 b/hw/ccid-card-passthru.c    |   41 +
 b/hw/ccid.h                  |   27 -
 b/hw/cirrus_vga.c            |   45 +
 b/hw/container.c             |   29 +
 b/hw/cs4231.c                |   31 -
 b/hw/cs4231a.c               |   36 -
 b/hw/debugcon.c              |   32 -
 b/hw/dec_pci.c               |   82 ++-
 b/hw/ds1225y.c               |   33 -
 b/hw/ds1338.c                |   34 -
 b/hw/e1000.c                 |   49 +
 b/hw/eccmemctl.c             |   33 -
 b/hw/eepro100.c              |    6
 b/hw/empty_slot.c            |   18
 b/hw/es1370.c                |   40 -
 b/hw/escc.c                  |   51 +-
 b/hw/esp.c                   |   31 -
 b/hw/etraxfs_eth.c           |   37 -
 b/hw/etraxfs_pic.c           |   29 -
 b/hw/etraxfs_ser.c           |   21
 b/hw/etraxfs_timer.c         |   17
 b/hw/fdc.c                   |  110 ++--
 b/hw/fw_cfg.c                |   37 -
 b/hw/g364fb.c                |   37 -
 b/hw/grackle_pci.c           |   45 +
 b/hw/grlib_apbuart.c         |   29 -
 b/hw/grlib_gptimer.c         |   35 -
 b/hw/grlib_irqmp.c           |   33 -
 b/hw/gt64xxx.c               |   43 +
 b/hw/gus.c                   |   38 -
 b/hw/hda-audio.c             |   64 +-
 b/hw/hpet.c                  |   37 -
 b/hw/hw.h                    |    4
 b/hw/i2c.c                   |  131 +++--
 b/hw/i2c.h                   |   47 +
 b/hw/i440fx.c                |  395 +++++++++++++++
 b/hw/i8254.c                 |   36 -
 b/hw/i8259.c                 |   40 -
 b/hw/ide/cmd646.c            |   43 -
 b/hw/ide/ich.c               |   40 -
 b/hw/ide/internal.h          |   20
 b/hw/ide/isa.c               |   36 -
 b/hw/ide/pci.c               |   11
 b/hw/ide/piix.c              |  101 ++--
 b/hw/ide/qdev.c              |  153 ++++--
 b/hw/ide/via.c               |   31 -
 b/hw/integratorcp.c          |   45 +
 b/hw/intel-hda.c             |  124 +++-
 b/hw/intel-hda.h             |   25
 b/hw/ioapic.c                |   25
 b/hw/ioh3420.c               |   63 +-
 b/hw/isa-bus.c               |   63 +-
 b/hw/isa-serial.c            |  157 ++++++
 b/hw/isa-serial.h            |   82 +++
 b/hw/isa.h                   |   21
 b/hw/ivshmem.c               |   51 +-
 b/hw/kvmclock.c              |   28 -
 b/hw/kvmclock.h              |    5
 b/hw/lan9118.c               |   33 -
 b/hw/lance.c                 |   37 -
 b/hw/lm32_juart.c            |   23
 b/hw/lm32_pic.c              |   23
 b/hw/lm32_sys.c              |   33 -
 b/hw/lm32_timer.c            |   35 -
 b/hw/lm32_uart.c             |   23
 b/hw/lm832x.c                |   37 -
 b/hw/lsi53c895a.c            |   38 -
 b/hw/m48t59.c                |   71 +-
 b/hw/macio.c                 |    5
 b/hw/marvell_88w8618_audio.c |   39 -
 b/hw/max111x.c               |   40 +
 b/hw/max7310.c               |   39 -
 b/hw/mc146818rtc.c           |   59 +-
 b/hw/milkymist-ac97.c        |   23
 b/hw/milkymist-hpdmc.c       |   23
 b/hw/milkymist-memcard.c     |   23
 b/hw/milkymist-minimac2.c    |   41 +
 b/hw/milkymist-pfpu.c        |   23
 b/hw/milkymist-softusb.c     |   47 -
 b/hw/milkymist-sysctl.c      |   47 +
 b/hw/milkymist-tmu2.c        |   23
 b/hw/milkymist-uart.c        |   23
 b/hw/milkymist-vgafb.c       |   35 -
 b/hw/mips_fulong2e.c         |    5
 b/hw/mips_jazz.c             |    1
 b/hw/mips_malta.c            |   13
 b/hw/mips_mipssim.c          |   11
 b/hw/mips_r4k.c              |    6
 b/hw/mipsnet.c               |   37 -
 b/hw/mm-serial.c             |  129 +++++
 b/hw/mm-serial.h             |   60 ++
 b/hw/mpc8544_guts.c          |   18
 b/hw/mst_fpga.c              |   23
 b/hw/musicpal.c              |  183 +++++--
 b/hw/nand.c                  |   37 -
 b/hw/ne2000-isa.c            |   34 -
 b/hw/ne2000.c                |   41 +
 b/hw/object.c                |  515 ++++++++++++++++++++
 b/hw/object.h                |  499 +++++++++++++++++++
 b/hw/omap_gpio.c             |   78 +--
 b/hw/omap_intc.c             |   70 +-
 b/hw/omap_uart.c             |    3
 b/hw/onenand.c               |   39 -
 b/hw/opencores_eth.c         |   35 -
 b/hw/openpic.c               |    5
 b/hw/parallel.c              |   34 -
 b/hw/pc.c                    |  101 ++--
 b/hw/pc.h                    |   70 --
 b/hw/pc_piix.c               |   64 +-
 b/hw/pci.c                   |  186 +++----
 b/hw/pci.h                   |   80 +--
 b/hw/pci_bridge.c            |    2
 b/hw/pcie.c                  |    2
 b/hw/pckbd.c                 |   22
 b/hw/pcnet-pci.c             |   43 +
 b/hw/pcnet.c                 |    2
 b/hw/petalogix_ml605_mmu.c   |    1
 b/hw/piix3.c                 |  198 +++++++
 b/hw/piix3.h                 |   37 +
 b/hw/piix4.c                 |   37 -
 b/hw/pl011.c                 |   38 +
 b/hw/pl022.c                 |   16
 b/hw/pl031.c                 |   23
 b/hw/pl041.c                 |   38 -
 b/hw/pl050.c                 |   42 +
 b/hw/pl061.c                 |   42 +
 b/hw/pl080.c                 |   46 +
 b/hw/pl110.c                 |   69 +-
 b/hw/pl181.c                 |   16
 b/hw/pl190.c                 |   25
 b/hw/ppc405_uc.c             |    1
 b/hw/ppc440.c                |    1
 b/hw/ppc4xx_pci.c            |    5
 b/hw/ppc_prep.c              |    9
 b/hw/ppce500_mpc8544ds.c     |    1
 b/hw/ppce500_pci.c           |   46 +
 b/hw/ppce500_spin.c          |   18
 b/hw/prep_pci.c              |    5
 b/hw/pxa2xx.c                |  109 +++-
 b/hw/pxa2xx_dma.c            |   33 -
 b/hw/pxa2xx_gpio.c           |   33 -
 b/hw/pxa2xx_pic.c            |   23
 b/hw/pxa2xx_timer.c          |   74 +-
 b/hw/qdev-monitor.c          |  495 +++++++++++++++++++
 b/hw/qdev-properties.c       |   50 -
 b/hw/qdev.c                  | 1085 +++++++++++++++++++++++--------------------
 b/hw/qdev.h                  |  370 +++++++++++++-
 b/hw/qxl.c                   |   70 +-
 b/hw/realview.c              |   18
 b/hw/realview_gic.c          |   17
 b/hw/rtl8139.c               |   47 +
 b/hw/s390-virtio-bus.c       |   25
 b/hw/sb16.c                  |   40 -
 b/hw/sbi.c                   |   23
 b/hw/scsi-bus.c              |  125 +++-
 b/hw/scsi-disk.c             |  177 ++++---
 b/hw/scsi-generic.c          |   41 +
 b/hw/scsi.h                  |   30 -
 b/hw/serial.c                |  366 ++------------
 b/hw/serial.h                |  172 ++++++
 b/hw/sga.c                   |   20
 b/hw/sh_pci.c                |   41 +
 b/hw/slavio_intctl.c         |   23
 b/hw/slavio_misc.c           |   41 +
 b/hw/slavio_timer.c          |   33 -
 b/hw/sm501.c                 |    1
 b/hw/smbus.c                 |   85 ++-
 b/hw/smbus.h                 |   39 +
 b/hw/smbus_eeprom.c          |   39 -
 b/hw/smc91c111.c             |   35 -
 b/hw/spapr_llan.c            |   45 +
 b/hw/spapr_pci.c             |   37 +
 b/hw/spapr_vio.c             |  100 ++-
 b/hw/spapr_vio.h             |   39 -
 b/hw/spapr_vscsi.c           |   39 -
 b/hw/spapr_vty.c             |   41 +
 b/hw/sparc32_dma.c           |   35 -
 b/hw/spitz.c                 |  110 ++--
 b/hw/ssd0303.c               |   37 -
 b/hw/ssd0323.c               |   20
 b/hw/ssi-sd.c                |   20
 b/hw/ssi.c                   |   39 +
 b/hw/ssi.h                   |   18
 b/hw/stellaris.c             |   71 ++
 b/hw/stellaris_enet.c        |   31 -
 b/hw/strongarm.c             |  148 ++++-
 b/hw/sun4c_intctl.c          |   23
 b/hw/sun4m.c                 |   92 ++-
 b/hw/sun4m_iommu.c           |   33 -
 b/hw/sun4u.c                 |   88 ++-
 b/hw/syborg_fb.c             |   31 -
 b/hw/syborg_interrupt.c      |   29 -
 b/hw/syborg_keyboard.c       |   29 -
 b/hw/syborg_pointer.c        |   31 -
 b/hw/syborg_rtc.c            |   16
 b/hw/syborg_serial.c         |   31 -
 b/hw/syborg_timer.c          |   29 -
 b/hw/syborg_virtio.c         |   41 +
 b/hw/sysbus.c                |   50 +
 b/hw/sysbus.h                |   23
 b/hw/tcx.c                   |   41 +
 b/hw/tmp105.c                |   41 -
 b/hw/tosa.c                  |   54 +-
 b/hw/tusb6010.c              |   21
 b/hw/twl92230.c              |   39 -
 b/hw/unin_pci.c              |  180 +++++--
 b/hw/usb-bt.c                |   35 -
 b/hw/usb-bus.c               |  203 ++++++--
 b/hw/usb-ccid.c              |  151 ++++-
 b/hw/usb-desc.c              |   18
 b/hw/usb-ehci.c              |   67 +-
 b/hw/usb-hid.c               |  116 ++--
 b/hw/usb-hub.c               |   37 -
 b/hw/usb-msd.c               |   56 +-
 b/hw/usb-net.c               |   52 +-
 b/hw/usb-ohci.c              |   76 +--
 b/hw/usb-serial.c            |   96 ++-
 b/hw/usb-uhci.c              |  205 +++++---
 b/hw/usb-uhci.h              |    2
 b/hw/usb-wacom.c             |   39 -
 b/hw/usb.c                   |   24
 b/hw/usb.h                   |   97 ++-
 b/hw/versatile_pci.c         |   58 +-
 b/hw/versatilepb.c           |   23
 b/hw/vga-isa.c               |   22
 b/hw/vga-pci.c               |   36 -
 b/hw/virtex_ml507.c          |    1
 b/hw/virtio-console.c        |   77 +--
 b/hw/virtio-net.c            |    2
 b/hw/virtio-pci.c            |  222 +++++---
 b/hw/virtio-serial-bus.c     |   98 ++-
 b/hw/virtio-serial.h         |   84 +--
 b/hw/vmmouse.c               |   34 -
 b/hw/vmport.c                |   20
 b/hw/vmware_vga.c            |   38 -
 b/hw/vmware_vga.h            |    6
 b/hw/vt82c686.c              |  136 +++--
 b/hw/wdt_i6300esb.c          |   37 -
 b/hw/wdt_ib700.c             |   22
 b/hw/wm8750.c                |   41 -
 b/hw/xen_platform.c          |   38 -
 b/hw/xilinx_axidma.c         |   31 -
 b/hw/xilinx_axienet.c        |   39 -
 b/hw/xilinx_ethlite.c        |   35 -
 b/hw/xilinx_intc.c           |   29 -
 b/hw/xilinx_timer.c          |   31 -
 b/hw/xilinx_uartlite.c       |   17
 b/hw/xio3130_downstream.c    |   63 +-
 b/hw/xio3130_upstream.c      |   57 +-
 b/hw/z2.c                    |   60 +-
 b/hw/zaurus.c                |   31 -
 b/monitor.h                  |    4
 b/qapi-schema.json           |  107 ++++
 b/qemu-common.h              |    1
 b/qerror.c                   |    4
 b/qerror.h                   |    3
 b/qmp-commands.hx            |   18
 b/qmp.c                      |   93 +++
 b/scripts/patch-monkey.py    |  130 +++++
 b/scripts/pm2.py             |  176 ++++++
 b/scripts/qapi-commands.py   |    1
 b/scripts/qapi-types.py      |    1
 b/usb-bsd.c                  |   29 -
 b/usb-linux.c                |   58 +-
 b/usb-redir.c                |   33 -
 hw/piix_pci.c                |  568 ----------------------
 291 files changed, 11875 insertions(+), 5338 deletions(-)



reply via email to

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