From patchwork Fri Jul 30 10:59:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 489312 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp3040481jas; Fri, 30 Jul 2021 04:00:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXrMl6nUuVINBGu0lQ4RbHpExef+2xl6+vKvzvh2c2c/3oZqcuH9CY3wswVFfsy4pKRp/2 X-Received: by 2002:a25:2785:: with SMTP id n127mr2328165ybn.235.1627642823351; Fri, 30 Jul 2021 04:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627642823; cv=none; d=google.com; s=arc-20160816; b=dS1plJgL/IEWm1dNNsjc/ii1wlK/tEqbn9wB6GLV4NgUAsH517/TnCoij4IO5XrUrI BqYl+RthuAZxJ1j4pq9xQM0SekayeQAeBYYAfwuY6BeYkYJI8lAeS34p+r5EI7SUpawz VGSeqd5XFb/BtRU3UvlgQJv2cOFmOm3ltPvHZRXz17Da5Msoa79dMHOtmNEffNLS0axK uup9U5ADy98Xe1TGJAK7Y5ozed7Mmw6Q4oVi6BgyvHoTqamYcpwn63S9Tfil/uU9yyar bPnkYNPiBvtHboy1u/MoPXJJWd69hJGaLuXFK2pD59Xa7qmx3Pcj3dWVhLiwaG0cMi3x QWpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=grrH4yZDT83NlMAFyF6VZHzq6DhTbZi1iqbpXWdsyig=; b=dXAWfaHsO+SrD9vrmldpnxfDn9LL6GfBP5wGiolzQYOart5h/54BP8Xo/gQC5DtEn5 7GW6JEDIYipVcAB+GOw0giB8NFKYx3EUHteityeohcdOE1xecgJnoQwHzkhpTaG6HJ1u V5pPjWEiXHJIGuqy7T8MkFdJSB+o6bW694fwqD4DMsNW1As1+amwqxmY2DvQCyyNdD6S RIDo4Sc+hy2HAzIjMBQHUi4bnFsL5kOoZ5SSlvCrWNepb3Xp4jz9Stni9H2U8//flA4h yy+/K+GWdl8xGTrgNRUMlpS+uw6wRiqbSNfuHITG+VjXquE5Slj6lqcAt32tA1ED9I/5 0rmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=h3DysLmh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s9si1560185ybo.180.2021.07.30.04.00.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Jul 2021 04:00:23 -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=fail header.i=@linaro.org header.s=google header.b=h3DysLmh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9QFa-0008VE-PV for patch@linaro.org; Fri, 30 Jul 2021 07:00:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9QF9-0008SQ-JZ for qemu-devel@nongnu.org; Fri, 30 Jul 2021 06:59:55 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:35595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9QF7-0002Ur-28 for qemu-devel@nongnu.org; Fri, 30 Jul 2021 06:59:55 -0400 Received: by mail-wr1-x431.google.com with SMTP id n12so10807830wrr.2 for ; Fri, 30 Jul 2021 03:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=grrH4yZDT83NlMAFyF6VZHzq6DhTbZi1iqbpXWdsyig=; b=h3DysLmhKRgDni3tfJGA2E7gQdK8+caQVKW98P9d4Z2ve24J2IxnpsOc7nBJCyn97C hS3jGQoV2qliLBLPlio4MbYkIqRhKzpyxlwl3yv4/ZNQGXMGuTkgr2cJfFElnNyV7OSZ hC3mpadqVOZGaezUIy+u8NALfEKVs1wXR23H5uMJjDiFEMI9QUuopNdT6nCaRoBI8Hmo 3j2/NSE93iAto+np9Cg2XeKJts5n8mOKP4XFAyXEFa1oEsz0hl1v36RUGSZuFbmXMDUZ NMyaczDlynZdPZ35YSAIAbZ8n99bEkEyzxcEZ1JRBaT+jYs1h/k2vDpcv8Q1o1wxfq7s wTpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=grrH4yZDT83NlMAFyF6VZHzq6DhTbZi1iqbpXWdsyig=; b=Er3T8SWGDl3ah8VN9V7351Ov1utVtAAtk27rqx6qMMQSo77pmPcW14OtYTm/BqScrj s5b3CG8DZbUyjPFlnMuE3+TPbL6eZHJlmYtf3HUGw2rdrP3mIok/3zP3UTAhio623aaT 2CeUULrtq6//if0n0HH6iWfBKtijteCdZbH3Zx+GJfRUMeTwoBdMD1rwImeZF38u6fIf 1pF+qsfnOjhOyCTRclvV+dift9Iz7s+80f/INqr0cwuoctg8eI4gRjESnNAkctAdMTVA /5vFRm5lh5AbixTmCMyzAMQrKxPRu9dV5GBfPKWexgwjuhlwPNYqh74T/StVZdSVo4bV 4KmQ== X-Gm-Message-State: AOAM531mlvcCAe+Vt3se4hP8ArGkCC0bVpYQUkIlmxJQD7mCQkkYzO+L rcoVKOb9a1+3J2lpAKi0R5V2tqLAnbo0Pw== X-Received: by 2002:a05:6000:232:: with SMTP id l18mr2426923wrz.24.1627642791608; Fri, 30 Jul 2021 03:59:51 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id p2sm1349697wrr.21.2021.07.30.03.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 03:59:51 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 2/8] monitor: Use accel_find("kvm") instead of kvm_available() Date: Fri, 30 Jul 2021 11:59:41 +0100 Message-Id: <20210730105947.28215-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210730105947.28215-1-peter.maydell@linaro.org> References: <20210730105947.28215-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Markus Armbruster , Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The kvm_available() function reports whether KVM support was compiled into the QEMU binary; it returns the value of the CONFIG_KVM define. The only place in the codebase where we use this function is in qmp_query_kvm(). Now that accelerators are based on QOM classes we can instead use accel_find("kvm") and remove the kvm_available() function. Signed-off-by: Peter Maydell --- include/sysemu/arch_init.h | 2 -- monitor/qmp-cmds.c | 2 +- softmmu/arch_init.c | 9 --------- 3 files changed, 1 insertion(+), 12 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 7acfc62418f..57caad1c675 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -29,8 +29,6 @@ enum { extern const uint32_t arch_type; -int kvm_available(void); - /* default virtio transport per architecture */ #define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index f7d64a64577..9ddb9352e65 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -58,7 +58,7 @@ KvmInfo *qmp_query_kvm(Error **errp) KvmInfo *info = g_malloc0(sizeof(*info)); info->enabled = kvm_enabled(); - info->present = kvm_available(); + info->present = accel_find("kvm"); return info; } diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 3f4d7c1b1cd..9011af74e4a 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -87,12 +87,3 @@ int graphic_depth = 32; #endif const uint32_t arch_type = QEMU_ARCH; - -int kvm_available(void) -{ -#ifdef CONFIG_KVM - return 1; -#else - return 0; -#endif -}