From patchwork Mon Jan 10 09:54:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 468261 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0A9t0hq008212 for ; Mon, 10 Jan 2011 09:55:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753174Ab1AJJy5 (ORCPT ); Mon, 10 Jan 2011 04:54:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24923 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752846Ab1AJJy4 (ORCPT ); Mon, 10 Jan 2011 04:54:56 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0A9sung024544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Jan 2011 04:54:56 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0A9st6N010681; Mon, 10 Jan 2011 04:54:55 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 3E3E5133F76; Mon, 10 Jan 2011 11:54:54 +0200 (IST) Date: Mon, 10 Jan 2011 11:54:54 +0200 From: Gleb Natapov To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] add bootindex parameter to assigned device Message-ID: <20110110095454.GB2202@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 (demeter1.kernel.org [140.211.167.41]); Mon, 10 Jan 2011 09:55:00 +0000 (UTC) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index e97f565..0038526 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -40,6 +40,7 @@ #include "monitor.h" #include "range.h" #include +#include "sysemu.h" /* From linux/ioport.h */ #define IORESOURCE_IO 0x00000100 /* Resource type */ @@ -1771,6 +1772,8 @@ static int assigned_initfn(struct PCIDevice *pci_dev) assigned_dev_load_option_rom(dev); QLIST_INSERT_HEAD(&devs, dev, next); + 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, @@ -1837,6 +1840,7 @@ static PCIDeviceInfo assign_info = { ASSIGNED_DEVICE_USE_IOMMU_BIT, true), DEFINE_PROP_BIT("prefer_msi", AssignedDevice, features, ASSIGNED_DEVICE_PREFER_MSI_BIT, true), + DEFINE_PROP_INT32("bootindex", AssignedDevice, bootindex, -1), DEFINE_PROP_STRING("configfd", AssignedDevice, configfd_name), DEFINE_PROP_END_OF_LIST(), }, diff --git a/hw/device-assignment.h b/hw/device-assignment.h index c94a730..86af0a9 100644 --- a/hw/device-assignment.h +++ b/hw/device-assignment.h @@ -111,6 +111,7 @@ typedef struct AssignedDevice { int mmio_index; int need_emulate_cmd; char *configfd_name; + int32_t bootindex; QLIST_ENTRY(AssignedDevice) next; } AssignedDevice;