mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-30 17:45:23 +00:00
qemu: Fix EmulatorPinInfo without emulatorpin
https://bugzilla.redhat.com/show_bug.cgi?id=871312
Recent fixes made almost all the right steps to make emulator pinned
to the cpuset of the whole domain in case <emulatorpin> isn't
specified, but qemudDomainGetEmulatorPinInfo still reports all the
CPUs even when cpuset is specified. This patch fixes that.
(cherry picked from commit 10c5212b10
)
This commit is contained in:
parent
c3cc4c1835
commit
ec3f5cad8e
@ -4144,7 +4144,6 @@ qemudDomainGetEmulatorPinInfo(virDomainPtr dom,
|
||||
virDomainDefPtr targetDef = NULL;
|
||||
int ret = -1;
|
||||
int maxcpu, hostcpus, pcpu;
|
||||
virDomainVcpuPinDefPtr emulatorpin = NULL;
|
||||
virBitmapPtr cpumask = NULL;
|
||||
bool pinned;
|
||||
|
||||
@ -4186,14 +4185,15 @@ qemudDomainGetEmulatorPinInfo(virDomainPtr dom,
|
||||
cpumaps[maplen - 1] &= (1 << maxcpu % 8) - 1;
|
||||
}
|
||||
|
||||
/* If no emulatorpin, all cpus should be used */
|
||||
emulatorpin = targetDef->cputune.emulatorpin;
|
||||
if (!emulatorpin) {
|
||||
if (targetDef->cputune.emulatorpin) {
|
||||
cpumask = targetDef->cputune.emulatorpin->cpumask;
|
||||
} else if (targetDef->cpumask) {
|
||||
cpumask = targetDef->cpumask;
|
||||
} else {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
cpumask = emulatorpin->cpumask;
|
||||
for (pcpu = 0; pcpu < maxcpu; pcpu++) {
|
||||
if (virBitmapGetBit(cpumask, pcpu, &pinned) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user