[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tools/libxl: Work around libvirt breakage in libxl__cpuid_legacy()


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 2 Oct 2020 18:32:59 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 02 Oct 2020 17:33:29 +0000
  • Ironport-sdr: iSvM/BbexMhPgj/TdHXXgsohZGzUu3Yb9HHZJr8+Lavk26K0iouKVKdTETpvQTe3RG8+B1gho5 toQH15h7EEi+/+3xIvCOXltWI5+7cerioS5JgIW90++y1OsA7Ervp4z7brfjzEtkhimels+61i EHLKPF9tnRX6QdLiKKoN+yAs7le2gULZ3CTKX7NxQBvwHwHnxkU3afJM1Nt4sxmMt6rwZxKn5F h2V61e6XWR5RK2gKHYjSCV6FmvXca6+reCXvjORk5U51F9VLP9sBoTd9EYpPiMXebx2CtV6UQg gIk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

OSSTest reports that libvirt is reliably regressed.

The only possible option is a side effect of using libxl_defbool_val(), which
can only be the assert() within.  Unfortunately, libvirt actually crashes in
__vfscanf_internal() while presuambly trying to render some form of error.

Opencode the check without the assert() to unblock staging, while we
investigate what is going on with libvirt.  This will want reverting at some
point in the future.

Not-really-fixes: bfcc97c08c ("tools/cpuid: Plumb nested_virt down into 
xc_cpuid_apply_policy()" reliably breaks libvirt.)
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libs/light/libxl_cpuid.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 08e85dcffb..16c077cceb 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -422,7 +422,15 @@ void libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, 
bool restore,
 {
     bool pae = true;
     bool itsc;
-    bool nested_virt = libxl_defbool_val(info->nested_hvm);
+
+    /*
+     * Gross hack.  Using libxl_defbool_val() here causes libvirt to crash in
+     * __vfscanf_internal(), which is probably collateral damage from a side
+     * effect of the assert().
+     *
+     * Unblock things for now by opencoding without the assert.
+     */
+    bool nested_virt = info->nested_hvm.val > 0;
 
     /*
      * For PV guests, PAE is Xen-controlled (it is the 'p' that differentiates
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.