From patchwork Wed Nov 10 17:14:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 70660 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 350E2B70EA for ; Thu, 11 Nov 2010 04:38:26 +1100 (EST) Received: from localhost ([127.0.0.1]:34159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGEcp-00043O-Lf for incoming@patchwork.ozlabs.org; Wed, 10 Nov 2010 12:38:23 -0500 Received: from [140.186.70.92] (port=42560 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGEFh-00016v-Sc for qemu-devel@nongnu.org; Wed, 10 Nov 2010 12:14:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGEFe-0005BR-K3 for qemu-devel@nongnu.org; Wed, 10 Nov 2010 12:14:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17261) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGEFe-0005AR-Bi for qemu-devel@nongnu.org; Wed, 10 Nov 2010 12:14:26 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAAHEOtY028600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 10 Nov 2010 12:14:24 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAAHENBT010512; Wed, 10 Nov 2010 12:14:24 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 5EC3C133A0D; Wed, 10 Nov 2010 19:14:22 +0200 (IST) From: Gleb Natapov To: qemu-devel@nongnu.org Date: Wed, 10 Nov 2010 19:14:19 +0200 Message-Id: <1289409261-5418-13-git-send-email-gleb@redhat.com> In-Reply-To: <1289409261-5418-1-git-send-email-gleb@redhat.com> References: <1289409261-5418-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: blauwirbel@gmail.com, alex.williamson@redhat.com, armbru@redhat.com, kvm@vger.kernel.org, mst@redhat.com Subject: [Qemu-devel] [PATCHv3 12/14] Add bootindex parameter to pci assigned device. 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 Signed-off-by: Gleb Natapov --- hw/device-assignment.c | 7 +++++++ hw/device-assignment.h | 1 + 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index bde231d..15c2b42 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -39,6 +39,7 @@ #include "loader.h" #include "monitor.h" #include +#include "sysemu.h" /* From linux/ioport.h */ #define IORESOURCE_IO 0x00000100 /* Resource type */ @@ -1490,6 +1491,11 @@ static int assigned_initfn(struct PCIDevice *pci_dev) assigned_dev_load_option_rom(dev); QLIST_INSERT_HEAD(&devs, dev, next); + + if (dev->bootindex >= 0) { + add_boot_device_path(dev->bootindex, &pci_dev->qdev, NULL); + } + return 0; assigned_out: @@ -1549,6 +1555,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;