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

[PATCH] libxl: slightly correct JSON generation of CPU policy


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 15 Aug 2023 14:35:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RaWln2defixNwk0FmjkU/RDv/F03c2eCwBL94Q2gTkY=; b=RaTlEiApAweekQbpASDymSpCfihRgJhkXSHBejnbemAu4fPOMu19aSYUWGPzPw9wVNz8xSxZBiSSZTuLUHz1XvyUV8PHMaMhcZI8/g13omD/PU83YDFVogugDn5bLAqk9TX0MOstRO2xZ3UaLbE2Pf0K4lg4ZpyNAY0e05yBkeNKYuAtjaRSNYn5wOvbxzT9WhHefyGO6yteCC0kJNEEYVeoCrkAIZ5lttmdCG2c2QYMBdLgNQHlAyUsLtS5h2n4cG9Vc4NDoMrAciLYuymQx9VYQvVxD4D/m17xtVrpNluXEXQesaxnMNAtjxTy/h1iT0tRt0IzR3V9iM0aejoq+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yc3sf5TxckrURwNOt392nqn9QKzWw+TwVbD5C7mjJgZG0tV3tXN6BtiooX/dp9ATYbLWdolFMspUWc5Rlf94xCW9BYdJO6vucujoaG03/UUnrO8kd7vdCZB+7FDnZUat0K9YTtOyYBO2mUv1Fx6xtrbor+8BymrSd5ZXRMg9eAQvM/CM9rYQ9klTiaPyYUXOFvAFjARqCm0TxTgS99DbqFZ0b9Jnmcn1KLaPGBBbI2/1lkKvZTMeBgS/+Zz3izTLZ11VjXEVvrmotE0Xhgij2nnlrWsbzjJy7p1PfuOZdu4AmjRcJixklHvIrfeegAYs5EiHL7ZQrrsxmzhrLoJjlA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 15 Aug 2023 12:36:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The "cpuid_empty" label is also (in principle; maybe only for rubbish
input) reachable in the "cpuid_only" case. Hence the label needs to live
ahead of the check of the variable.

Fixes: 5b80cecb747b ("libxl: introduce MSR data in libxl_cpuid_policy")
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -710,10 +710,11 @@ parse_cpuid:
                     libxl__strdup(NOGC, libxl__json_object_get_string(r));
         }
     }
+
+cpuid_empty:
     if (cpuid_only)
         return 0;
 
-cpuid_empty:
     co = libxl__json_map_get("msr", o, JSON_ARRAY);
     if (!libxl__json_object_is_array(co))
         return ERROR_FAIL;



 


Rackspace

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