mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Split out logic to determine whether cpupin was provided
This commit is contained in:
@@ -1413,6 +1413,19 @@ virDomainDefGetVcpu(virDomainDefPtr def,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virDomainDefHasVcpuPin:
|
||||||
|
* @def: domain definition
|
||||||
|
*
|
||||||
|
* This helper returns true if any of the domain's vcpus has cpu pinning set
|
||||||
|
*/
|
||||||
|
static bool
|
||||||
|
virDomainDefHasVcpuPin(const virDomainDef *def)
|
||||||
|
{
|
||||||
|
return !!def->cputune.vcpupin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
virDomainDiskDefPtr
|
virDomainDiskDefPtr
|
||||||
virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt)
|
virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt)
|
||||||
{
|
{
|
||||||
@@ -15347,7 +15360,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virDomainNumatuneHasPlacementAuto(def->numa) &&
|
if (virDomainNumatuneHasPlacementAuto(def->numa) &&
|
||||||
!def->cpumask && !def->cputune.vcpupin &&
|
!def->cpumask && !virDomainDefHasVcpuPin(def) &&
|
||||||
!def->cputune.emulatorpin &&
|
!def->cputune.emulatorpin &&
|
||||||
!virDomainIOThreadIDArrayHasPin(def))
|
!virDomainIOThreadIDArrayHasPin(def))
|
||||||
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;
|
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;
|
||||||
|
|||||||
Reference in New Issue
Block a user