From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: VM id in KVM? Date: Tue, 24 Jul 2007 08:17:06 +0300 Message-ID: <46A58B52.9010405@qumranet.com> References: <46A48B63.2030202@qumranet.com> <46A48D0E.1040803@de.ibm.com> <46A48E65.6090105@qumranet.com> <46A48ECD.7020809@qumranet.com> <20070723133234.GA31631@redhat.com> <1185231355.1803.22.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org, kvm-devel To: Rusty Russell Return-path: In-Reply-To: <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Rusty Russell wrote: > On Mon, 2007-07-23 at 14:32 +0100, Daniel P. Berrange wrote: > >> As Avi >> says I dont't see how a individual QEMU process could provide any meaningful >> identifier itself aside from its PID whose uniqueness is guarenteed by the >> OS on its behalf. >> > > Indeed. I use it in my pr_guest() patch which replaces all those > printks with: > > +/* The guest did something wrong/strange. */ > +#define pr_guest(vcpu, fmt, ...) \ > + do { \ > + if (__printk_ratelimit(5*HZ, 10)) \ > + printk(KERN_WARNING "kvm: %i: cpu%i " fmt, \ > + (vcpu)->kvm->pid, (vcpu)->vcpu_id \ > + , ## __VA_ARGS__); \ > + } while(0) > > I'll polish it up and send it on. I don't want Avi getting bored. > > With the ioctl interface, vms aren't really tied to tasks. How about current->pid (or with struct pid and containers, probably current->something->something->pid)? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/