From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 596B8C433F5 for ; Fri, 3 Sep 2021 09:19:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D58660462 for ; Fri, 3 Sep 2021 09:19:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D58660462 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mM5MX-0004O2-7L for qemu-devel@archiver.kernel.org; Fri, 03 Sep 2021 05:19:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mM57K-0006YL-P1 for qemu-devel@nongnu.org; Fri, 03 Sep 2021 05:04:12 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:44928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mM57F-0005lS-Co for qemu-devel@nongnu.org; Fri, 03 Sep 2021 05:04:06 -0400 Received: by mail-wr1-x42d.google.com with SMTP id g18so7174978wrc.11 for ; Fri, 03 Sep 2021 02:04:04 -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=P0i71SO0mUfOxacGplPpPt2MK0kYjZTuvRy4ItPlDSU=; b=YLuv6o8Q6q86KhnHPd4gpYOdVjBAoVIwsG89SLENecGj4DYUgAJ8neNjKnayOQvtKL q0qAvzfj8bRrr6+bR2pkhvYBGJxnxtS1yIinImUwxgZxqe3qjLbZKf1YgFySQjmZQLtL xKA7SlJh78XHtB0udg2goZb39EFpUbX7EqZHOnVi3ikfbkHA7VQsog7yzwcKtUn2Jp9K H3xqchSiZYrhvX8S0zF0ddJOt24+i1Da1So9wlmwu+cV5QU5E6s1PfM9F0aMxrWYCQPW MjawGKTqoBJPUaWKZA04SlwzPCanDFQwG5LGZnrGOoYremBo5ZuUOO59RJ9IjTTxNxYj BDrw== 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=P0i71SO0mUfOxacGplPpPt2MK0kYjZTuvRy4ItPlDSU=; b=BWtZWkxIgQxcCbLNyOj1HaCeFdH7nMWsXArL+DukGmYK9coO+RwTIuPZ81UcQV/dP/ cOkJI4s6NJyRzPpg32AKnbSzAjSfIX81dEPbOsHoDilF+VKT2IRB75Edf1miSEdf6Go3 hKUlT8AV/yzbOhxQeRdWfaeSmzcyJ3R5e8UMRpjiSVaSbizQqUA5XXeRpANOGZaIbbzD usN/AkS3GmCxJg2EYWRwngoBURrtIlPBPeJgFSpUPIyLcBDwi0El9bp95o27996VfWFh J9C0Vp34SM8IYTSNNo8q2FHzZwfLENXafXaUw2Aq+kCfEbA2CYD0skkb7tNTsSYM6NJA GaSQ== X-Gm-Message-State: AOAM533g/1ABiWQ/dycBnIDuFG/YFP3BP36ButbDZOZxw+sqTxkQ3IL7 fr5/L/7KIPhf6iDT3lRYDwRJFA== X-Google-Smtp-Source: ABdhPJxCe10EgH5FGr7MuKkOf41eKw005FZlmnyh7LsdHKi8Fgo115NmfKUbkPqE7I/3g2+wCsu7XA== X-Received: by 2002:a05:6000:1091:: with SMTP id y17mr2729359wrw.202.1630659843986; Fri, 03 Sep 2021 02:04:03 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l2sm3876051wmi.1.2021.09.03.02.03.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 02:03:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 360151FFB1; Fri, 3 Sep 2021 10:03:41 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 17/22] tests/plugins/bb: adapt to the new arg passing scheme Date: Fri, 3 Sep 2021 10:03:34 +0100 Message-Id: <20210903090339.1074887-18-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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=20Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.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-10-ma.mandourr@gmail.com> diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index de09bdde4e..7d470a1011 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -104,10 +104,17 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, for (i = 0; i < argc; i++) { char *opt = argv[i]; - if (g_strcmp0(opt, "inline") == 0) { - do_inline = true; - } else if (g_strcmp0(opt, "idle") == 0) { - idle_report = true; + 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 if (g_strcmp0(tokens[0], "idle") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &idle_report)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; -- 2.30.2