qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 00/26] Indirection Cleanup
Date: Mon, 24 Aug 2009 18:42:34 +0200	[thread overview]
Message-ID: <cover.1251131364.git.quintela@redhat.com> (raw)


Hi

v2:
- fix comment missmerge in eepro100 (Stefan Weil)
- add dev.qdev hint instead of double DO_UPCAST on lsi (Kraxel)
- usb-ohci: not everything is pci.  Add PCI state only to the pci part
  (Kraxel)
- ne2000: Don't force pci bits into isa devices (make Kraxel happy)
- ne2000: split isa and pci save/load functions.  From now, isa parts
  are only the common ones.
- cirrus_vga: Don't force pci bits into isa device (make Kraxel happy)
- pcnet: Add it here, split save/load function between pci and generic.
- e1000 cleanup: Add it to the series (was sent alone), just for easy tracking.
- drop es1370 bits: malc already integrated it.

ToDo:
- vga: It needs to have a separate VGAState and VGACommonState.  And make clear
  what is shared and what no (convince cirrus_vga, vmware_vga and blizzard
  to use same/similar subset).

Later, Juan.

v1:

This patch series clean up "half" converted qemu drivers that had changed from:

struct FOOState

to

typedef PCIFOOState {
    PCIDevice dev;
    FOOState foo;
} PCIFOOState;

It just moves PCIDevice to be the 1st field of FOOState.

Once there, other cleanups were done:
a - pci_dev pointer from FOOState to PCIFOOState is removed, jsut use s->dev
    The field is leave only in the drivers that also emulate isa.
b- Once there, transformo
   PCIFOOState *s = (PCIFOOState *)pci_dev
   to
   PCIFOOState *s = DO_UPCAST(PCIFOOState, dev, pci_dev)
   where pci_dev is a PCI_DEVICE.
c- again, once there, remove all the casts from void * (they are not
   needed since '89)
   PCIFOOState *s = (PCIFOOState *)opaque;
   to
   PCIFOOState *s = opaque;
d- Start of vga.c cleanup.  It is not trivial, as just now
   VGAState == VGACommonState, functions need to be changed to use the right value.

ToDo:
- pcnet:  It needs a different approach, because it can be both a PCIDevice
  or a SysBus device.
- vga: It have to separate the common part for the not common part, problems now
  is that VGAState is used for both the common state and the standard vga.
  To make things more interesting, different bits are "inherited" from vga
  in different devices:
  - cirrus_vga
  - vmware_vga
  - blizzard (vga that is not pci)
  - vga common state has a pci_dev pointer, that is only needed by std vga,
    as cirrus_vga stores it (with this patches) otherplace, blizzard is not pci
    .... you get the idea
- I guess some other driver is missing, but my fast grep didn't found it.

Later, Juan.

*** BLURB HERE ***

Juan Quintela (26):
  eepro100: convert casts to DO_UPCAST()
  eepro100: cast a void * makes no sense
  eepro100: Remove unused indirection of PCIDevice
  pci: remove casts from void *
  rtl8139: Remove unneeded double indirection of PCIRTL8139State
  rtl8139: remove pointless cast from void *
  lsi53c895a: remove pointless cast from void *
  lsi53c895a: use DO_UPCAST to cast from PCIDevice
  lsi53c895a: rename PCIDevice field from pci_dev to dev (consistence)
  lsi53c895a: LSIState is a PCIDevice is a DeviceHost
  Introduce vga_common_reset() to be able to typcheck vga_reset()
  vga: Rename vga_state -> vga
  Everything outside of vga.c should use VGACommonState
  usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState
  ne2000: remove casts from void *
  ne2000: pci_dev has this very value with the right type
  ne2000: Change casts to DO_UPCAST() for PCINE2000State
  We need PCINE2000State for save/load functions
  Add pci_ne2000_{save/load} functions, then remove pci_dev NE2000State
    field
  cirrus_vga: remove pointless cast from void *
  cirrus_vga: Change casts to DO_UPCAST() for PCICirrusVGAState
  Add pci_cirrus_vga_{save/load} functions, then remove vga.pci_dev use
  pcnet: Change casts to DO_UPCAST() for PCIPCNetState
  pcnet: remove useless casts This are casts to the very type of the
    function
  pcnet: Add pci_pcnet_{save/load} functions, then remove PCNetState
    pci_dev field
  e1000 cleanup

 hw/cirrus_vga.c |   69 +++++++++++++++++++++++++++++++++---------------------
 hw/e1000.c      |   10 ++++----
 hw/eepro100.c   |   63 ++++++++++++++++++++-----------------------------
 hw/lsi53c895a.c |   64 +++++++++++++++++++++++++-------------------------
 hw/ne2000.c     |   61 +++++++++++++++++++++++++++++-------------------
 hw/pci.c        |    8 +++---
 hw/pcnet.c      |   59 ++++++++++++++++++++++++++++------------------
 hw/rtl8139.c    |   42 ++++++++++++---------------------
 hw/usb-ohci.c   |    7 +++--
 hw/vga.c        |   26 ++++++++++++--------
 hw/vga_int.h    |   12 ++++-----
 hw/vmware_vga.c |    4 +-
 12 files changed, 224 insertions(+), 201 deletions(-)

             reply	other threads:[~2009-08-24 16:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-24 16:42 Juan Quintela [this message]
2009-08-24 16:42 ` [Qemu-devel] [PATCH 01/26] eepro100: convert casts to DO_UPCAST() Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 02/26] eepro100: cast a void * makes no sense Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 03/26] eepro100: Remove unused indirection of PCIDevice Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 04/26] pci: remove casts from void * Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 05/26] rtl8139: Remove unneeded double indirection of PCIRTL8139State Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 06/26] rtl8139: remove pointless cast from void * Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 07/26] lsi53c895a: " Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 08/26] lsi53c895a: use DO_UPCAST to cast from PCIDevice Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 09/26] lsi53c895a: rename PCIDevice field from pci_dev to dev (consistence) Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 10/26] lsi53c895a: LSIState is a DeviceHost Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 11/26] Introduce vga_common_reset() to be able to typcheck vga_reset() Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 12/26] vga: Rename vga_state -> vga Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 13/26] Everything outside of vga.c should use VGACommonState Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 14/26] usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 15/26] ne2000: remove casts from void * Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 16/26] ne2000: pci_dev has this very value with the right type Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 17/26] ne2000: Change casts to DO_UPCAST() for PCINE2000State Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 18/26] We need PCINE2000State for save/load functions Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 19/26] Add pci_ne2000_{save/load} functions, then remove pci_dev NE2000State field Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 20/26] cirrus_vga: remove pointless cast from void * Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 21/26] cirrus_vga: Change casts to DO_UPCAST() for PCICirrusVGAState Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 22/26] Add pci_cirrus_vga_{save/load} functions, then remove vga.pci_dev use Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 23/26] pcnet: Change casts to DO_UPCAST() for PCIPCNetState Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 24/26] pcnet: remove useless casts This are casts to the very type of the function Juan Quintela
2009-08-24 16:42 ` [Qemu-devel] [PATCH 25/26] pcnet: Add pci_pcnet_{save/load} functions, then remove PCNetState pci_dev field Juan Quintela
2009-08-24 16:43 ` [Qemu-devel] [PATCH 26/26] e1000 cleanup Juan Quintela
2009-08-25  8:22 ` [Qemu-devel] [PATCH 00/26] Indirection Cleanup Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1251131364.git.quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).