From patchwork Thu Jan 9 02:17:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182771 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3154924ile; Sun, 12 Jan 2020 08:43:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxjOdM6jEvxvRzPujvIB5nXGWz5XBR1LJSop3oRrwgH4Ca+RqrCFScWH+EEh8Qelz5BiJb2 X-Received: by 2002:ac8:404e:: with SMTP id j14mr10179921qtl.312.1578845273540; Sun, 12 Jan 2020 08:07:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845273; cv=none; d=google.com; s=arc-20160816; b=0Tac468fBUrgPBcrR2mTuoQmsHIbaqcHmewXk6mfiTkPakEkYbfZahzxCevd42FpyL /v8yHmm0bjcFs7YINHzp8yujKmRDblY900VY3P4KGRCuCZv47Qi0pZHN7U95B16unTn1 O56AG6/PP9gU7X9YUcdzII6Mw2KqCr8fNkMutvqXDyk+6AGw2UeXYo2LOo9V1T11gA+w nfbi9Jzmv49RmbiRMmVK7bqQ4r1CpiPIL7drg/dUst0M5x1R09dv1jwtoPsKuGrJrokC u1Qwk/jiVNL5lKL2k0HoM99bjnzHKrDy6x313CqSOqj5YDwtamWpMrcCx49++HBjIaU8 llbA== 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=UEu09f1Nlqe8aDmLncxcurE+ZboCmDUATKx9s84WZ/k=; b=b4mq0nsL/RErLEopZ0wVNMzp+U4UndIR01hE+pEQUDAfXzgQ8ltAb09CHVJfR5BCMX j9Byd8skMwHJ54rNW4227i7p3uxff1V5qZS98vzfNRyUXF5vf+/NV8mYmORxWEBo+hSY 4TuqgtsXXx1hVm3Xkz858NLlrxVTuTgo2AwsiZIGhQhST7WruwXuMJcSDOvlpwvX4MeE wKVlcjF/c+vqeqg5R6dkKM4jEL8c+x/1ynfJJ3XpaUhRVXnd0umwP6i48Elh07T55CkE 6lh7WGKD5DlaUCROvIh9SPqP3FP3mfO0OzbFFMDlE1lTidwbe7efuxlEfG27gxckKtmT /sAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A5S75hZQ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bv20si4820116qvb.23.2020.01.12.08.07.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:07:53 -0800 (PST) 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=A5S75hZQ; 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]:53408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNOX-0007N8-Lm for patch@linaro.org; Wed, 08 Jan 2020 21:17:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34808) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNO2-0007Fg-Ku for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNNz-00086R-DD for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:26 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:39204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNNw-00083y-9D for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:20 -0500 Received: by mail-pf1-x444.google.com with SMTP id q10so2572651pfs.6 for ; Wed, 08 Jan 2020 18:17:19 -0800 (PST) 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=UEu09f1Nlqe8aDmLncxcurE+ZboCmDUATKx9s84WZ/k=; b=A5S75hZQnMsJ1nbOjo9RnK9XtB8yFbaUULsBPbLEB6/GcjVm1l+2HCgRNadFzGkQX1 5z3Ipkc3WySJA6h5CZvIMPLVPvKo3QAynfKGtJcyZDsuhID9J80AWz74o+0+czmTcL2G i+bpptvkeMh8CnM5/fz7PuFgE66wbrdItvABM5WrcNjK9JPXnrpEiuP4AbU4A6AF5rVe Uq6lHbgssuhBgTi9PC9onSmtLj/JTJ5pY9le/s6H4VMo/gg00V8b684AZw117AtUPvFy HhjJq08vpO/9yWSRFwOScY9rfzP0gtl6b5c6xTmdVoqE8BlS9ywvpRJwSdFRrihVV9Rr fGaA== 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=UEu09f1Nlqe8aDmLncxcurE+ZboCmDUATKx9s84WZ/k=; b=dy5xenbeVRA/JxZmUPbgNJxF5KOon54udTrfyWldl2VHcYvsX/UXqYDu4tGrpbT0Qw YvGjW0OvjZgbaRQeLyXwaLyvhvpbXWvV+BEd0l2PgoyaYld3QYkvQO78oLeWeJJkQxE3 cbv/Z5TcJEDR5zUx3xAzHPyHZqf/Twos1I1IEfhGFIVBEmNO0I0TMdeYu93DurO61M46 BJa+8XPm5v3669iiQaljwaP+D1RiHccR/h5lc//MKO1VjlIluaToRyiKsl5Lqioawabf 4m75PQ75BtXx8AXXFRyVTLFQC6+yxkPAAzllRiokEIyj0F74jVblDXMFEzZO5w2pQqSW vWUA== X-Gm-Message-State: APjAAAW7Vzr0srWd8Zjv3uLeYKlNUKZie5eys04L0DLFCRVMUOHcM89g 8mut5UKTql7qq8BRJ4ni6mIuYqaFQ+3qHw== X-Received: by 2002:a62:e30d:: with SMTP id g13mr8714360pfh.92.1578536238344; Wed, 08 Jan 2020 18:17:18 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id n26sm5166715pgd.46.2020.01.08.18.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:17:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/4] vl: Remove unused variable in configure_accelerators Date: Thu, 9 Jan 2020 13:17:07 +1100 Message-Id: <20200109021710.1219-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200109021710.1219-1-richard.henderson@linaro.org> References: <20200109021710.1219-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 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: pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The accel_initialised variable no longer has any setters. Fixes: 6f6e1698a68c Signed-off-by: Richard Henderson --- vl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.20.1 diff --git a/vl.c b/vl.c index 86474a55c9..be79b03c1a 100644 --- a/vl.c +++ b/vl.c @@ -2749,7 +2749,6 @@ static void configure_accelerators(const char *progname) { const char *accel; char **accel_list, **tmp; - bool accel_initialised = false; bool init_failed = false; qemu_opts_foreach(qemu_find_opts("icount"), @@ -2776,7 +2775,7 @@ static void configure_accelerators(const char *progname) accel_list = g_strsplit(accel, ":", 0); - for (tmp = accel_list; !accel_initialised && tmp && *tmp; tmp++) { + for (tmp = accel_list; tmp && *tmp; tmp++) { /* * Filter invalid accelerators here, to prevent obscenities * such as "-machine accel=tcg,,thread=single". From patchwork Thu Jan 9 02:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182788 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3201981ile; Sun, 12 Jan 2020 09:42:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwg7JENXgLpVtUHnDrSPhn1oT9EtrUe8f4cnsBXn71Qtm9K3ef+uZHXIjXgnCK9CnT+Eb8O X-Received: by 2002:ac8:140c:: with SMTP id k12mr10853237qtj.117.1578845280111; Sun, 12 Jan 2020 08:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845280; cv=none; d=google.com; s=arc-20160816; b=C6j7pad/+y5nZnHr7Jw7mE5Je2p1GBhXTeJHhWeDt2YKE7pUndVMB1AsJXgCQVbkjK uztTuWdPFQkuLD1vihsO1l2OIIx+KuyRDHoWe+thMX5+iqii+Y+EQewvgvBjmIyvjQpt BDjXxlL0T3MN45fpSMv741E4MXaOJI17XGUQyXoxvTVeo7eqR0mrYVYzRR9iYj6BuJzx uLB8YgNdAmO+z8aRyiPKgPuQN6Exqs9bLUdIaohk3vRzRpj8Bgb6V5RVB2Dm8Y2sOFTs 5Oxnu+u75KfE4bAQE8t/YcTbgajJFlZQP8vGmMBB1USYzPtwF8fnZ1MGvDi1lZTbsQdg EFRg== 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=HbO57U5Hq9On8Ktr+WRBLRrRyCTJojmW4JU+oahW540=; b=i7rCEoGpaiNU9joFivNT8bpS6gYa+HZdIiVLS3laxsGaeihbjjQrJyGKmPBAlfI8rz nbmfswFrGIjVtGKCjzz+Ns1e49vkkCvzQVpZsvQ7We7ReYl9PWJIMtmz0QPI4GuvpOZg YElJWQzTfXbr25HT6EI0k2fneCVpJqr2UhifJ4pc6ft9Cvt4TaPWZLQUfH3riZzGWB/m j5Wbmj4D2j2HAWia2pptUqHi9xRq00MF660bi6x1dlxzkc+vO7UzORmW6sJTV2GPbcO8 EGZ4K9dAfSwezDw4fbsJBrHYEJho/1o/cK82tkUGe70/7SJ3StfwBdU3MN2LI7f9MC4x QSng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uKnU0jk7; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 197si5138046qkm.223.2020.01.12.08.08.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:08:00 -0800 (PST) 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=uKnU0jk7; 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]:53429 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNQz-0002pz-4A for patch@linaro.org; Wed, 08 Jan 2020 21:20:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34590) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNO0-0007FW-Tt for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNNz-00087i-Pv for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:24 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:54706) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNNz-00085C-Cc for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:23 -0500 Received: by mail-pj1-x1044.google.com with SMTP id kx11so439833pjb.4 for ; Wed, 08 Jan 2020 18:17:21 -0800 (PST) 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=HbO57U5Hq9On8Ktr+WRBLRrRyCTJojmW4JU+oahW540=; b=uKnU0jk7th8WOW03TQGS2qQHsZO9iA/QRWb7E+qQDhLvPPw3RJAzfiDPBO7We+Xbcc uHAZ6JooqY4A6oR1/FUI4Gp5nKcvKcvIF0eDQuebZoOZWvWM5isWUFAEW0ym/gJI21bV ezA/R/SalQ7OApBC62hZKhQ4uxN1t4RnnUddUyS/ORlMZS7TnGEn96uHMDgpDOn+KZVw bG3UfejmS8IdRBmbunpEBe67kM4T2baR/GpcO2WSsQXWAsP11PkaCWcmFlPaugj74bpF AdjBUmQA/51RNxKjpr9tPvWRYSylmJkVOD6uDKe7sWqPawA/3dRRZCN2SNzSHx0uol13 vthA== 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=HbO57U5Hq9On8Ktr+WRBLRrRyCTJojmW4JU+oahW540=; b=mwDM5hG6eXR4P0943kIJHOrHXMoVJoTfgC9l61rNQR8e6uDSWU/THSNQg6xL/+NV/a Cu2avQA7El6/6j6Wmud5ZNsDsYpczXqaJzfpkv4OSdSOXXhBEo3aQuoAv3Te5XjiZ5R1 sNnwAUVUvRRJ3uiBP5B0zaBPVLLTk1Fl10XgikMR9TMMz/tS4s9It/pJcoQKgH5LWUJa M+g+TE7rSuakiyNWoQqtdOzXR4/2fe7L0Dz9txvBzlbzSP3xo/rLVo02zXRzcFk7mxoU 8QFCL5RvuRgCkOMHPkjwJn26SFkmqQd14YUKcXrILdBXXP19BLYxyOIAyXCY9+FTFMKz A5zQ== X-Gm-Message-State: APjAAAXBZ/pUU6KAzmjZz/oiXkDLjb/SoLXSIqXGoUNxgK/a8Esh3ebj LVLPnmgqwDNgWhwqoVNjZj+3JlVhvsOuKA== X-Received: by 2002:a17:90a:19d3:: with SMTP id 19mr2294472pjj.1.1578536240516; Wed, 08 Jan 2020 18:17:20 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id n26sm5166715pgd.46.2020.01.08.18.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:17:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/4] vl: Free accel_list in configure_accelerators Date: Thu, 9 Jan 2020 13:17:08 +1100 Message-Id: <20200109021710.1219-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200109021710.1219-1-richard.henderson@linaro.org> References: <20200109021710.1219-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We allocate the list with g_strsplit, so free it too. This freeing was lost during one of the rearrangements. Fixes: 6f6e1698a68c Signed-off-by: Richard Henderson --- vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/vl.c b/vl.c index be79b03c1a..c9329fe699 100644 --- a/vl.c +++ b/vl.c @@ -2748,7 +2748,6 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) static void configure_accelerators(const char *progname) { const char *accel; - char **accel_list, **tmp; bool init_failed = false; qemu_opts_foreach(qemu_find_opts("icount"), @@ -2756,6 +2755,8 @@ static void configure_accelerators(const char *progname) accel = qemu_opt_get(qemu_get_machine_opts(), "accel"); if (QTAILQ_EMPTY(&qemu_accel_opts.head)) { + char **accel_list, **tmp; + if (accel == NULL) { /* Select the default accelerator */ if (!accel_find("tcg") && !accel_find("kvm")) { @@ -2787,6 +2788,7 @@ static void configure_accelerators(const char *progname) error_report("invalid accelerator %s", *tmp); } } + g_strfreev(accel_list); } else { if (accel != NULL) { error_report("The -accel and \"-machine accel=\" options are incompatible"); From patchwork Thu Jan 9 02:17:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182755 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3120009ile; Sun, 12 Jan 2020 08:03:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwA1FUvDvKbI6Li3x9XdnKHPEx/fY2U4T6dPzBS6K1K+jLcJDY+zg4W2tNZXUDUaFEoqmvf X-Received: by 2002:aa7:d714:: with SMTP id t20mr13229859edq.93.1578845025713; Sun, 12 Jan 2020 08:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845025; cv=none; d=google.com; s=arc-20160816; b=st5SJY3uTD+Ip3HhONX7BbpkNTZNp0rJ5NHi4y4h/D4ycTkZlzxuM1yZSs4yDKoTg5 7WC6TUAaeV62NBOKLxshA9L4Wa5J02nJ4z1H/RkiEt9RBiKutFdy/fljERFWxXEFXY2a 6Jzu5r70ymmoHhMS+vh5FHcfqDKG55IivIbjbO+r4SsVPbcQvQFx7C1BkRu9a2ZdfJ/w LzIP3Qszr9V7yiBMV8u0k8f3atuCgbkN3GRBKy0Mc/nKs+wq4YhWVRuJVFsFCip+x5WD 36mJF8IOUjV2siCrkR3l/B/HuzsirOCcFaiGbm3jPoAUqYiL4jeMbButhAIYBUo+VWNb ykgg== 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=ggTNIXckHEhs6NEA+P+FO98Kh7NZuAYc0hm4wcTirRY=; b=HN+lOkL7I8OcX7EfYMstzuQMfcWQPOiaRc94A3YDwU07pNMoGcj/Kobt0YSVHDIGeG 0GObMWl2UTSiqjiGfMTgBJ4plK/exxFQ5M8fGuejg3ZcJChQOcbYH6OKN3MSqcTydQa/ uFVg8LqcyjKiH1UPwRuttcakKTBmUr2G5qfojv114ofECzWUMDeUaX1gxJP0phxkg8Y1 lhjBU8jZeuVMB9KqL2QAJbYuSfKacjdJ4YWrqtX/eFd0JndBfftS+yRmGN6tdf7XhTpo A6/tr9S9XWLNk4rpMrkD0ExvfC78Q1sAFyNCTQi96G1pqfBuNVe3/V6W+kDU2Vt7ica3 J93g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQoNxuTJ; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p4si5685834edy.443.2020.01.12.08.03.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:03:45 -0800 (PST) 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=OQoNxuTJ; 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]:53494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNT6-0004o6-J4 for patch@linaro.org; Wed, 08 Jan 2020 21:22:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34661) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNO1-0007FY-FT for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNO0-00088e-6q for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:25 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:38330) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNO0-00086l-1J for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:24 -0500 Received: by mail-pj1-x1044.google.com with SMTP id l35so438251pje.3 for ; Wed, 08 Jan 2020 18:17:23 -0800 (PST) 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=ggTNIXckHEhs6NEA+P+FO98Kh7NZuAYc0hm4wcTirRY=; b=OQoNxuTJI4X9Dq7yjWdNkLddYniY1zFSLk6MnaecmRqplXArLbeTjytpfaQ47j69eG 9Oht3XGM4nI8tCBu2wjuIEZclvERC8A2+fwSevE6CxiQBKyKXYr97GKPiXJTt5LfLfsl D0qbCalJiILRip/zJ95AOTdWDWta8YGZT1ne+F8wYR2NZhWIkLsV9cn/lFtWlMnnredM loaqiAbU2EJl5D1SS0uihO7wJYZuu5XpcM7qrI6dmkZY9mW5UOcYox5+IWbgTW3GKejP djYWVEoN38atM5rcLM+QC7iXotg6vqj+185pun6luR7IR64fVhjjXvGiCOy+cXgxpmJk JBlA== 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=ggTNIXckHEhs6NEA+P+FO98Kh7NZuAYc0hm4wcTirRY=; b=MNlOI+NbVLjI8DS78JEuy1CL6WBwZH5HDXf1pR3ah8/ZO5hNP58V3DZBFgz14bX3Dc fc52JMgQowWKHjPqsKDc1dEvy6Ja3bLMH0w5zBn8eokTDyZcaiyt6KkiFoFSuxBP2CvQ 4PGfLJ5KysYtXM5Jh9xqzUceXWv7V5Vt39ydtaRiRa1I4kkWb4uAf3RWBvrG/RgOoT/f YlbnmSzOLz5sK9jRrKDOSAVU4/IYDbzTVsHquLp0DzjM7ogeHiUK8qwRvl11vAXssj4H pnHk7F5OIKBYWnM+cQ6q8WZnILpzW9TbziCaQF73r8wniJl+7dT41FfTkfoJUQOFhDVx ZyIQ== X-Gm-Message-State: APjAAAW4WFtvsn5Rs6Cx4EjoC8Fg2fbHB9NTpbig0tWFi8MPWGTmJNW+ S6jCbVbCY9qbEALLYtxzyKlu0x0bG+fwxA== X-Received: by 2002:a17:90a:e982:: with SMTP id v2mr2306669pjy.53.1578536242765; Wed, 08 Jan 2020 18:17:22 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id n26sm5166715pgd.46.2020.01.08.18.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:17:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/4] vl: Remove useless test in configure_accelerators Date: Thu, 9 Jan 2020 13:17:09 +1100 Message-Id: <20200109021710.1219-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200109021710.1219-1-richard.henderson@linaro.org> References: <20200109021710.1219-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The result of g_strsplit is never NULL. Signed-off-by: Richard Henderson --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/vl.c b/vl.c index c9329fe699..887dbfbb5d 100644 --- a/vl.c +++ b/vl.c @@ -2776,7 +2776,7 @@ static void configure_accelerators(const char *progname) accel_list = g_strsplit(accel, ":", 0); - for (tmp = accel_list; tmp && *tmp; tmp++) { + for (tmp = accel_list; *tmp; tmp++) { /* * Filter invalid accelerators here, to prevent obscenities * such as "-machine accel=tcg,,thread=single". From patchwork Thu Jan 9 02:17:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182796 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3211661ile; Sun, 12 Jan 2020 09:55:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzxX3xZYMf0+TzYlxYuGH9RrxWAUEiUzZd9GyFMD7C0AXJ7KtzS60sz8cYCI5DyKQpLUAAQ X-Received: by 2002:a17:907:375:: with SMTP id rs21mr9387622ejb.351.1578845041977; Sun, 12 Jan 2020 08:04:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845041; cv=none; d=google.com; s=arc-20160816; b=XORGcM/9qkjnHmkWsLjq15zuYUdGsxhjErLKuByPfRSSda54QIhcre1iHGMELWhKF+ foEsXL2w5USKqhcawBH11TkGVaAq9fHkA463O2PR7F2FvGoLldtbAbwIDkMOUCW5eK+i pw2m1M1H5l2WKD+6HA/SBERf9pHOwNfliOAj0UVJxncgiIyhuUKYQKLZj3yYiXaFkfkV dCZF8HM2VLAmR7Oo2e/9XHLb5k/9JLNcy6bnYIDe8yDc/QxzDI9oKDlVakRkDZ4Pqe6Z NRPD1EhxV6NAJiGvAAf2tzZbFUmxfpwcNUhZEo+nGz3r2x2vzPdxAwzeCyjf/WQNWtHH vWrg== 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=71biz+iT3vb9rCukTO9Hbb/aNJiPW+OOTq+eiVqnO3Q=; b=H9OuvO7+035kcLgykyCiOuZt8ScgH+wx705gqWYqMZwwwPMJtZ5aTBM8rpOsBC0YlN tx+cCjPu/APLGYubCHlQBBsSH7Gg3F8fNeMHsNJfnneABqCELWh4dN6eXcxGXcLFbU3Y S5ticjmfXfJ20fz0ZmepIFQZi8/k2WN4DL6tTs+FTf+uRlTwNFNUI355dWIXiOzPO8cb bm64FB8yhCSCtJu6/gni3NyhWjsP1CUmdEErUzHVRtFsX2xzGxuh4+VBgdPSxTUx14Ls 8WRgmozU73tYox5jg/XX0GuQMINyVeslHO4kXNuIFCkY4UetAeGRdR1Dk2cd/PaeTikC Mmbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNxmweGO; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c93si5591726edd.127.2020.01.12.08.04.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:04:01 -0800 (PST) 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=XNxmweGO; 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]:53452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNRL-0003AI-Ac for patch@linaro.org; Wed, 08 Jan 2020 21:20:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35191) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNO5-0007Ij-Bs for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNO2-0008Cy-KJ for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:29 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:51936) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNO2-0008Bg-DO for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:17:26 -0500 Received: by mail-pj1-x1044.google.com with SMTP id j11so444618pjs.1 for ; Wed, 08 Jan 2020 18:17:26 -0800 (PST) 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=71biz+iT3vb9rCukTO9Hbb/aNJiPW+OOTq+eiVqnO3Q=; b=XNxmweGOHA/RLA6fhSbtVVdLqgWBVA9GRqD6bNfy8sb4NmE+CwRq5dXkN3tMXXXmk2 ZR530tOfnnEHNMn0oU4kH5RrsyLmvfUtAgS+Bf8PcAqKF5yk6XdRqFcJjQncbLGPVe4o xYoKByrsHfWChuRk1XH8hXYLJcp1iqmuKwpM265kOpqqaU3VwprSq2xt13V9/tnv83CH REeYtVwAttLzKSJ8IsDWMfS+U1y2raz8iWySkCzcp24KN3sSfmtCg8hT1EucL5mo62Fo hMN+G14fEEx6DVYFb0F6xMTyT5jOMgRskKy/qPPNySZAt9mUjpLROmmS+DOeU2trw8Or QNfA== 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=71biz+iT3vb9rCukTO9Hbb/aNJiPW+OOTq+eiVqnO3Q=; b=NpXwwCzfODsj9bwblxM89Gd7TCEu2KQ3HPeLlrwyz+UqZgzy76y8BMoad0oPJs/t5o YaKRK/3HmOwWgFQCbQ+avz/Oo5CXlyhJj4pSYXZ/umO4IGuwZknFxSjv8wWEaoWzmXnn khCgU0ouk9EMj0IlvOMKOmuTQsQVqjZii4NaL6gzSDaNq4RVU/ggWkmefOMbIgk5Zh5H K3wusw3DaSES9IUssYh+kYbB1dRjv3nGEtH8/Tr9DVh7Z+Trl6aEVS54hP6tNHQHOf8L ARXJRJBByRqfH5HJuVT00m6KR7NweSHpwVRS0s/232W8zPiOU4HxUU/qAuPSblb4JCw5 jRtQ== X-Gm-Message-State: APjAAAWfSjkqjqatbPdT4vzjYlxSvSxb96HFYAdldXA4rClbga5x4XI+ 14uBZAqKutYTJGmSWu6utijwpXe02rt4/w== X-Received: by 2002:a17:902:6906:: with SMTP id j6mr9065005plk.321.1578536245112; Wed, 08 Jan 2020 18:17:25 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id n26sm5166715pgd.46.2020.01.08.18.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:17:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/4] vl: Only choose enabled accelerators in configure_accelerators Date: Thu, 9 Jan 2020 13:17:10 +1100 Message-Id: <20200109021710.1219-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200109021710.1219-1-richard.henderson@linaro.org> References: <20200109021710.1219-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" By choosing "tcg:kvm" when kvm is not enabled, we generate an incorrect warning: "invalid accelerator kvm". Presumably the inverse is also true with --disable-tcg. Fixes: 28a0961757fc Signed-off-by: Richard Henderson --- vl.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/vl.c b/vl.c index 887dbfbb5d..9b7651c80d 100644 --- a/vl.c +++ b/vl.c @@ -2759,11 +2759,10 @@ static void configure_accelerators(const char *progname) if (accel == NULL) { /* Select the default accelerator */ - if (!accel_find("tcg") && !accel_find("kvm")) { - error_report("No accelerator selected and" - " no default accelerator available"); - exit(1); - } else { + bool have_tcg = accel_find("tcg"); + bool have_kvm = accel_find("kvm"); + + if (have_tcg && have_kvm) { int pnlen = strlen(progname); if (pnlen >= 3 && g_str_equal(&progname[pnlen - 3], "kvm")) { /* If the program name ends with "kvm", we prefer KVM */ @@ -2771,9 +2770,16 @@ static void configure_accelerators(const char *progname) } else { accel = "tcg:kvm"; } + } else if (have_kvm) { + accel = "kvm"; + } else if (have_tcg) { + accel = "tcg"; + } else { + error_report("No accelerator selected and" + " no default accelerator available"); + exit(1); } } - accel_list = g_strsplit(accel, ":", 0); for (tmp = accel_list; *tmp; tmp++) {