Message ID | 20240315130910.15750-17-philmd@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp189948wrs; Fri, 15 Mar 2024 06:12:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW7S4vRgGZDBWTKyQ8156X5Dl8wU2o7uuLUjsMwUlVAjrZGk34vwhiVIGgva5UCX3UhHkZ76wKsBVdKddP5KObE X-Google-Smtp-Source: AGHT+IH2DhiDD4ohcBTvu9swgD1Bu7MGm9UblFskCIOmeJtpsrlgyMzNehilzgh3UVOAtQdPImSn X-Received: by 2002:a05:6359:7c25:b0:17b:db48:9349 with SMTP id xm37-20020a0563597c2500b0017bdb489349mr4133269rwb.2.1710508325580; Fri, 15 Mar 2024 06:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710508325; cv=none; d=google.com; s=arc-20160816; b=y1vKuCHDO4BbFK/D2ifMyQdquTsMS4Z1eYnGT3Y1NJBY5s+qnT2S11IaSTtZ04OhqO dLIMzE/v38Xb/ibMf8UncrItStE6hJTX7cc9miY7PnmHL3xjAY118fM5cOmTQA/FXn1a 7rmmdyGye28t98DcM7SKD+X5w/9uW/T2up2xrSPMzTl/w/75a7huzIKutZWUwnSN6jZH Fbw0sZRNd5rsUSoD+l7+1Wu45PI33hynvn3aFBDELUqDMTx8CsMQyr2XZyuXfUmVY0Id TyIHbLSxZPQuh+ZbTzzqo/ezyZsd7jHntCYRfzZOW1bvWCjOG0BvYgSVcXxLWDCLYfCS 5t5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9q6xaVyoPJIMQfl186LF5IP9vgj5sXw3ui9Yz0YXC2Q=; fh=AYqC0GUGkzDOiAvoW6G58I91aDyqaLDgQz3SgR0+i1U=; b=nv7zRNE4pRG1u7UVL8CasEp8/fEoYI1OsjCx9ha4/LmpQGLPx6uyErt7Zl5f/HED/k Z71TUUopYPuDZ7kiJ7LgHAdyLkMyCchac5kYMeKE2QRwVXyzc7xMGZgZKuZMD3vn0AXH Anb2f2pHmKllNB6Le36C2zJXDiz5ess8OZE9CasffrRkYxhNSXIc/Oop0nSCM6Yu2ZZ5 0pA853rewmFkFwYYOK8iosQUOZiyaKGVKFsv8MIQpFRgWkR2ssRd8aBm/Wmlk/EnG3dO /jX1qDe+Uz0GqYG1aQrEc2aAmVqX++l9K6jTREJzbFzyK9EvJNGoc4uBLrnxVLROpO+m L8jQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TMVOa6AS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p12-20020a05622a048c00b00430975caac8si3676765qtx.117.2024.03.15.06.12.05 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2024 06:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TMVOa6AS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1rl7LG-00013U-FN; Fri, 15 Mar 2024 09:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1rl7L1-0000LC-12 for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:11:07 -0400 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1rl7Ky-0008UE-3L for qemu-devel@nongnu.org; Fri, 15 Mar 2024 09:11:06 -0400 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2d48d75ab70so7099441fa.0 for <qemu-devel@nongnu.org>; Fri, 15 Mar 2024 06:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710508262; x=1711113062; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9q6xaVyoPJIMQfl186LF5IP9vgj5sXw3ui9Yz0YXC2Q=; b=TMVOa6AS5DHcYj9w4EjFpStIyqMpbkGn81Fb5r7+qlYyQ4rTH+i+rSeLABMphE+KLN 8Zao5q1pbPFsXliXcmAMyRqM6/W+iBlnktK4DvSz6Is9eElfCqt6N0rxUZ6GXfTDGent p+oJjqjfasjEUcD/J2jrd6JmA5wyD6mAhYebqHmsc2fQd+1GSe4PGghlP6tWyc5DAAwQ WCJHKy32JsDYdxb1D8clU3ws1TSBnI652+pNexEzEnFoOzyzj68k2KkQzDp66anCz1ib a2q26oyfKaBKfJSl/sWZwWrlAvBfS4EIs/nRE8tlC4fw3vAhS1A+xeXAGr2aOLPwzj/q ilWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710508262; x=1711113062; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9q6xaVyoPJIMQfl186LF5IP9vgj5sXw3ui9Yz0YXC2Q=; b=bxOEOBysOmNRDl6Hr+dCiHYGNwnxKk/veOg0SnX5HVGtfBmU03zObsUcLfJ7o84tYb jRf2aLXFnJw1QjBnP3FdxQL0mIIYUpvs8znlFL6cV+7937KZD0F7pgEXZsrqMw5ucBPS +vKNY9zh3+qz2KWCehcm50rrJ8LkNSAvhXiXo8fB9oUSlrUcd2u1s/v6b7A6zUGXZVT+ AUITwPMRbmB1FOAo+d6TOYvAZsZ9Q0gp4ZqTc02OPgY7d9ad2/fGLl4eM4EawHujZ9U8 y39I4J1jWkYt4lP3xqHURHNyZ/rRiklFMAktSq4AC09rk9GX/++QAuZ0/JLcrgVO/EDJ HyFA== X-Gm-Message-State: AOJu0Ywk303jt0gu7O0AvDY4r1kySdDld22xgLFhat8ALICrPXIXpVoc zZasMcfOkDEG2Mz998Ro9Py9XRAMYVY+pcVY36Sx7sBXJX2rKbwtC/eQwJCPMOsaVK4Cpnq3cEB K X-Received: by 2002:a2e:a9a6:0:b0:2d2:65b9:b420 with SMTP id x38-20020a2ea9a6000000b002d265b9b420mr4153813ljq.1.1710508262292; Fri, 15 Mar 2024 06:11:02 -0700 (PDT) Received: from m1x-phil.lan ([176.176.145.26]) by smtp.gmail.com with ESMTPSA id d4-20020aa7d5c4000000b0056711540692sm1656538eds.79.2024.03.15.06.11.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Mar 2024 06:11:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com> Cc: qemu-riscv@nongnu.org, Anton Johansson <anjo@rev.ng>, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= <berrange@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Claudio Fontana <cfontana@suse.de>, Richard Henderson <richard.henderson@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, Zhao Liu <zhao1.liu@intel.com>, qemu-arm@nongnu.org, Thomas Huth <thuth@redhat.com>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, Song Gao <gaosong@loongson.cn> Subject: [RFC PATCH-for-9.1 16/21] target/loongarch: Use QMP generic_query_cpu_definitions() Date: Fri, 15 Mar 2024 14:09:04 +0100 Message-ID: <20240315130910.15750-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240315130910.15750-1-philmd@linaro.org> References: <20240315130910.15750-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::229; envelope-from=philmd@linaro.org; helo=mail-lj1-x229.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
qapi: Make @query-cpu-definitions command target-agnostic
|
expand
|
diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loongarch-qmp-cmds.c index 8721a5eb13..ef5aedc1cd 100644 --- a/target/loongarch/loongarch-qmp-cmds.c +++ b/target/loongarch/loongarch-qmp-cmds.c @@ -9,34 +9,15 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine-target.h" +#include "qapi/commands-target-compat.h" #include "cpu.h" #include "qapi/qmp/qdict.h" #include "qapi/qobject-input-visitor.h" #include "qom/qom-qobject.h" -static void loongarch_cpu_add_definition(gpointer data, gpointer user_data) -{ - ObjectClass *oc = data; - CpuDefinitionInfoList **cpu_list = user_data; - CpuDefinitionInfo *info = g_new0(CpuDefinitionInfo, 1); - const char *typename = object_class_get_name(oc); - - info->name = cpu_model_from_type(typename); - info->q_typename = g_strdup(typename); - - QAPI_LIST_PREPEND(*cpu_list, info); -} - CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { - CpuDefinitionInfoList *cpu_list = NULL; - GSList *list; - - list = object_class_get_list(TYPE_LOONGARCH_CPU, false); - g_slist_foreach(list, loongarch_cpu_add_definition, &cpu_list); - g_slist_free(list); - - return cpu_list; + return generic_query_cpu_definitions(errp); } static const char *cpu_model_advertised_features[] = {
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/loongarch/loongarch-qmp-cmds.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-)