From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUfGy-00071m-0I for qemu-devel@nongnu.org; Thu, 09 Jun 2011 09:27:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUfGr-000555-Hb for qemu-devel@nongnu.org; Thu, 09 Jun 2011 09:27:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUfGq-00054n-St for qemu-devel@nongnu.org; Thu, 09 Jun 2011 09:27:37 -0400 Message-ID: <4DF0CA42.1080503@redhat.com> Date: Thu, 09 Jun 2011 15:27:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1307625358-20040-1-git-send-email-kwolf@redhat.com> <1307625358-20040-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1307625358-20040-2-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] ide: Split error status from status register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: stefanha@gmail.com, armbru@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com On 06/09/2011 03:15 PM, Kevin Wolf wrote: > +/* This function accesses bm->bus->error_status which is loaded only after > + * BMDMA itself. This is why the function is called from ide_pci_post_load > + * instead of being registered with VMState where it would run too early. */ > +static int ide_bmdma_post_load(void *opaque, int version_id) > +{ > + BMDMAState *bm = opaque; > + uint8_t abused_bits = BM_MIGRATION_COMPAT_STATUS_BITS; > + > + if (bm->status == 0) { > + bm->status = bm->migration_compat_status& ~abused_bits; > + bm->bus->error_status |= bm->migration_compat_status& abused_bits; > + } > + > + return 0; > +} > + Why the if? Otherwise looks good. Paolo