]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Resolve issue with GetScheduler APIs for non running domain
authorJohn Ferlan <jferlan@redhat.com>
Tue, 28 May 2013 18:52:39 +0000 (14:52 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Jun 2013 13:38:36 +0000 (09:38 -0400)
commit94c88b48371f8d81fbd274c97a49e5a13e4506cb
tree207417c52991a52ef022f3fec823ea7809c5c3e7
parent5313dd013f6bb02b70b960f8f121fd2fe113fe2f
qemu: Resolve issue with GetScheduler APIs for non running domain

Cherry-picked from b23754534193fb7a1e31306d94ae5f09759a0aa4

As a consequence of the cgroup layout changes from commit '632f78ca', the
qemuDomainGetSchedulerParameters[Flags]()' and qemuGetSchedulerType() APIs
failed to return data for a non running domain.  This can be seen through
a 'virsh schedinfo <domain>' command which returns:

Scheduler      : Unknown
error: Requested operation is not valid: cgroup CPU controller is not mounted

Prior to that change a non running domain would return:

Scheduler      : posix
cpu_shares     : 0
vcpu_period    : 0
vcpu_quota     : 0
emulator_period: 0
emulator_quota : 0

This patch will restore the capability to return configuration only data
for a non running domain regardless of whether cgroups are available.

Conflicts:
src/qemu/qemu_driver.c

 * Resolved conflict by using former qemuCgroupHasController() rather than
   virCgroupHasController()
 * Needed to add the code to fetch the 'vm'
      vm = virDomainObjListFindByUUID(driver->domains, dom->uuid);
      if (vm == NULL) {
          virReportError(VIR_ERR_INTERNAL_ERROR,
                         _("No such domain %s"), dom->uuid);
          goto cleanup;
      }
* Used 'ret = strdup("posix");' rather than VIR_STRDUP(ret, "posix");
  and added the virReportOOMError(); on failure.
src/qemu/qemu_driver.c