From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wright Subject: Re: [PATCH qemu-kvm] device-assignment: add config fd qdev property Date: Mon, 24 May 2010 11:20:44 -0700 Message-ID: <20100524182044.GC7635@x200.localdomain> References: <20100519190041.GK28275@x200.localdomain> <1274720029.4205.12.camel@x201> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Wright , kvm@vger.kernel.org To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6021 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982Ab0EXSUr (ORCPT ); Mon, 24 May 2010 14:20:47 -0400 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 o4OIKjTg016194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 May 2010 14:20:45 -0400 Content-Disposition: inline In-Reply-To: <1274720029.4205.12.camel@x201> Sender: kvm-owner@vger.kernel.org List-ID: * Alex Williamson (alex.williamson@redhat.com) wrote: > On Wed, 2010-05-19 at 12:00 -0700, Chris Wright wrote: > > When libvirt launches a guest it first chowns the relevenat > > /sys/bus/pci/.../config file for an assigned device then drops privileges. > > > > This causes an issue for device assignment because despite being file > > owner, the sysfs config space file checks for CAP_SYS_ADMIN before > > allowing access to device dependent config space. > > > > This adds a new qdev configfd property which allows libvirt to open the > > sysfs config space file and give qemu an already opened file descriptor. > > Along with a change pending for the 2.6.35 kernel, this allows the > > capability check to compare against privileges from when the file was > > opened. > > We need to make configfd be a string option so that we can pass a > descriptor from libvirt for the hotplug case. Here's a rework. ACK, thanks.