From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [PATCH] device-assignment: Use PCI I/O port sysfs resource file when available Date: Wed, 21 Jul 2010 09:17:49 +0100 Message-ID: <20100721081749.GC21281@redhat.com> References: <20100720221045.3576.3435.stgit@localhost6.localdomain6> <20100720231306.GE7951@x200.localdomain> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alex Williamson , kvm@vger.kernel.org, ddutile@redhat.com To: Chris Wright Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11639 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755065Ab0GUIRw (ORCPT ); Wed, 21 Jul 2010 04:17:52 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6L8HoV4001460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Jul 2010 04:17:51 -0400 Content-Disposition: inline In-Reply-To: <20100720231306.GE7951@x200.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 20, 2010 at 04:13:06PM -0700, Chris Wright wrote: > * Alex Williamson (alex.williamson@redhat.com) wrote: > > When supported by the host kernel, we can use read/write on the > > PCI sysfs resource file for I/O port regions. This allows us to > > avoid raw in/out commands and works with deprivileged guests via > > libvirt. For uid 0 callers, we use in/out directly to avoid any > > compatibility issues. > > won't uid 0 test will fail if libvirt launches qemu with user set to > root (capabilities still get dropped)? Yes, if the kernel is doing a CAP_SYS_ADMIN check (or similar), then testing uid==0 is definitely wrong. You'd need to test have(CAP_SYS_ADMIN) instead. REgards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|