From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2] device-assignment: chmod the rom file before opening read/write Date: Wed, 05 Jan 2011 10:57:49 +0200 Message-ID: <4D24328D.8050104@redhat.com> References: <20110104180649.23471.81148.stgit@s20.home> <20110104184516.28545.73442.stgit@s20.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, chrisw@redhat.com To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43773 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab1AEI5x (ORCPT ); Wed, 5 Jan 2011 03:57:53 -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 p058vqQr030209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Jan 2011 03:57:53 -0500 In-Reply-To: <20110104184516.28545.73442.stgit@s20.home> Sender: kvm-owner@vger.kernel.org List-ID: On 01/04/2011 08:45 PM, Alex Williamson wrote: > The PCI sysfs rom file is exposed read-only by default, but we need > to write to it to enable and disable the ROM around the read. When > running as root, the code works fine as is, but when running > de-privileged via libvirt, the fopen("r+") will fail if the file > doesn't have owner write permissions. libvirt already gives us > ownership of the file, so we can toggle this around the short > usage window ourselves. Why is qemu in the business of chmod()ing resources? If qemu needs write access to some resource, the user needs to provide that access. -- error compiling committee.c: too many arguments to function