On Sat, Jun 16, 2007 at 07:36:18PM +0200, Luca wrote:
> On 6/16/07, Richard Hughes <[EMAIL PROTECTED]> wrote:
> >On Sat, 2007-06-16 at 15:30 +0300, Muli Ben-Yehuda wrote:
> >>
> >> > Is there any easy way we can detect if virtual machines are running?
> >>
> >> The module use counts will be elevanted and they'll refuse to unload
> >> (or there's a nasty bug somewhere).
> >
> >Nahh, that's too brutal. Is there a way to (hypothetically) read:
> >
> ># cat /sys/module/kvm/parameters/number_of_running_vms
> >2
> 
> cat /sys/module/kvm_intel/refcnt (or kvm_amd) will tell you how many
> VMs are running.

... were running at the moment when you queried the kernel. Once you
get back the answer, it's irrelevant --- a new VM could've been
launched inbetween reading the refcnt and acting upon it. Really the
only safe way to do this sort of thing is to try and rmmod the module.

Cheers,
Muli

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to