From patchwork Mon Jul 4 12:08:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonit Halperin X-Patchwork-Id: 103096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0E58BB6F68 for ; Mon, 4 Jul 2011 22:33:58 +1000 (EST) Received: from localhost ([::1]:42382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdiLa-0002HF-Ls for incoming@patchwork.ozlabs.org; Mon, 04 Jul 2011 08:33:54 -0400 Received: from eggs.gnu.org ([140.186.70.92]:56608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdi9j-0000AT-CN for qemu-devel@nongnu.org; Mon, 04 Jul 2011 08:21:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qdi9h-0004eu-QL for qemu-devel@nongnu.org; Mon, 04 Jul 2011 08:21:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qdhve-0002M3-FE for qemu-devel@nongnu.org; Mon, 04 Jul 2011 08:07:06 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p64C755d032498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Jul 2011 08:07:05 -0400 Received: from dhcp-0-9.tlv.redhat.com (dhcp-3-166.tlv.redhat.com [10.35.3.166]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p64C732u000803; Mon, 4 Jul 2011 08:07:03 -0400 From: Yonit Halperin To: qemu-devel@nongnu.org Date: Mon, 4 Jul 2011 15:08:01 +0300 Message-Id: <1309781281-31000-1-git-send-email-yhalperi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: spice-devel@lists.freedesktop.org, Yonit Halperin , kraxel@redhat.com Subject: [Qemu-devel] [PATCHv3] qxl: make sure primary surface is saved on migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org --- hw/qxl.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 2bb36c6..b3a3507 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1165,11 +1165,14 @@ static void qxl_vm_change_state_handler(void *opaque, int running, int reason) qemu_spice_vm_change_state_handler(&qxl->ssd, running, reason); if (!running && qxl->mode == QXL_MODE_NATIVE) { - /* dirty all vram (which holds surfaces) to make sure it is saved */ + /* dirty all vram (which holds surfaces) and devram (primary surface) + * to make sure they are saved */ /* FIXME #1: should go out during "live" stage */ /* FIXME #2: we only need to save the areas which are actually used */ - ram_addr_t addr = qxl->vram_offset; - qxl_set_dirty(addr, addr + qxl->vram_size); + ram_addr_t vram_addr = qxl->vram_offset; + ram_addr_t surface0_addr = qxl->vga.vram_offset + qxl->shadow_rom.draw_area_offset; + qxl_set_dirty(vram_addr, vram_addr + qxl->vram_size); + qxl_set_dirty(surface0_addr, surface0_addr + qxl->shadow_rom.surface0_area_size); } }