Hi,
 
We are implementing feature called CPU separation in the platform. So, guest VMs will have dedicated cores allocated using cgroups (cgroups hierachy related VMs managed by libvirt).

 virsh cpu-stats command is not working in our platform :

virsh # cpu-stats test_vm
error: Failed to virDomainGetCPUStats()

error: Requested operation is not valid: cgroup CPUACCT controller is not mounted

It should show info like this.

$ virsh cpu-stats test_vm
CPU0:
cpu_time 0.025812184 seconds
vcpu_time 0.025812184 seconds
CPU1:
cpu_time 4.893484927 seconds
vcpu_time 4.893484927 seconds
Total:
cpu_time 4.924620941 seconds
user_time 1.060000000 seconds
system_time 3.050000000 seconds

We are suspecting some issue in virsh when it is trying to find to where that cgroups is mounted in a system (default in ubuntu is /sys/fs/cgroup/cpuset/libvirt/, but in our platform  uses /dev/cgroup_xxx).

Find /proc/cgroups and /proc/mounts log below:
==================================

# cat /proc/cgroups
#subsys_name    hierarchy       num_cgroups     enabled
cpuset  0       1       1
ns      0       1       1
cpu     1       3       1
cpuacct 0       1       1
memory  2       1       1
freezer 0       1       1
net_cls 0       1       1
blkio   0       1       1

# cat /proc/mounts
cpu /dev/cgroup_cpu cgroup rw,relatime,cpu 0 0
memory /dev/cgroup_mem cgroup rw,relatime,memory 0 0

Can you please help us in this regard to enable this command in our platform,
Thanks in advance !!!

Regards,
Anusha