[libvirt] Libvirt's DomainGetInfo Function Development

Aleem Akhtar aleem.akhtar at seecs.edu.pk
Thu Aug 4 15:02:08 UTC 2016

I am trying to get stats of Domains running under XEN hypervisor. I used
Libvirt function for this purpose. I am trying to understand output for
Memory. Domain running is Fedora-22 with 1GB Ram. Here is my code

y = virDomainGetInfo(allDomain, &info);
if (y == -1)
else {
    printf("Max Memory: %lu\n", info.maxMem);
    printf("Memory: %lu", info.memory);

I get output as

*Max Memory: 1048576
Memory: 1048576*

Now, as per Libvirt API
info.memory should return the memory in KBytes used by the domain. My
Question is, if info.memory returns memory used and my domain is using
complete 100% of Max Memory or not? Also I tried to create Domain with
memory varying from 128MB to 2GB with same effect. I also tried to run some
applications in Domain but Memory usage return by given function does not
change. Any help or guidance will be much appreciated.


*Aleem Akhtar *

*Research Assistant | HPC-Lab | SEECS*

National University of Sciences & Technology

Sector H-12, Islamabad

Email: aleem.akhtar at seecs.nust.edu.pk

<aleem.akhtar at seecs.nust.edu.pk>

Website: aleemakhtar.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160804/f83ec491/attachment-0001.htm>

More information about the libvir-list mailing list