Pasquale Dir
2014-Apr-14 08:52 UTC
[libvirt-users] Is it possible to get the vm which is using a storage pool's volume?
Hello, how can I programmatically get the vm which is currently using a storage volume? I looked at the apis but I can't find anything about it. Pasquale
Eric Blake
2014-Apr-14 14:56 UTC
Re: [libvirt-users] Is it possible to get the vm which is using a storage pool's volume?
On 04/14/2014 02:52 AM, Pasquale Dir wrote:> Hello, > how can I programmatically get the vm which is currently using a storage > volume? I looked at the apis but I can't find anything about it.No one has contributed such an API yet, although I think it would be a welcome addition. For now, the best you can do is list all domains and parse their XML to see if any of their disks refer to a file that lines up with any of the storage volumes. Not pretty, but virt-manager already has code that does this (in the python bindings), if you want to use that as a starting point. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org