]> xenbits.xensource.com Git - xen.git/commit
libxl: fix guest kexec - skip cpuid policy
authorJason Andryuk <jandryuk@gmail.com>
Thu, 26 Jan 2023 09:58:23 +0000 (10:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Jan 2023 09:58:23 +0000 (10:58 +0100)
commit1e454c2b5b1172e0fc7457e411ebaba61db8fc87
treea1ed30db688e219aaf4071d13be685ce97236c2a
parent10ced96ce9d4cbc140652795fe87af9f83bb1b29
libxl: fix guest kexec - skip cpuid policy

When a domain performs a kexec (soft reset), libxl__build_pre() is
called with the existing domid.  Calling libxl__cpuid_legacy() on the
existing domain fails since the cpuid policy has already been set, and
the guest isn't rebuilt and doesn't kexec.

xc: error: Failed to set d1's policy (err leaf 0xffffffff, subleaf 0xffffffff, msr 0xffffffff) (17 = File exists): Internal error
libxl: error: libxl_cpuid.c:494:libxl__cpuid_legacy: Domain 1:Failed to apply CPUID policy: File exists
libxl: error: libxl_create.c:1641:domcreate_rebuild_done: Domain 1:cannot (re-)build domain: -3
libxl: error: libxl_xshelp.c:201:libxl__xs_read_mandatory: xenstore read failed: `/libxl/1/type': No such file or directory
libxl: warning: libxl_dom.c:49:libxl__domain_type: unable to get domain type for domid=1, assuming HVM

During a soft_reset, skip calling libxl__cpuid_legacy() to avoid the
issue.  Before commit 34990446ca91, the libxl__cpuid_legacy() failure
would have been ignored, so kexec would continue.

Fixes: 34990446ca91 ("libxl: don't ignore the return value from xc_cpuid_apply_policy")
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/light/libxl_create.c
tools/libs/light/libxl_dom.c
tools/libs/light/libxl_internal.h