[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt-users] How to lookup the driver instance through virConnectPtr pointer


I plan to use virCgroupSetCpuCfsPeriod() and virCgroupSetCpuCfsQuota() to control cpu bandwidth with help of cgroup, so I need to instantiate the cgroup parameter first for the calling of virCgroupSetCpuCfsPeriod, below is my code piece:

1        virConnectPtr conn;
2        struct qemud_driver *driver;

3        conn = virConnectOpen("qemu:///system");
4        driver = conn->privateData;
5        virCgroupSetCpuCfsPeriod(driver->cgroup, cfs_period);

then I get an compiling error in line 4:
error: dereferencing pointer to incomplete type

I know the reason is the actual definition of virConnectPtr is in datatyps.h, but it's not reasonable or ugly to include this file in
my project.

So my question is, is there any API that I can get the driver instance from virConnectPtr conn in the libvirt?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]