From patchwork Mon Aug 30 16:32:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 63080 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 11872B6F0D for ; Tue, 31 Aug 2010 02:45:08 +1000 (EST) Received: from localhost ([127.0.0.1]:51291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7Tk-000539-A2 for incoming@patchwork.ozlabs.org; Mon, 30 Aug 2010 12:45:04 -0400 Received: from [140.186.70.92] (port=42444 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7Jg-0001zi-11 for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:34:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7HZ-00053N-0V for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41808) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7HY-000538-Mr for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:32:28 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWO58017382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 30 Aug 2010 12:32:24 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7UGWKtc029322; Mon, 30 Aug 2010 12:32:23 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 30 Aug 2010 18:32:25 +0200 Message-Id: <1283185953-30639-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1283185953-30639-1-git-send-email-kwolf@redhat.com> References: <1283185953-30639-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 02/10] virtio-blk: Fix migration of queued requests 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 in_sg[].iovec and out_sg[].ioved are pointer to (source) host memory and therefore invalid after migration. When loading the device state we must create a new mapping on the destination host. Signed-off-by: Kevin Wolf --- hw/virtio-blk.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index c3a7343..395eb9a 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -481,6 +481,11 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id) qemu_get_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem)); req->next = s->rq; s->rq = req; + + virtqueue_map_sg(req->elem.in_sg, req->elem.in_addr, + req->elem.in_num, 1); + virtqueue_map_sg(req->elem.out_sg, req->elem.out_addr, + req->elem.out_num, 0); } return 0;