qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v5 0/6] Virtio refactoring.
@ 2012-12-04 14:35 fred.konrad
  2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 1/6] qdev : add a maximum device allowed field for the bus fred.konrad
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: fred.konrad @ 2012-12-04 14:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, aliguori, e.voevodin, mark.burton, stefanha,
	cornelia.huck, afaerber, fred.konrad

From: KONRAD Frederic <fred.konrad@greensocs.com>

I think the global structure is good as we discuted in the V4. So, I tried to
start device refactoring, and also made some little fix.

For the device refactoring, what are you suggesting for replacing
VirtIOBindings ?

Also, the virtio_pci_init_cb(..) currently use direct access to VirtIODevice,
can I just implement functions in virtio-bus to access the fields ?
( eg : get/set_nvectors ).

Finally, any idea on how I can make this patch-set for not breaking anything ?
The virtio-blk refactoring breaks all virtio-blk devices.

This patch-set is :
    * Introducing a virtio-bus which extends bus-state.
    * Implementing a virtio-pci-bus which extends virtio-bus.
    * Implementing a virtio-pci device which has a virtio-pci-bus.
    * Implementing virtio-device which extends device-states.
    * Implementing a virtio-blk which extends virtio-device.

The first patch is a modification of qdev-monitor.c, it forces the function
qbus_find_recursive(..) to return a non-full bus, and return an error if the
desired bus ( with "bus=" option ) is full. It add a max_dev field to the
bus_state structure. If max_dev=0 it has no limitation, if not the maximum
amount of device connected to the bus is max_dev.

Changes v4 -> v5:
    * use ERROR_CLASS_GENERIC_ERROR in place of creating a new error type for
      the maximum device limitation. ( Peter )
    * Removed bus_in_use function. We assume that the virtio-bus is not in use,
      when plugin in. ( Peter )
    * Added virtio_bus_destroy_device().
    * Implemented the exit function of virtio-pci.
    * Implemented the init callback for virtio-pci ( must be modified, it still
      access vdev directly. ).
    * Implemented the exit callback for virtio-pci.
    * Started virtio-device refactoring.
    * Started virtio-blk refactoring. 

Changes v3 -> v4:
    * Added virtio-bus.o in Makefile.objs ( accidentally dropped from v3 ).
    * *const* TypeInfo in virtio-bus.
    * Introduced virtio-pci-bus.
    * Reintroduced virtio-pci.
    * Introduced virtio-device.
    * Started virtio-blk refactoring.
    * Added an error type in qerror.h for the "bus full" error.

Changes v2 -> v3:
    * Added VirtioBusClass.
    * Renamed VirtioBus -> VirtioBusState.
    * Renamed qbus -> parent_obj.
    * Plug the device only in a non-full bus.

Changes v1 -> v2:
    * All the little fix you suggest ( License, Debug printf, naming convention,
      ...)
    * Added get_virtio_device_id(), and remove the pci_id* from the VirtioBus
      structure.
    * Added virtio_bus_reset().
    * Added cast macros VIRTIO_BUS.
    * Added virtio_bus_plug_device.
    * Replaced the old-style "bus->qbus" by BUS() macro.

Fred.

KONRAD Frederic (6):
  qdev : add a maximum device allowed field for the bus.
  virtio-bus : Introduce virtio-bus
  virtio-pci-bus : Introduce virtio-pci-bus.
  virtio-pci : Refactor virtio-pci device.
  virtio-device : Refactor virtio-device.
  virtio-blk : Refactor virtio-blk.

 hw/Makefile.objs  |   1 +
 hw/qdev-core.h    |   2 +
 hw/qdev-monitor.c |  11 ++++
 hw/virtio-blk.c   | 170 ++++++++++++++++++++++++++++++++++++++++++++++--------
 hw/virtio-blk.h   |   4 ++
 hw/virtio-bus.c   | 111 +++++++++++++++++++++++++++++++++++
 hw/virtio-bus.h   |  76 ++++++++++++++++++++++++
 hw/virtio-pci.c   | 149 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/virtio-pci.h   |  33 ++++++++++-
 hw/virtio.c       |  56 ++++++++++++++++++
 hw/virtio.h       |  29 ++++++++++
 11 files changed, 616 insertions(+), 26 deletions(-)
 create mode 100644 hw/virtio-bus.c
 create mode 100644 hw/virtio-bus.h

-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2012-12-06 14:48 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 14:35 [Qemu-devel] [RFC PATCH v5 0/6] Virtio refactoring fred.konrad
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 1/6] qdev : add a maximum device allowed field for the bus fred.konrad
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 2/6] virtio-bus : Introduce virtio-bus fred.konrad
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 3/6] virtio-pci-bus : Introduce virtio-pci-bus fred.konrad
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 4/6] virtio-pci : Refactor virtio-pci device fred.konrad
2012-12-04 14:49   ` Peter Maydell
2012-12-04 15:52     ` KONRAD Frédéric
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 5/6] virtio-device : Refactor virtio-device fred.konrad
2012-12-04 14:55   ` Peter Maydell
2012-12-04 15:55     ` KONRAD Frédéric
2012-12-04 14:35 ` [Qemu-devel] [RFC PATCH v5 6/6] virtio-blk : Refactor virtio-blk fred.konrad
2012-12-05 16:25   ` Peter Maydell
2012-12-05 17:22     ` Andreas Färber
2012-12-06  9:21       ` KONRAD Frédéric
2012-12-06  9:53         ` Andreas Färber
2012-12-06 10:10           ` KONRAD Frédéric
2012-12-06 10:13           ` Peter Maydell
2012-12-06 13:58             ` KONRAD Frédéric
2012-12-06 14:21               ` Peter Maydell
2012-12-06 14:48                 ` KONRAD Frédéric
2012-12-06  9:11     ` KONRAD Frédéric
2012-12-06  9:18       ` Andreas Färber
2012-12-06  9:23         ` KONRAD Frédéric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).