libvirt/src/xen
Stefan Bader d7a45bf223 xen: Use internal interfaces in xenDomainUsedCpus
Since commit 95e18efd most public interfaces (xenUnified...) obtain
a virDomainDefPtr via xenGetDomainDefFor...() which take the unified
lock.
This is already taken before calling xenDomainUsedCpus(), so we get
a deadlock for active guests. Avoid this by splitting up
xenUnifiedDomainGetVcpusFlags() and xenUnifiedDomainGetVcpus() into
public and private function calls (which get the virDomainDefPtr passed)
and use those in xenDomainUsedCpus().

    xenDomainUsedCpus
      ...
      nb_vcpu = xenUnifiedDomainGetMaxVcpus(dom);
        return xenUnifiedDomainGetVcpusFlags(...)
          ...
          if (!(def = xenGetDomainDefForDom(dom)))
            return xenGetDomainDefForUUID(dom->conn, dom->uuid);
              ...
              ret = xenHypervisorLookupDomainByUUID(conn, uuid);
                ...
                xenUnifiedLock(priv);
                name = xenStoreDomainGetName(conn, id);
                xenUnifiedUnlock(priv);
      ...
      if ((ncpus = xenUnifiedDomainGetVcpus(dom, cpuinfo, nb_vcpu,
        ...
        if (!(def = xenGetDomainDefForDom(dom)))
          [again like above]

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2013-08-06 11:53:43 -06:00
..
block_stats.c Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files 2013-07-10 17:40:13 +01:00
block_stats.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xen_driver.c xen: Use internal interfaces in xenDomainUsedCpus 2013-08-06 11:53:43 -06:00
xen_driver.h xen: Use internal interfaces in xenDomainUsedCpus 2013-08-06 11:53:43 -06:00
xen_hypervisor.c xen: Add interface versions for Xen 4.3 2013-07-17 10:03:58 -06:00
xen_hypervisor.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xen_inotify.c Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files 2013-07-10 17:40:13 +01:00
xen_inotify.h Simplify opening of Xen drivers 2013-05-09 13:16:19 +01:00
xend_internal.c xen: fix memory corruption in legacy driver 2013-08-05 10:38:52 -06:00
xend_internal.h Convert Xen domain core dump driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xm_internal.c Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files 2013-07-10 17:40:13 +01:00
xm_internal.h Convert Xen domain stats/peek driver methods to use virDomainDefPtr 2013-05-21 16:11:39 +01:00
xs_internal.c Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files 2013-07-10 17:40:13 +01:00
xs_internal.h Simplify the Xen domain get info/state driver methods 2013-05-09 13:16:20 +01:00