From patchwork Fri Sep 3 09:03:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 506488 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp829530jai; Fri, 3 Sep 2021 02:17:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5uJVTn9gtZlUDFN5Bxegso41Z8+QjZTaCzQZkcIW6teCPRrCjzoDuOBmwHC0PHb7RjBHw X-Received: by 2002:a67:f7d3:: with SMTP id a19mr1652014vsp.17.1630660660280; Fri, 03 Sep 2021 02:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630660660; cv=none; d=google.com; s=arc-20160816; b=iSgzaidfGTo9YBoG7U8an6pVY9ostaVqKFxNKvYtCGmLj2dP08VY50Tnh9UijGBDJ7 1/oyseDSnxfroAvoRNQRiO86hthcgg0z/jgvUffwflBIZZZJszo5IrCueypyz/AWh1G3 jYIB1LeXH3JgsnF3FzBR5EQOTvbOfPoXfi7c3vDPbDyVZ5hnuI0hqYhzWtJYyxTjeeaE iVg2eKFbDE4a2VkeGIHCTfnHhEOV2nxlAR2JWQp06nnSpyBGQsLShj1J2TmWgA3vaBfX A7DkWx/TNPur50zBRdBmIbeZoZY79YGEN+B+fYUSTIwDz6Yu7hutDq5nlPl5Dzg4G/wd OuJQ== 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=Gnkvq2Rb6V5W7/htmB7BU5fOrcMpKnuqDaYrMUnPexM=; b=kUmTjl0AWjA/6uDTRafhjmh2HCCXT2JZzJDee4B5YF189MIavPGeILPdqRCaRlGDyT cc6RwmuUuV2y2hpLswB5JIFs/oT9gJlgsWsTB/NFA+d8Mokd3J2rKw2dOPCSRVjE9+wQ qAYRumBrvZFELyxG8yXyb8IESjAMv8wA28fAjJ0oKj0xFBYO5uOs31k8ssG2zZbltIrN 6cz/OM4KX863N/abmJLvQ0/FyX0Jh0qsJ9Fz0LPFDZh/lXtoM8xWp0LMVYLR4E1Ab5yJ hA4Jk/PW7ld3imaAivFKMJuKrwGFuZ09ljGf3LJL0MAK5kQFcsKr2lUUPq1oz+kpS6Kc Gd9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VWEhf7CR; 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 ba8si2249600uab.55.2021.09.03.02.17.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Sep 2021 02:17:40 -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=VWEhf7CR; 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]:40230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM5KN-0004Cm-Md for patch@linaro.org; Fri, 03 Sep 2021 05:17:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM57C-0006ID-FM for qemu-devel@nongnu.org; Fri, 03 Sep 2021 05:04:02 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:40780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mM579-0005gi-GK for qemu-devel@nongnu.org; Fri, 03 Sep 2021 05:04:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id t15so7186990wrg.7 for ; Fri, 03 Sep 2021 02:03:59 -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=Gnkvq2Rb6V5W7/htmB7BU5fOrcMpKnuqDaYrMUnPexM=; b=VWEhf7CRE3WhAySygm0n1i6/e1W1OQPizCUNEiEWBtMQT1pDE3tzThe4opsst/Ki05 g6SYjGhvFEInD4k3jI5X3TN5MzchB5bEbH1/bt2pgRq3QBNutIbcRiARDPBVT0nFZq1g HIBd+MZ8AgVxWksNxkwb4bb3jaVF0DRIddmMbSOeBUAkKT0DaWKIhQfSDsgQfx9BKqNt wOCd1UD8rBeF09bywgziNjlscZmnGnPiqYa1ihiVz5qaDEgvduXPEFaCxeEKNSRQMIQP 40hxHjiwdtUQw7hOLfc5v+s9ZJzAroZg4uvXjdJsSW998KfIM74jAuHwkUTXmq847L0t cZKg== 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=Gnkvq2Rb6V5W7/htmB7BU5fOrcMpKnuqDaYrMUnPexM=; b=C2C1vHxnDPBlQKWvj03lNjesH7CpwVU0ZXKZq4IZ8lg9OWTjmyiPr1eFDSU8h4qJTs sXKsxL/g6MLmIveQ7eCFVhSS6P0mAXiJI7cdBl/j0IP151TvB7VZHOpKM0J8y9LrWaUu 21V8Q/arrPnB74Vc2Oi4xNQx/Noa1Pizbd2xh8wkMwAgMZrdu/kam5oCvfkfHZchig3c Fi63sGBFyWg2GQ/lrxP+HCB7VrsAFXkf0AHblh1TSja3elzeSgBT2DtgFksX/5Gvl4lJ QzqCX8jSzeUXSEjJumFbAdYTSfo2PLFol5oORL2XE3Q2rC8iBM8XqHkOBxGJom/zO4kW EnEQ== X-Gm-Message-State: AOAM531DUkPEVPR8sfOfk07t6o1B4ri57NJipkyQOnrsYrbFsIIMsqBR AfdHs2rfx7fDLfzbmNMh/rdYPA== X-Received: by 2002:a05:6000:1808:: with SMTP id m8mr2773435wrh.272.1630659837996; Fri, 03 Sep 2021 02:03:57 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k17sm3935314wmj.0.2021.09.03.02.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 02:03:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CC4881FFAA; Fri, 3 Sep 2021 10:03:40 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/22] plugins/hotblocks: Added correct boolean argument parsing Date: Fri, 3 Sep 2021 10:03:29 +0100 Message-Id: <20210903090339.1074887-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210903090339.1074887-1-alex.bennee@linaro.org> References: <20210903090339.1074887-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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: Alexandre Iooss , Mahmoud Mandour , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour Signed-off-by: Mahmoud Mandour Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20210730135817.17816-5-ma.mandourr@gmail.com> -- 2.30.2 diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..062200a7a4 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -133,8 +133,18 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && strcmp(argv[0], "inline") == 0) { - do_inline = true; + for (int i = 0; i < argc; i++) { + char *opt = argv[i]; + g_autofree char **tokens = g_strsplit(opt, "=", 2); + if (g_strcmp0(tokens[0], "inline") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_inline)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } } plugin_init();