From patchwork Wed Aug 31 11:57:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 1115682 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7VBw85X020054 for ; Wed, 31 Aug 2011 11:58:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755248Ab1HaL6H (ORCPT ); Wed, 31 Aug 2011 07:58:07 -0400 Received: from thoth.sbs.de ([192.35.17.2]:18728 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755001Ab1HaL6F (ORCPT ); Wed, 31 Aug 2011 07:58:05 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id p7VBvv4x010122; Wed, 31 Aug 2011 13:57:57 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p7VBvumq006060; Wed, 31 Aug 2011 13:57:56 +0200 Message-ID: <4E5E21C4.9000408@siemens.com> Date: Wed, 31 Aug 2011 13:57:56 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity , Marcelo Tosatti CC: kvm , Alex Williamson Subject: [PATCH] pci-assign: Use declarative interface to prevent migration Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 31 Aug 2011 11:58:08 +0000 (UTC) Signed-off-by: Jan Kiszka --- hw/device-assignment.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/hw/device-assignment.c b/hw/device-assignment.c index bfa0edf..288f80c 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1523,9 +1523,7 @@ static void assigned_dev_unregister_msix_mmio(AssignedDevice *dev) static const VMStateDescription vmstate_assigned_device = { .name = "pci-assign", - .fields = (VMStateField []) { - VMSTATE_END_OF_LIST() - } + .unmigratable = 1, }; static void reset_assigned_device(DeviceState *dev) @@ -1643,11 +1641,6 @@ static int assigned_initfn(struct PCIDevice *pci_dev) add_boot_device_path(dev->bootindex, &pci_dev->qdev, NULL); - /* Register a vmsd so that we can mark it unmigratable. */ - vmstate_register(&dev->dev.qdev, 0, &vmstate_assigned_device, dev); - register_device_unmigratable(&dev->dev.qdev, - vmstate_assigned_device.name, dev); - return 0; assigned_out: @@ -1661,7 +1654,6 @@ static int assigned_exitfn(struct PCIDevice *pci_dev) { AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); - vmstate_unregister(&dev->dev.qdev, &vmstate_assigned_device, dev); QLIST_REMOVE(dev, next); deassign_device(dev); free_assigned_device(dev); @@ -1698,6 +1690,7 @@ static PCIDeviceInfo assign_info = { .qdev.name = "pci-assign", .qdev.desc = "pass through host pci devices to the guest", .qdev.size = sizeof(AssignedDevice), + .qdev.vmsd = &vmstate_assigned_device, .qdev.reset = reset_assigned_device, .init = assigned_initfn, .exit = assigned_exitfn,