[PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread Chris Lalancette
Attached is a simple patch to make i2c_bus_save() put a 32-bit quantity in the
save file, which matches what i2c_bus_load() expects to pull out of the save
file later.  Without this fix in place, KVM live migration fails since the
sender is only sending 1 byte while the receiver is waiting to receive 4 bytes.

Avi, I don't know when you plan to next rebase KVM to upstream QEMU, but it's
probably a good idea to carry this patch so that live migration works at all.

Signed-off-by: Chris Lalancette [EMAIL PROTECTED]
diff --git a/qemu/hw/i2c.c b/qemu/hw/i2c.c
index 5d283fb..f711db7 100644
--- a/qemu/hw/i2c.c
+++ b/qemu/hw/i2c.c
@@ -21,7 +21,7 @@ static void i2c_bus_save(QEMUFile *f, void *opaque)
 {
 i2c_bus *bus = (i2c_bus *)opaque;
 
-qemu_put_byte(f, bus-current_dev ? bus-current_dev-address : -1);
+qemu_put_be32(f, bus-current_dev ? bus-current_dev-address : -1);
 }
 
 static int i2c_bus_load(QEMUFile *f, void *opaque, int version_id)


Re: [PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread Avi Kivity

Chris Lalancette wrote:

Attached is a simple patch to make i2c_bus_save() put a 32-bit quantity in the
save file, which matches what i2c_bus_load() expects to pull out of the save
file later.  Without this fix in place, KVM live migration fails since the
sender is only sending 1 byte while the receiver is waiting to receive 4 bytes.

Avi, I don't know when you plan to next rebase KVM to upstream QEMU, but it's
probably a good idea to carry this patch so that live migration works at all.

  


I'll merge qemu upstream as soon as I see this go in.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread andrzej zaborowski
2008/7/29 Chris Lalancette [EMAIL PROTECTED]:
 Attached is a simple patch to make i2c_bus_save() put a 32-bit quantity in the
 save file, which matches what i2c_bus_load() expects to pull out of the save
 file later.  Without this fix in place, KVM live migration fails since the
 sender is only sending 1 byte while the receiver is waiting to receive 4 
 bytes.

Thanks, I committed this modified to use byte width afterall since the
addresses are 7-bit quantities, as noted by Anthony. Means that
existing snapshots are not invalidated.

Cheers
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread Paul Brook
On Tuesday 29 July 2008, andrzej zaborowski wrote:
 2008/7/29 Chris Lalancette [EMAIL PROTECTED]:
  Attached is a simple patch to make i2c_bus_save() put a 32-bit quantity
  in the save file, which matches what i2c_bus_load() expects to pull out
  of the save file later.  Without this fix in place, KVM live migration
  fails since the sender is only sending 1 byte while the receiver is
  waiting to receive 4 bytes.

 Thanks, I committed this modified to use byte width afterall since the
 addresses are 7-bit quantities.

No they aren't. I2C also supports 10-bit addressing.

Paul
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread andrzej zaborowski
2008/7/29 Paul Brook [EMAIL PROTECTED]:
 On Tuesday 29 July 2008, andrzej zaborowski wrote:
 2008/7/29 Chris Lalancette [EMAIL PROTECTED]:
  Attached is a simple patch to make i2c_bus_save() put a 32-bit quantity
  in the save file, which matches what i2c_bus_load() expects to pull out
  of the save file later.  Without this fix in place, KVM live migration
  fails since the sender is only sending 1 byte while the receiver is
  waiting to receive 4 bytes.

 Thanks, I committed this modified to use byte width afterall since the
 addresses are 7-bit quantities.

 No they aren't. I2C also supports 10-bit addressing.

Addresses in qemu are still = 8-bit, for example i2c_slave_load()
assumes this and current i2c api users do.

Regards
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration

2008-07-29 Thread Anthony Liguori

andrzej zaborowski wrote:

2008/7/29 Paul Brook [EMAIL PROTECTED]:
  

No they aren't. I2C also supports 10-bit addressing.



Addresses in qemu are still = 8-bit, for example i2c_slave_load()
assumes this and current i2c api users do.
  


But for the save/restore format, if the spec can support 10-bit 
addressing, then we should use be16s to avoid having to change 
save/restore format if we ever expand the supported address size.


Regards,

Anthony Liguori


Regards
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html