On Mon, Feb 12, 2018 at 09:39:26 +0000, Daniel Berrange wrote:
On Mon, Feb 12, 2018 at 03:54:21AM -0500, Yi Wang wrote:
> We can't clear vcpupin settings of XML once we did vcpupin
> command, this is not convenient under some condition such
> as migration to a host with less CPUs.
>
> This patch introduces clear feature, which can clear vcpuin
> setting of XML using a 'c' option.
>
> Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
> Signed-off-by: Xi Xu <xu.xi8(a)zte.com.cn>
> ---
> include/libvirt/libvirt-domain.h | 11 +++++++++++
> src/qemu/qemu_driver.c | 32 ++++++++++++++++++++++++--------
I'm not seeing a good reason for these change. There's no concept of clearing
CPU pinning - the default is simply "pinned" to all possible CPUs, and the
callers should already be able to request all possile CPUs with the current
API design.
Well, the thing is that in some cases the default is not pinned to all
pCPUs, but rather can be taken from other configuration points, e.g.
global VM pinning bitmap.
As of such the current code does not allow restoring such state since
pinning to all pCPUs might be a desired legitimate configuration so I've
removed the hack that deleted the pinning for such configuration a long
time ago. This means that an explicit removal of the pinning might be a
desired behaviour of the API, since abusing of any other value to
restore the default state is not a good idea.