From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration Date: Tue, 29 Jul 2008 08:43:38 -0500 Message-ID: <488F1E8A.5050403@codemonkey.ws> References: <488EBEFC.5040603@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Paul Brook To: qemu-devel@nongnu.org Return-path: Received: from an-out-0708.google.com ([209.85.132.247]:1823 "EHLO an-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753960AbYG2NoM (ORCPT ); Tue, 29 Jul 2008 09:44:12 -0400 Received: by an-out-0708.google.com with SMTP id d40so991206and.103 for ; Tue, 29 Jul 2008 06:44:11 -0700 (PDT) In-Reply-To: <488EBEFC.5040603@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > > Signed-off-by: Chris Lalancette > > 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); > } > Looking at the code, I suspect it's really supposed to be a byte. Perhaps pbrook can clarify? Regards, Anthony Liguori > static int i2c_bus_load(QEMUFile *f, void *opaque, int version_id) >