* VM id in KVM?
@ 2007-07-23 10:40 Jun Koi
[not found] ` <fdaac4d50707230340o7c2f42ecv7f22611a1e5267ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Jun Koi @ 2007-07-23 10:40 UTC (permalink / raw)
To: kvm-devel
Hi,
Do you think that it is necessary to have something like id for a
specific VM on KVM? Without it, how can we identify a VM? By qemu's
pid? Is that good, as we then depend on a particular device model?
Thanks,
Jun
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <fdaac4d50707230340o7c2f42ecv7f22611a1e5267ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <fdaac4d50707230340o7c2f42ecv7f22611a1e5267ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2007-07-23 11:05 ` Avi Kivity [not found] ` <46A48B63.2030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Avi Kivity @ 2007-07-23 11:05 UTC (permalink / raw) To: Jun Koi; +Cc: kvm-devel Jun Koi wrote: > Hi, > > Do you think that it is necessary to have something like id for a > specific VM on KVM? Without it, how can we identify a VM? By qemu's > pid? Is that good, as we then depend on a particular device model? > From a Linux point of view, the pid identifies the VM. A management application can, however, use its own VM identifiers as it sees fit, and map the (possibly persistent, gloablly unique, and ridiculously long) VMID to the pid. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A48B63.2030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A48B63.2030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-07-23 11:12 ` Carsten Otte [not found] ` <46A48D0E.1040803-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Carsten Otte @ 2007-07-23 11:12 UTC (permalink / raw) To: Avi Kivity; +Cc: kvm-devel Avi Kivity wrote: > From a Linux point of view, the pid identifies the VM. A management > application can, however, use its own VM identifiers as it sees fit, and > map the (possibly persistent, gloablly unique, and ridiculously long) > VMID to the pid. It might be preferable to have something that is persistent over guest migration. Makes life easier for the management application as far as I see. ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A48D0E.1040803-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A48D0E.1040803-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> @ 2007-07-23 11:17 ` Avi Kivity [not found] ` <46A48E65.6090105-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Avi Kivity @ 2007-07-23 11:17 UTC (permalink / raw) To: carsteno-tA70FqPdS9bQT0dZR+AlfA; +Cc: kvm-devel Carsten Otte wrote: > Avi Kivity wrote: >> From a Linux point of view, the pid identifies the VM. A management >> application can, however, use its own VM identifiers as it sees fit, >> and map the (possibly persistent, gloablly unique, and ridiculously >> long) VMID to the pid. > It might be preferable to have something that is persistent over guest > migration. Makes life easier for the management application as far as > I see. It may make sense to add a vmid to qemu (or to keep it in the management application entirely). Certainly the kernel doesn't need to know about it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A48E65.6090105-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A48E65.6090105-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-07-23 11:19 ` Avi Kivity [not found] ` <46A48ECD.7020809-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 2007-07-23 11:35 ` Carsten Otte 1 sibling, 1 reply; 13+ messages in thread From: Avi Kivity @ 2007-07-23 11:19 UTC (permalink / raw) To: carsteno-tA70FqPdS9bQT0dZR+AlfA; +Cc: kvm-devel Avi Kivity wrote: > Carsten Otte wrote: >> Avi Kivity wrote: >>> From a Linux point of view, the pid identifies the VM. A >>> management application can, however, use its own VM identifiers as >>> it sees fit, and map the (possibly persistent, gloablly unique, and >>> ridiculously long) VMID to the pid. >> It might be preferable to have something that is persistent over >> guest migration. Makes life easier for the management application as >> far as I see. > > It may make sense to add a vmid to qemu (or to keep it in the > management application entirely). Certainly the kernel doesn't need > to know about it. > I take it back. The only entity that can enforce uniqueness is the management application, therefore that should be the entity that knows about them. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A48ECD.7020809-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A48ECD.7020809-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-07-23 13:32 ` Daniel P. Berrange [not found] ` <20070723133234.GA31631-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Daniel P. Berrange @ 2007-07-23 13:32 UTC (permalink / raw) To: Avi Kivity; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel On Mon, Jul 23, 2007 at 02:19:41PM +0300, Avi Kivity wrote: > Avi Kivity wrote: > > Carsten Otte wrote: > >> Avi Kivity wrote: > >>> From a Linux point of view, the pid identifies the VM. A > >>> management application can, however, use its own VM identifiers as > >>> it sees fit, and map the (possibly persistent, gloablly unique, and > >>> ridiculously long) VMID to the pid. > >> It might be preferable to have something that is persistent over > >> guest migration. Makes life easier for the management application as > >> far as I see. > > > > It may make sense to add a vmid to qemu (or to keep it in the > > management application entirely). Certainly the kernel doesn't need > > to know about it. > > > > I take it back. The only entity that can enforce uniqueness is the > management application, therefore that should be the entity that knows > about them. When managing QEMU & KVM guests, libvirt provides 3 identifiers with varying levels of uniqueness - ID - a integer unique amongst all active guests on a host - Name - a string uninque amongst all active & inactive guests on a host - UUID - 32 byte hex string unique globally We don't expose the PID directly of the QEMU binary directly. Name and UUID are both stable across migration - the ID changes upon migration. 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. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20070723133234.GA31631-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <20070723133234.GA31631-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2007-07-23 13:39 ` Avi Kivity [not found] ` <46A4AF95.2070306-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 2007-07-23 22:55 ` Rusty Russell 1 sibling, 1 reply; 13+ messages in thread From: Avi Kivity @ 2007-07-23 13:39 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel Daniel P. Berrange wrote: > When managing QEMU & KVM guests, libvirt provides 3 identifiers with > varying levels of uniqueness > > - ID - a integer unique amongst all active guests on a host > - Name - a string uninque amongst all active & inactive guests on a host > - UUID - 32 byte hex string unique globally > > Does libvirt also provide a lighter-weight interface that doesn't know about names and uuids? I imagine a cluster-wide management solutions will want to keep all configuration in a central database and just tell libvirt "start a guest with this configuration". -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A4AF95.2070306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A4AF95.2070306-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-07-23 13:45 ` Daniel P. Berrange 0 siblings, 0 replies; 13+ messages in thread From: Daniel P. Berrange @ 2007-07-23 13:45 UTC (permalink / raw) To: Avi Kivity; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel On Mon, Jul 23, 2007 at 04:39:33PM +0300, Avi Kivity wrote: > Daniel P. Berrange wrote: > >When managing QEMU & KVM guests, libvirt provides 3 identifiers with > >varying levels of uniqueness > > > > - ID - a integer unique amongst all active guests on a host > > - Name - a string uninque amongst all active & inactive guests on a host > > - UUID - 32 byte hex string unique globally > > Does libvirt also provide a lighter-weight interface that doesn't know > about names and uuids? I imagine a cluster-wide management solutions > will want to keep all configuration in a central database and just tell > libvirt "start a guest with this configuration". Name is mandatory, if you omit the UUID it will generate one for its own internal tracking purposes. You can also create a guest without having to pre-define a config file - it will disappear with no trace once the guest is shutdown. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: VM id in KVM? [not found] ` <20070723133234.GA31631-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2007-07-23 13:39 ` Avi Kivity @ 2007-07-23 22:55 ` Rusty Russell [not found] ` <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> 1 sibling, 1 reply; 13+ messages in thread From: Rusty Russell @ 2007-07-23 22:55 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel 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. Cheers, Rusty. ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> @ 2007-07-24 1:44 ` Jun Koi 2007-07-24 5:17 ` Avi Kivity 1 sibling, 0 replies; 13+ messages in thread From: Jun Koi @ 2007-07-24 1:44 UTC (permalink / raw) To: Rusty Russell; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel On 7/24/07, Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org> 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. > Looks like you will add pid into kvm struct? That is cool, and really what I am looking for :-) Thanks, Jun ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: VM id in KVM? [not found] ` <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org> 2007-07-24 1:44 ` Jun Koi @ 2007-07-24 5:17 ` Avi Kivity [not found] ` <46A58B52.9010405-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 1 sibling, 1 reply; 13+ messages in thread From: Avi Kivity @ 2007-07-24 5:17 UTC (permalink / raw) To: Rusty Russell; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <46A58B52.9010405-atKUWr5tajBWk0Htik3J/w@public.gmane.org>]
* Re: VM id in KVM? [not found] ` <46A58B52.9010405-atKUWr5tajBWk0Htik3J/w@public.gmane.org> @ 2007-07-24 5:59 ` Rusty Russell 0 siblings, 0 replies; 13+ messages in thread From: Rusty Russell @ 2007-07-24 5:59 UTC (permalink / raw) To: Avi Kivity; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel On Tue, 2007-07-24 at 08:17 +0300, Avi Kivity wrote: > With the ioctl interface, vms aren't really tied to tasks. True, but this is really a debugging aid. > How about current->pid (or with struct pid and containers, probably > current->something->something->pid)? I was reluctant because there's nothing inherent in this function which says it's the current CPU's guest we're complaining about. ...Although, it always is. OK, I'm convinced. Cheers, Rusty. ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: VM id in KVM? [not found] ` <46A48E65.6090105-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 2007-07-23 11:19 ` Avi Kivity @ 2007-07-23 11:35 ` Carsten Otte 1 sibling, 0 replies; 13+ messages in thread From: Carsten Otte @ 2007-07-23 11:35 UTC (permalink / raw) To: Avi Kivity; +Cc: carsteno-tA70FqPdS9bQT0dZR+AlfA, kvm-devel Avi Kivity wrote: > It may make sense to add a vmid to qemu (or to keep it in the management > application entirely). Certainly the kernel doesn't need to know about it. Yes, I agree that should be userland only. ------------------------------------------------------------------------- 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/ ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2007-07-24 5:59 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 10:40 VM id in KVM? Jun Koi
[not found] ` <fdaac4d50707230340o7c2f42ecv7f22611a1e5267ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-07-23 11:05 ` Avi Kivity
[not found] ` <46A48B63.2030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23 11:12 ` Carsten Otte
[not found] ` <46A48D0E.1040803-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-07-23 11:17 ` Avi Kivity
[not found] ` <46A48E65.6090105-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23 11:19 ` Avi Kivity
[not found] ` <46A48ECD.7020809-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23 13:32 ` Daniel P. Berrange
[not found] ` <20070723133234.GA31631-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-07-23 13:39 ` Avi Kivity
[not found] ` <46A4AF95.2070306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-23 13:45 ` Daniel P. Berrange
2007-07-23 22:55 ` Rusty Russell
[not found] ` <1185231355.1803.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-24 1:44 ` Jun Koi
2007-07-24 5:17 ` Avi Kivity
[not found] ` <46A58B52.9010405-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-24 5:59 ` Rusty Russell
2007-07-23 11:35 ` Carsten Otte
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox