From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50912 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsGMG-0003NN-1K for qemu-devel@nongnu.org; Wed, 23 Feb 2011 10:10:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsGME-00053H-Me for qemu-devel@nongnu.org; Wed, 23 Feb 2011 10:10:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsGME-00052u-CG for qemu-devel@nongnu.org; Wed, 23 Feb 2011 10:10:26 -0500 Date: Wed, 23 Feb 2011 17:10:14 +0200 From: Alon Levy Subject: Re: [Qemu-devel] [PATCH 1/7] usb-ccid: add CCID bus Message-ID: <20110223151013.GD17614@playa.tlv.redhat.com> References: <1297096503-12007-1-git-send-email-alevy@redhat.com> <1297096503-12007-2-git-send-email-alevy@redhat.com> <4D63DE61.6050502@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D63DE61.6050502@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org On Tue, Feb 22, 2011 at 10:03:45AM -0600, Anthony Liguori wrote: > 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. Fixed (by checkpatch.pl iteration) in v20. > > Regards, > > Anthony Liguori >