From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNj9M-0001az-Qn for qemu-devel@nongnu.org; Tue, 29 Jul 2008 02:57:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNj9K-0001an-Gf for qemu-devel@nongnu.org; Tue, 29 Jul 2008 02:57:35 -0400 Received: from [199.232.76.173] (port=38092 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNj9K-0001ak-9D for qemu-devel@nongnu.org; Tue, 29 Jul 2008 02:57:34 -0400 Received: from mx20.gnu.org ([199.232.41.8]:59995) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KNj9J-00057j-FI for qemu-devel@nongnu.org; Tue, 29 Jul 2008 02:57:33 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KNj9I-0003hW-Hx for qemu-devel@nongnu.org; Tue, 29 Jul 2008 02:57:32 -0400 Message-ID: <488EBEFC.5040603@redhat.com> Date: Tue, 29 Jul 2008 08:55:56 +0200 From: Chris Lalancette MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020904050905020503090104" Subject: [Qemu-devel] [PATCH]: Fix i2c_bus_save, which fixes KVM live migration Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org This is a multi-part message in MIME format. --------------020904050905020503090104 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --------------020904050905020503090104 Content-Type: text/x-patch; name="qemu-i2c-migrate-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-i2c-migrate-fix.patch" 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) --------------020904050905020503090104--