mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
qemu: Use numad information when getting pin information
Pinning information returned for emulatorpin and vcpupin calls is being
returned from our data without querying cgroups for some time. However,
not all the data were utilized. When automatic placement is used the
information is not returned for the calls mentioned above. Since the
numad hint in private data is properly saved/restored, we can safely use
it to return true information.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit 776924e376
)
This commit is contained in:
parent
a4b924b579
commit
779742f4b5
@ -5228,6 +5228,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
int hostcpus, vcpu;
|
int hostcpus, vcpu;
|
||||||
virBitmapPtr allcpumap = NULL;
|
virBitmapPtr allcpumap = NULL;
|
||||||
|
qemuDomainObjPrivatePtr priv = NULL;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||||
@ -5248,6 +5249,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virBitmapSetAll(allcpumap);
|
virBitmapSetAll(allcpumap);
|
||||||
|
priv = vm->privateData;
|
||||||
|
|
||||||
/* Clamp to actual number of vcpus */
|
/* Clamp to actual number of vcpus */
|
||||||
if (ncpumaps > def->vcpus)
|
if (ncpumaps > def->vcpus)
|
||||||
@ -5266,6 +5268,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
|
|||||||
|
|
||||||
if (pininfo && pininfo->cpumask)
|
if (pininfo && pininfo->cpumask)
|
||||||
bitmap = pininfo->cpumask;
|
bitmap = pininfo->cpumask;
|
||||||
|
else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
|
||||||
|
priv->autoCpuset)
|
||||||
|
bitmap = priv->autoCpuset;
|
||||||
else
|
else
|
||||||
bitmap = allcpumap;
|
bitmap = allcpumap;
|
||||||
|
|
||||||
@ -5416,6 +5421,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
|
|||||||
int hostcpus;
|
int hostcpus;
|
||||||
virBitmapPtr cpumask = NULL;
|
virBitmapPtr cpumask = NULL;
|
||||||
virBitmapPtr bitmap = NULL;
|
virBitmapPtr bitmap = NULL;
|
||||||
|
qemuDomainObjPrivatePtr priv = NULL;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||||
@ -5432,10 +5438,15 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
|
|||||||
if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
|
if ((hostcpus = nodeGetCPUCount(NULL)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
priv = vm->privateData;
|
||||||
|
|
||||||
if (def->cputune.emulatorpin) {
|
if (def->cputune.emulatorpin) {
|
||||||
cpumask = def->cputune.emulatorpin;
|
cpumask = def->cputune.emulatorpin;
|
||||||
} else if (def->cpumask) {
|
} else if (def->cpumask) {
|
||||||
cpumask = def->cpumask;
|
cpumask = def->cpumask;
|
||||||
|
} else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
|
||||||
|
priv->autoCpuset) {
|
||||||
|
cpumask = priv->autoCpuset;
|
||||||
} else {
|
} else {
|
||||||
if (!(bitmap = virBitmapNew(hostcpus)))
|
if (!(bitmap = virBitmapNew(hostcpus)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user