From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUfqV-0004zi-0I for qemu-devel@nongnu.org; Thu, 09 Jun 2011 10:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUfqT-0003JG-Hh for qemu-devel@nongnu.org; Thu, 09 Jun 2011 10:04:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUfqT-0003JC-6C for qemu-devel@nongnu.org; Thu, 09 Jun 2011 10:04:25 -0400 Message-ID: <4DF0D392.30203@redhat.com> Date: Thu, 09 Jun 2011 16:07:14 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1307625358-20040-1-git-send-email-kwolf@redhat.com> <1307625358-20040-2-git-send-email-kwolf@redhat.com> <4DF0CA42.1080503@redhat.com> In-Reply-To: <4DF0CA42.1080503@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 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: Paolo Bonzini Cc: stefanha@gmail.com, armbru@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com Am 09.06.2011 15:27, schrieb Paolo Bonzini: > 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? I think you're right. We could enable it unconditionally (and change the bm->status line from = to |=), but anyway it's redundant if the subsections are present, so it wouldn't make a difference. Kevin