From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33118 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PruiM-00054H-4h for qemu-devel@nongnu.org; Tue, 22 Feb 2011 11:03:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PruiK-0007Yi-Gu for qemu-devel@nongnu.org; Tue, 22 Feb 2011 11:03:50 -0500 Received: from mail-vw0-f45.google.com ([209.85.212.45]:65305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PruiK-0007YR-EI for qemu-devel@nongnu.org; Tue, 22 Feb 2011 11:03:48 -0500 Received: by vws19 with SMTP id 19so2904478vws.4 for ; Tue, 22 Feb 2011 08:03:47 -0800 (PST) Message-ID: <4D63DE61.6050502@codemonkey.ws> Date: Tue, 22 Feb 2011 10:03:45 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/7] usb-ccid: add CCID bus References: <1297096503-12007-1-git-send-email-alevy@redhat.com> <1297096503-12007-2-git-send-email-alevy@redhat.com> In-Reply-To: <1297096503-12007-2-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org On 02/07/2011 10:34 AM, Alon Levy wrote: > +static int ccid_post_load(void *opaque, int version_id) > +{ > + USBCCIDState *s = opaque; > + > + // This must be done after usb_device_attach, which sets state to ATTACHED, > + // while it must be DEFAULT in order to accept packets (like it is after > + // reset, but reset will reset our addr and call our reset handler which > + // may change state, and we don't want to do that when migrating). > + s->dev.state = s->state_vmstate; > + return 0; > +} > + > +static void ccid_pre_save(void *opaque) > +{ > + USBCCIDState *s = opaque; > + > + s->state_vmstate = s->dev.state; > + if (s->dev.attached) { > + // migrating an open device, ignore reconnection CHR_EVENT to avoid an > + // erronous detach. > + s->migration_state = MIGRATION_MIGRATED; > + } > Still using C99 comments, should be C89. Regards, Anthony Liguori