From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyPJk-0006rJ-IV for qemu-devel@nongnu.org; Tue, 09 Dec 2014 13:15:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyPJZ-00070f-Uw for qemu-devel@nongnu.org; Tue, 09 Dec 2014 13:15:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyPJZ-00070V-Nw for qemu-devel@nongnu.org; Tue, 09 Dec 2014 13:15:13 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB9IFCeC031242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 9 Dec 2014 13:15:13 -0500 From: "Dr. David Alan Gilbert (git)" Date: Tue, 9 Dec 2014 18:15:08 +0000 Message-Id: <1418148909-19870-2-git-send-email-dgilbert@redhat.com> In-Reply-To: <1418148909-19870-1-git-send-email-dgilbert@redhat.com> References: <1418148909-19870-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] Restore atapi_dma flag across migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, jsnow@redhat.com From: "Dr. David Alan Gilbert" If a migration happens just after the guest has kicked off an ATAPI command and kicked off DMA, we lose the atapi_dma flag, and the destination tries to complete the command as PIO rather than DMA. This upsets Linux; modern libata based kernels stumble and recover OK, older kernels end up passing bad data to userspace. Signed-off-by: Dr. David Alan Gilbert --- hw/ide/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index d4af5e2..ac3f015 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2417,6 +2417,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id) s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx]; s->data_ptr = s->io_buffer + s->cur_io_buffer_offset; s->data_end = s->data_ptr + s->cur_io_buffer_len; + s->atapi_dma = s->feature & 1; /* as per cmd_packet */ return 0; } -- 2.1.0