Received: from [140.186.70.92] (port=59767 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOWm6-0001QK-T1 for qemu-devel@nongnu.org; Tue, 15 Jun 2010 10:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOWlu-0005He-0E for qemu-devel@nongnu.org; Tue, 15 Jun 2010 10:05:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36540) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOWlt-0005HQ-ML for qemu-devel@nongnu.org; Tue, 15 Jun 2010 10:05:45 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5FE5iRk028621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jun 2010 10:05:45 -0400 From: Juan Quintela In-Reply-To: <4C178750.2080109@redhat.com> (Avi Kivity's message of "Tue, 15 Jun 2010 16:59:44 +0300") References: <31e7e4aefc644057186f501bfef4584d337a4d9c.1276607973.git.quintela@redhat.com> <4C178750.2080109@redhat.com> Date: Tue, 15 Jun 2010 16:05:42 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 5/5] ide: fix migration in the middle of a bmdma transfer List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org Avi Kivity wrote: > On 06/15/2010 04:31 PM, Juan Quintela wrote: >> +static bool ide_bmdma_current_needed(void *opaque) >> +{ >> + BMDMAState *bm = opaque; >> + >> + return (bm->cur_prd_len != 0); >> +} >> + >> +static const VMStateDescription vmstate_bmdma_current = { >> + .name = "ide bmdma_current", >> + .version_id = 1, >> + .minimum_version_id = 1, >> + .minimum_version_id_old = 1, >> > > Can we allow these to default to 0? Most subsections (and most new > sections) won't need version numbers. It is not clear for all if default value is 0 or 1. (not consistent). We can put it as 0. >> + .fields = (VMStateField []) { >> + VMSTATE_UINT32(cur_addr, BMDMAState), >> + VMSTATE_UINT32(cur_prd_last, BMDMAState), >> + VMSTATE_UINT32(cur_prd_addr, BMDMAState), >> + VMSTATE_UINT32(cur_prd_len, BMDMAState), >> + VMSTATE_END_OF_LIST() >> + } >> +}; >> + >> + >> static const VMStateDescription vmstate_bmdma = { >> .name = "ide bmdma", >> .version_id = 3, >> @@ -134,6 +156,14 @@ static const VMStateDescription vmstate_bmdma = { >> VMSTATE_UINT32(nsector, BMDMAState), >> VMSTATE_UINT8(unit, BMDMAState), >> VMSTATE_END_OF_LIST() >> + }, >> + .subsections = (VMStateSubsection []) { >> + { >> + .vmsd =&vmstate_bmdma_current, >> + .needed = ide_bmdma_current_needed, >> + }, { >> + /* empty */ >> + } >> } >> }; >> > > Looks concise and simple.