From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38845) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZME1-0003G6-Q8 for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:44:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZMDy-0001ac-O8 for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:44:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZMDy-0001aS-Gm for qemu-devel@nongnu.org; Fri, 16 Nov 2012 08:44:50 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAGDinJg007462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 Nov 2012 08:44:50 -0500 From: Gerd Hoffmann Date: Fri, 16 Nov 2012 14:44:34 +0100 Message-Id: <1353073487-19233-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1353073487-19233-1-git-send-email-kraxel@redhat.com> References: <1353073487-19233-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 01/14] fix live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann , Avi Kivity Commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d breaks live migration. DMA stops working for ehci (and probably for any pci device) after restoring the guest because the bus master region never gets enabled. Add code doing that after loading the pci config space from vmstate. Cc: Avi Kivity Cc: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/pci.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index dceda0b..9841e39 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -367,6 +367,10 @@ static int get_pci_config_device(QEMUFile *f, void *pv, size_t size) pci_update_mappings(s); + memory_region_set_enabled(&s->bus_master_enable_region, + pci_get_word(s->config + PCI_COMMAND) + & PCI_COMMAND_MASTER); + g_free(config); return 0; } -- 1.7.1