From patchwork Wed Jan 20 16:22:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 43308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6FBD5B7CC2 for ; Thu, 21 Jan 2010 03:39:22 +1100 (EST) Received: from localhost ([127.0.0.1]:40834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXdZw-0007Xl-69 for incoming@patchwork.ozlabs.org; Wed, 20 Jan 2010 11:38:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXdKd-0001wP-CV for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:22:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXdKY-0001rH-Fh for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:22:58 -0500 Received: from [199.232.76.173] (port=39733 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXdKY-0001r0-8I for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:22:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27440) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXdKX-0005k1-SE for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:22:54 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGMmNI017893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jan 2010 11:22:48 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGMkOJ010763; Wed, 20 Jan 2010 11:22:47 -0500 Received: from amt.cnet (vpn-9-48.rdu.redhat.com [10.11.9.48]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGMjZ0014396; Wed, 20 Jan 2010 11:22:46 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 3504E6520EA; Wed, 20 Jan 2010 14:22:30 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o0KGMSmD015211; Wed, 20 Jan 2010 14:22:28 -0200 Date: Wed, 20 Jan 2010 14:22:28 -0200 From: Marcelo Tosatti To: qemu-devel@nongnu.org Message-ID: <20100120162228.GB14374@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Avi Kivity , Juan Quintela Subject: [Qemu-devel] [PATCH] ide save/restore current transfer fields X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If migration takes place between write of the bmdma address register and write of the command register (to initiate DMA), the destination will not properly start the DMA op, hanging the guest: ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen ata1.00: cmd c8/00:16:41:00:00/00:00:00:00:00/e0 tag 0 dma 11264 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata1.00: status: { DRDY } Fix by sending current transfer information in the migration data. Signed-off-by: Marcelo Tosatti diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 780fc5f..9f245ed 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -133,6 +135,10 @@ static const VMStateDescription vmstate_bmdma = { VMSTATE_INT64(sector_num, BMDMAState), VMSTATE_UINT32(nsector, BMDMAState), VMSTATE_UINT8(unit, BMDMAState), + 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() } };