aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-28 22:43:18 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-01-28 22:43:18 +0000
commit7e7eb9f852a46b51a71ae9d82590b2e4d28827ee (patch)
treed63017ecda357d29659abe087aa6a09d808b06b5 /target
parent0bcd12fb1513bad44f05f2d3a8eef2a99b3077b6 (diff)
parent95b3a8c8a82a34ca874ac0d4a9bbbdb38034acf3 (diff)
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-01-28' into staging
QAPI patches patches for 2021-01-28 # gpg: Signature made Thu 28 Jan 2021 07:10:21 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2021-01-28: qapi: More complex uses of QAPI_LIST_APPEND qapi: Use QAPI_LIST_APPEND in trivial cases qapi: Introduce QAPI_LIST_APPEND qapi: A couple more QAPI_LIST_PREPEND() stragglers net: Clarify early exit condition Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/i386/cpu.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 72a79e6019..ae89024d36 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -4818,20 +4818,17 @@ static void x86_cpu_filter_features(X86CPU *cpu, bool verbose);
/* Build a list with the name of all features on a feature word array */
static void x86_cpu_list_feature_names(FeatureWordArray features,
- strList **feat_names)
+ strList **list)
{
+ strList **tail = list;
FeatureWord w;
- strList **next = feat_names;
for (w = 0; w < FEATURE_WORDS; w++) {
uint64_t filtered = features[w];
int i;
for (i = 0; i < 64; i++) {
if (filtered & (1ULL << i)) {
- strList *new = g_new0(strList, 1);
- new->value = g_strdup(x86_cpu_feature_name(w, i));
- *next = new;
- next = &new->next;
+ QAPI_LIST_APPEND(tail, g_strdup(x86_cpu_feature_name(w, i)));
}
}
}
@@ -4852,16 +4849,14 @@ static void x86_cpu_get_unavailable_features(Object *obj, Visitor *v,
* running using the current machine and accelerator.
*/
static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,
- strList **missing_feats)
+ strList **list)
{
+ strList **tail = list;
X86CPU *xc;
Error *err = NULL;
- strList **next = missing_feats;
if (xcc->host_cpuid_required && !accel_uses_host_cpuid()) {
- strList *new = g_new0(strList, 1);
- new->value = g_strdup("kvm");
- *missing_feats = new;
+ QAPI_LIST_APPEND(tail, g_strdup("kvm"));
return;
}
@@ -4873,16 +4868,13 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc,
* but in case it does, just report the model as not
* runnable at all using the "type" property.
*/
- strList *new = g_new0(strList, 1);
- new->value = g_strdup("type");
- *next = new;
- next = &new->next;
+ QAPI_LIST_APPEND(tail, g_strdup("type"));
error_free(err);
}
x86_cpu_filter_features(xc, false);
- x86_cpu_list_feature_names(xc->filtered_features, next);
+ x86_cpu_list_feature_names(xc->filtered_features, tail);
object_unref(OBJECT(xc));
}