From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH RFC 2/5] Create relay channels and add trace data Date: Thu, 03 Apr 2008 13:37:00 +0300 Message-ID: <47F4B34C.6010706@qumranet.com> References: <9D7649D18729DE4BB2BD7B494F7FEDC2011846AF@pdsmsx415.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Liu, Eric E" Return-path: In-Reply-To: <9D7649D18729DE4BB2BD7B494F7FEDC2011846AF@pdsmsx415.ccr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Liu, Eric E wrote: > >From 41d65b55580d3f07f9f1c50e89e3d64c5d10fbaf Mon Sep 17 00:00:00 2001 > From: Feng (Eric) Liu > Date: Tue, 1 Apr 2008 07:26:14 -0400 > Subject: [PATCH] KVM: Add kvm trace support. when config KVM_TRACE, it > allows userspace app to read the trace of kvm_related > events through the relayfs. > > > +int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg) > +{ > + void __user *argp = (void __user *)arg; > + long r = -EINVAL; > + > + switch (ioctl) { > + case KVM_TRACE_ENABLE: > + r = kvm_trace_enable(argp); > + break; > + case KVM_TRACE_DISABLE: > + r = 0; > + kvm_trace_cleanup(); > + break; > + } > + > + return r; > +} > Since we want to allow non-privileged users to open /dev/kvm, and tracing can provide data on other users' VMs, we need check on CAP_SYS_ADMIN (or maybe CAP_PTRACE?) and return -EPERM if the user is not privileged enough. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace