From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH qemu-kvm] device-assignment: add config fd qdev property Date: Mon, 31 May 2010 17:22:42 -0300 Message-ID: <20100531202242.GA10406@amt.cnet> 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]:35391 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730Ab0EaUXp (ORCPT ); Mon, 31 May 2010 16:23:45 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4VKNiYA025058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 31 May 2010 16:23:44 -0400 Content-Disposition: inline In-Reply-To: <1274720029.4205.12.camel@x201> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 24, 2010 at 10:53:49AM -0600, Alex Williamson 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. > > Signed-off-by: Chris Wright > Signed-off-by: Alex Williamson Applied, thanks.