From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Armbruster Subject: Re: [PATCH qemu-kvm] device-assignment: add config fd qdev property Date: Thu, 20 May 2010 14:11:36 +0200 Message-ID: References: <20100519190041.GK28275@x200.localdomain> <4BF4398B.50902@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Chris Wright , kvm@vger.kernel.org, Alex Williamson To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752983Ab0ETMLm (ORCPT ); Thu, 20 May 2010 08:11:42 -0400 In-Reply-To: <4BF4398B.50902@codemonkey.ws> (Anthony Liguori's message of "Wed, 19 May 2010 14:18:35 -0500") Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori writes: > On 05/19/2010 02:00 PM, 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. >> >> Signed-off-by: Chris Wright >> > > An fd as a qdev property seems like a bad idea to me. I'm not sure I > have a better suggestion though. Shot from the hip without much thought: could we use monitor command getfd? That associates the fd with a name.