All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 00/20] VMState: port all i2c devices
Date: Fri, 11 Sep 2009 12:10:20 +0200	[thread overview]
Message-ID: <cover.1252662256.git.quintela@redhat.com> (raw)

Hi

This patch is on top of my previous series:

     [PATCH 00/26] VMState: port several pc devices to vmstate

This ports all i2c_devices to vmstate.  Big changes:

- i2c->address now are uint8_t, my review of all uses is that they are always
  used as uint8_t (and that is the type that is passed on the value).  If you know
  i2c, please check.  Change 0002 looks big, but it is because as I was
  auditing the paths, I changed the types of the functios to reflect that they
  use uint8_t.  Real part of the patch is changing the struct definitions.

- qdev: there was not support for uint8_t (the i2c addresses) in qdev, now it is
  I missed this change in my 1st pass (on mips_malta)

-        qdev_prop_set_uint32(eeprom, "address", 0x50 + i);
+        qdev_prop_set_uint8(eeprom, "address", 0x50 + i);

  And qdev complained during compilation.  qdev++

- I had to fix lots of places where values of one type were sent with a different
  type.  qemu_put_byte/qemu_put_be16/qemu_put_be32 should be just baned.  Yesterday.

- tmp105: We have a winner, the 1st user of post_save().
  Can anyone explain me what we need to do _anything_ after saving

     s->faults = tmp105_faultq[(s->config >> 3) & 3];		/* F */
  I can't see why saving have to change faults, and no, I don't understand what
  that line does.

- twl922230: here we go.
  It pass all the fields of a struct tm (they are ints) as uint16_t.
  All solutions are bad (tm):
  * marshalling the struct tm in a struct tm_16bits fields, and use normal vmstate
  * up version and declare all previous versions baned.  No forward migration
    for you.
  * Do the hack that I did, new type:
     vmstate_hack_int32_as_uint16
    local to that function, and be done with it.  It is a big hack, but the
    function were already abusing the format.

- lm832x: I got an unused command (0xff) to be send as an error.  it was using an
  int, -1 means an error, and a small number meaned a command.  As the numbers of
  commands is very limited, I think this is the best solution.  Notice that
  we were doing this already when we saved/loaded the value.  Name the constant
  instead of -1 to make things easier.

- vmstate arrays shortened the save/load code for this series _a lot_.

Comments?  Test and reports from arm users are welcome (the only use of i2c
in a pc is for smbus-eeprom, and it is a _very_ limited use).

Later, Juan.

Juan Quintela (20):
  qdev: Add support for uint8_t
  i2c: addresses are load/save as uint8_t values, change types to
    reflect this
  vmstate: port i2c_bus device
  vmstate: port i2c_slave device
  vmstate: add uint8 array
  vmstate: create VMSTATE_I2C_SLAVE
  vmstate: port wm8750 device
  vmstate: port max7310 device
  vmstate: create VMSTATE_STRUCT_POINTER
  vmstate: port pxa2xx_i2c device
  vmstate: port ssd0303 device
  vmstate: create VMSTATE_INT16_ARRAY
  tmp105: change len and alorm to uint8_t
  vmstate: port wmp105 device
  twl92230: change pwrbtn_state to uint8_t
  vmstate: port twl92230 device
  vmstate: add support for arrays of pointers
  lm832x: make fields to have the same types that they are saved/loaded
  vmstate: port lm832x device
  vmstate: remove i2c_slave_load/save

 hw/hw.h              |   47 ++++++++++++
 hw/i2c.c             |   64 ++++++++++------
 hw/i2c.h             |   10 +--
 hw/lm832x.c          |  148 +++++++++++++++----------------------
 hw/max7310.c         |   51 +++++--------
 hw/mips_malta.c      |    2 +-
 hw/pc.c              |    2 +-
 hw/pxa2xx.c          |   54 +++++++-------
 hw/qdev-properties.c |   33 ++++++++
 hw/qdev.h            |    5 +
 hw/smbus.c           |   18 ++--
 hw/smbus.h           |   18 ++--
 hw/ssd0303.c         |   65 ++++++-----------
 hw/tmp105.c          |   60 +++++++--------
 hw/twl92230.c        |  200 ++++++++++++++++++++++----------------------------
 hw/wm8750.c          |  120 +++++++++++-------------------
 savevm.c             |    3 +
 17 files changed, 438 insertions(+), 462 deletions(-)

             reply	other threads:[~2009-09-11 10:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 10:10 Juan Quintela [this message]
2009-09-11 10:10 ` [Qemu-devel] [PATCH 01/20] qdev: Add support for uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 02/20] i2c: addresses are load/save as uint8_t values, change types to reflect this Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 03/20] vmstate: port i2c_bus device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 04/20] vmstate: port i2c_slave device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 05/20] vmstate: add uint8 array Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 06/20] vmstate: create VMSTATE_I2C_SLAVE Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 07/20] vmstate: port wm8750 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 08/20] vmstate: port max7310 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 09/20] vmstate: create VMSTATE_STRUCT_POINTER Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 10/20] vmstate: port pxa2xx_i2c device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 11/20] vmstate: port ssd0303 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 12/20] vmstate: create VMSTATE_INT16_ARRAY Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 13/20] tmp105: change len and alorm to uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 14/20] vmstate: port wmp105 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 15/20] twl92230: change pwrbtn_state to uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 16/20] vmstate: port twl92230 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 17/20] vmstate: add support for arrays of pointers Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 18/20] lm832x: make fields to have the same types that they are saved/loaded Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 19/20] vmstate: port lm832x device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 20/20] vmstate: remove i2c_slave_load/save Juan Quintela
2009-09-11 10:31 ` [Qemu-devel] [PATCH 00/20] VMState: port all i2c devices Juha.Riihimaki
2009-09-11 10:47   ` [Qemu-devel] " Juan Quintela
2009-09-12 17:49     ` Juha.Riihimaki
2009-09-13 22:35       ` Juan Quintela

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.1252662256.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.