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

Eric Blake eblake at redhat.com
Wed Nov 21 14:00:18 UTC 2012

On 11/21/2012 02:42 AM, Dennis Chen wrote:

[I will note that today's email chain should have been as a new thread,
rather than in-reply to a thread from July - changing subject lines and
deleting all previous content still doesn't stop your mailer from using
In-Reply-To headers]

> Yeah, I know. So the email is try to get to know how to use cgroup to
> configure the cpu bandwidth of a specific VM, I am writing a separate
> project to control the cfs bandwidth of a VM specified, not taking use
> of the virsh shell.

You do this by modifying the domain XML:


documents the <cputune> element, which includes the shares, period, and
quota tunables that map into the cpu bandwidth cgroup tunables.  So,
rather than directly modifying cgroup, you should instead be modifying
this portion of the XML.

Furthermore, if your domain is already running, then you can hotplug the
tuning via the virDomainGetSchedulerParametersFlags() and
virDomainSetSchedulerParametersFlags() API, with parameter names such as
VIR_DOMAIN_SCEDULER_VCPU_PERIOD which maps back to the <period>
sub-element of the <cputune> domain XML.  These APIs are already exposed
via the 'virsh schedinfo' command.

Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20121121/0407b7d6/attachment.sig>

More information about the libvirt-users mailing list