From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJlxi-0003s4-5f for qemu-devel@nongnu.org; Fri, 06 Feb 2015 11:40:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJlxg-0000bH-Mo for qemu-devel@nongnu.org; Fri, 06 Feb 2015 11:40:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJlxg-0000b3-Eq for qemu-devel@nongnu.org; Fri, 06 Feb 2015 11:40:56 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t16Gesgl031759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 6 Feb 2015 11:40:55 -0500 From: Kevin Wolf Date: Fri, 6 Feb 2015 17:40:08 +0100 Message-Id: <1423240849-15499-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1423240849-15499-1-git-send-email-kwolf@redhat.com> References: <1423240849-15499-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 01/42] Restore atapi_dma flag across migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@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 Reviewed-by: John Snow Signed-off-by: Kevin Wolf --- 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; } -- 1.8.3.1