From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bD6-0007aE-6G for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:15:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9bD3-0006dC-0a for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:15:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9bD2-0006c5-R9 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:15:16 -0500 Message-ID: <1450368912.5981.17.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 17 Dec 2015 17:15:12 +0100 In-Reply-To: <1490778.HifHfFmj7O@hydra> References: <1664220.kcr3K9QWbf@dabox> <56585242.3050501@redhat.com> <1515037.S0cnTfez5T@hydra> <1490778.HifHfFmj7O@hydra> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] i2c-tiny-usb: add new usb to i2c bridge List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tim Sander Cc: Paolo Bonzini , Alex =?ISO-8859-1?Q?Benn=E9e?= , qemu-devel@nongnu.org, Markus Armbruster > + case 0x4107: > + { > + int i; > + /* this seems to be a byte type access */ > + if (i2c_start_transfer(s->i2cbus, /*address*/index, 0)) { > + trace_usb_i2c_tiny_i2c_start_transfer_failed(); > + p->actual_length =3D 0; /* write failure */ > + break; > + } > + for (i =3D 0; i < length; i++) { > + trace_usb_i2c_tiny_write(request, index, i, data[i]); > + i2c_send(s->i2cbus, data[i]); > + } > + p->actual_length =3D length; > + i2c_end_transfer(s->i2cbus); > + } > + break; Braces look a bit displaced. How about moving the "int i"; to the start of the function and drop the braces then? > +static const VMStateDescription vmstate_usb_i2c =3D { > + .name =3D "usb-i2c-tiny", > + .unmigratable =3D 1, I think you can drop the unmigratable line, or replace with /* nothing */ to make clear it is intentionally empty. The device is so simple that there is no state to save. Being migrated with a half-done i2c transaction isn't possible too. So it should survive migration just fine. Otherwise looks good. cheers, Gerd