From patchwork Mon Oct 17 13:20:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 13008870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D4895C433FE for ; Mon, 17 Oct 2022 13:25:36 +0000 (UTC) Received: from localhost ([::1]:34128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okQ7b-0004SN-P3 for qemu-devel@archiver.kernel.org; Mon, 17 Oct 2022 09:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okQ2n-0007ym-1Z; Mon, 17 Oct 2022 09:20:38 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okQ2l-0001Og-Hk; Mon, 17 Oct 2022 09:20:36 -0400 Received: by mail-pj1-x1034.google.com with SMTP id a6-20020a17090abe0600b0020d7c0c6650so14257443pjs.0; Mon, 17 Oct 2022 06:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lHqDO/CtwHZxAdbxjsuRjbM6IKKNSg2c8E7Gksy+A9c=; b=f6mpCbhcd/C58X+iGRRpsEV6mRjTCbQY00eqf38JQRlR/F700/RE4p0/PQZwbasMdO YEgvmyBoOrO4VWgP7hZ9vxcF3kycyLef5FKC+oyk1gWbX7aYci5LQnaL/GyVGs451NCm cnL1KAOz8ApC6WTNTtTA7FU1+Gn8tnR9ufaMFTYLUy47PAlEguLomXaMOtmg8vr6Y63C tOrDNW4bgiQnpofm9S7zO3yheTa3Edk8Sq11cBlBGwmeyNPeLNbrbIsCEauqDxrnaODq EZtWjxl7my291+K/HmI2oEckH6IhiTenLLxQbjpgdFhQUNkY7UBCGW5cazhCh6zWyAQZ 5P9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lHqDO/CtwHZxAdbxjsuRjbM6IKKNSg2c8E7Gksy+A9c=; b=khAka8ODNX0UKh6eYOL35KiMwA1BZWXOnebo8rYuuu6+2WcUIFC8MwsUOG9L4stHiO YQ3ngbW/r5/sx3m0Lq8D9ciMgtcdpdiH9yyA+qpHTyww3lKvUeSN80Kd59yUzJEXZ8bu CXPqyWq05Yd/ibNf1+2IuB4/YhbaEANVKTv8s+/OqdVe0tButDxXOFx/G7n2WVlPa7/6 VOYJFvI+PTLNWnFCHIg0LxI5z4lqX4FqyKT1HpNV0/XwX2TTlRXiQhj0XdwoUz+c99HP SvWGqCpLWUqgtzSU9wV5o1R4d8r2dKOrWMs2dMDC6Zfq0Od/9pJQGWY2ZHF4j7nECBKI OPyQ== X-Gm-Message-State: ACrzQf2XDoZMgdSK3wcmJupUrltWml8TZflQ2DTKI5xiozVnEH9XHPJC xRxFbtEls1cxB2OTs7AZ01jDO+fZZjhRjQ== X-Google-Smtp-Source: AMsMyM4zYp690tbexTm3JWPExXXHl7pnvc4XxSuo3Moywy/H5M2J+vissk59Qvz7X6mtIrJkbkMTkQ== X-Received: by 2002:a17:90b:3908:b0:20d:4151:1b73 with SMTP id ob8-20020a17090b390800b0020d41511b73mr13957312pjb.45.1666012832549; Mon, 17 Oct 2022 06:20:32 -0700 (PDT) Received: from ubuntu.. ([65.20.73.185]) by smtp.gmail.com with ESMTPSA id i6-20020a17090332c600b001806f4fbf25sm6634255plr.182.2022.10.17.06.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 06:20:32 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: Markus Armbruster , Bin Meng , Shengjiang Wu , "Dr. David Alan Gilbert" , Juan Quintela , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning Date: Mon, 17 Oct 2022 21:20:22 +0800 Message-Id: <20221017132023.2228641-1-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x1034.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, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bin Meng When tmpfs is NULL, a build warning is seen with GCC 9.3.0. It's strange that GCC 11.2.0 on Ubuntu 22.04 does not catch this, neither did the QEMU CI. While we are here, improve the error message as well. Reported-by: Shengjiang Wu Fixes: e5553c1b8d28 ("tests/qtest: migration-test: Avoid using hardcoded /tmp") Signed-off-by: Bin Meng Reviewed-by: Markus Armbruster --- Changes in v2: - improve the error message tests/qtest/migration-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index ef4427ff4d..aa1ba179fa 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2481,8 +2481,8 @@ int main(int argc, char **argv) tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err); if (!tmpfs) { - g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs, - err->message); + g_test_message("Can't create temporary directory in %s: %s", + g_get_tmp_dir(), err->message); } g_assert(tmpfs); From patchwork Mon Oct 17 13:20:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 13008871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4C795C4332F for ; Mon, 17 Oct 2022 13:25:38 +0000 (UTC) Received: from localhost ([::1]:34130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okQ7d-0004d7-C4 for qemu-devel@archiver.kernel.org; Mon, 17 Oct 2022 09:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okQ2r-000811-0v; Mon, 17 Oct 2022 09:20:41 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:50787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okQ2p-0001Q6-7u; Mon, 17 Oct 2022 09:20:40 -0400 Received: by mail-pj1-x102b.google.com with SMTP id h12so11001430pjk.0; Mon, 17 Oct 2022 06:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=ScFM06TafGFnAEEgchR2vZkgEMudoWFnssv9K/jOdDI=; b=pJzQ3baBbL646LT20331wc/krPjTvJmhIwsvSUpI/lyxyLWyANYBa59GFBzfT7j1JJ JziAVN7pC5L0N2k+SAB6GQ//AV0kI3bUEmKPN9kx8NnmDTdKXCc2mq0IFWCo7frr1vxd VBxh160hFKT6lmOtig3AOjFMOZke8EoMAXu1k73EssNYN+U0T42yzcN78jTbi/wbpgUK SsAcOYwV4WZayD7WilcSIbbYr9v1yi00UEDUzloI8TY2rhWvTUlBGf/mX9xjs8JdpFG4 TcGFcwgz0Q6uqEmqZCW/5oE6SH1OjcYGvFfQE5+CTM8YRfKarwHfWATkmWVTxa0/hirM vksQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ScFM06TafGFnAEEgchR2vZkgEMudoWFnssv9K/jOdDI=; b=EwP3pvOo+56G+pDXK2kObDeRR43xiyJuE7SPKFZnTpJ784xrBJakjiyjFaFmANo34/ oJILy8TJQiNy2ojeemvL6AsZIlPwv/ZDp4aFWMNe1uRMAYYwhqYqudTixdQXlbGvgRLE RQsSETU+uFUepge3dlXwEWVcs2vCC+G+m1sv/nyCmYwG2vxfgGx1S6TXgmqw46D2Kv2G KnwRerbhRgiT9mSD/wINUTy7dDGkF43tkeNYkRyDfBpY7tZVnjKdVocChd+pBCjTxXJY PhRcchGEns/uYuIHgb69gstIbl7PUdTWRUp43XbgjFu0M4ISBESQVEM9Kt4MM6xv1oup yy2A== X-Gm-Message-State: ACrzQf1oGV51E58KYgxnpP9qDODPWduMoAXVFtl2HEsEu8XqNDaCDbxT R5bF5Fu57XpnijNNJIF0nV5mIvShw4hOGw== X-Google-Smtp-Source: AMsMyM7XhelSPNNhQneo+HoOPWIp9JRwSEwDiVIel3iDLAhFZKtwNqTpsf9xqmfMg7o9OOtEpwGuMw== X-Received: by 2002:a17:90a:c782:b0:202:c73e:5488 with SMTP id gn2-20020a17090ac78200b00202c73e5488mr32744326pjb.202.1666012837323; Mon, 17 Oct 2022 06:20:37 -0700 (PDT) Received: from ubuntu.. ([65.20.73.185]) by smtp.gmail.com with ESMTPSA id i6-20020a17090332c600b001806f4fbf25sm6634255plr.182.2022.10.17.06.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 06:20:36 -0700 (PDT) From: Bin Meng To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Cc: Markus Armbruster , Bin Meng , Shengjiang Wu , Laurent Vivier , Paolo Bonzini , Thomas Huth Subject: [PATCH v2 2/2] tests/qtest: vhost-user-test: Fix [-Werror=format-overflow=] build warning Date: Mon, 17 Oct 2022 21:20:23 +0800 Message-Id: <20221017132023.2228641-2-bmeng.cn@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221017132023.2228641-1-bmeng.cn@gmail.com> References: <20221017132023.2228641-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=bmeng.cn@gmail.com; helo=mail-pj1-x102b.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, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Bin Meng When tmpfs is NULL, a build warning is seen with GCC 9.3.0. It's strange that GCC 11.2.0 on Ubuntu 22.04 does not catch this, neither did the QEMU CI. While we are here, improve the error message as well. Reported-by: Shengjiang Wu Fixes: e6efe236c1d1 ("tests/qtest: vhost-user-test: Avoid using hardcoded /tmp") Signed-off-by: Bin Meng Reviewed-by: Markus Armbruster --- Changes in v2: - improve the error message tests/qtest/vhost-user-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index e8d2da7228..bf9f7c4248 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -571,8 +571,8 @@ static TestServer *test_server_new(const gchar *name, tmpfs = g_dir_make_tmp("vhost-test-XXXXXX", &err); if (!tmpfs) { - g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs, - err->message); + g_test_message("Can't create temporary directory in %s: %s", + g_get_tmp_dir(), err->message); g_error_free(err); } g_assert(tmpfs);