[libvirt] [PATCH v2] qemu: Start domain on a node without cpu affinity

Michal Prívozník mprivozn at redhat.com
Mon Aug 27 08:43:00 UTC 2018


On 08/23/2018 10:49 AM, Roman Bolshakov wrote:
> qemuProcessInitCpuAffinity prevents a VM from getting started on a
> platform that uses cpu affinity wrapper stubs e.g. macOS.
> 
> The patch adds qemuProcessInitCpuAffinity stub on all platforms without
> HAVE_SCHED_GETAFFINITY or HAVE_BSD_CPU_AFFINITY.
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov at yadro.com>
> ---
> 
> Changes since v1:
> * Replaced no-op virProcessGetAffinity with qemuProcessInitCpuAffinity
>   stub.
> 
>  src/qemu/qemu_process.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index ab749389ee..28d52f01f6 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -2343,6 +2343,7 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver,
>  /*
>   * To be run between fork/exec of QEMU only
>   */
> +#if defined(HAVE_SCHED_GETAFFINITY) || defined(HAVE_BSD_CPU_AFFINITY)
>  static int
>  qemuProcessInitCpuAffinity(virDomainObjPtr vm)
>  {
> @@ -2413,6 +2414,13 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
>      virBitmapFree(hostcpumap);
>      return ret;
>  }
> +#else
> +static int
> +qemuProcessInitCpuAffinity(virDomainObjPtr vm ATTRIBUTE_UNUSED)
> +{
> +    return 0;
> +}
> +#endif

I've put comments after these #else and #endif to help anybody reading
the code understand what's the condition.

ACKed and pushed.

Michal




More information about the libvir-list mailing list