From patchwork Thu Dec 19 10:49:10 2019 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: 182080 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp312938iln; Thu, 19 Dec 2019 02:54:17 -0800 (PST) X-Google-Smtp-Source: APXvYqynaGWWcRsaYXlsF9EkXXAQr5il6kiLOXhLXTZeP2ESaHMBkQLzTSqkd6dbNx9mS5ya8SUV X-Received: by 2002:a9d:2904:: with SMTP id d4mr7834708otb.214.1576752857271; Thu, 19 Dec 2019 02:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752857; cv=none; d=google.com; s=arc-20160816; b=tcW8Vvwwp+c441BqTMgtsrkXyon6IYnubM4pLQLxEgDZtDEtX8/m5zq39wwMTMT7V5 ruAv2GR/txFeqyckTFAKji9IquPWTmk0FAKBI/gupCJswE7dlIQK4deorDYK9eUgX4CC zY++1AThwFrBEaebalQs7SLYQVvsOjVryr8eAqXHAOuYj1y9hKI7FcaSpyby/9JCR5Ac zGla6x0ZLpPd/FtwO6BtQ8XUKnL8GZFca3b9cssIeuzfXMkTGWrFKjeZEo5LdNSCoUyp PUFpjF5mbh2NumK4P+FqzcaAJeXCTy04GuagEf6lKIzWGvHBIHT64pBP+3CDnLyFke7w 5+bg== 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=d+Pda+ZdRPcyYkSjIEt1t/uTnpjt9VwcL/O1cE3PJHI=; b=ztVcc65yC6XpyXU2oEsFN7/N+QA/4XzdK9lQkHitWmi0VxcCO1LWMOBHaWzTWVbabO /ZrUl6pSkvV29AytSHV4WZLrPANdZxKZWQm5Mm8wARuDbLmvjSOfamMEeoTaNS10hftY LItv4OBGRWPjTxxyNomuDop1ludcNskln8zQLIMRGgRTBf1UvtaagUgpIq1JJXJ7bVBF 08tHR+RxtataLzMsz2Ls6TnU86cOx+dWld2ZMyxjxZUz9sR2pH6QmToim203LUw1jnHo avZjx6vNFrPMKMYaL0Tta28ilLdcUkXIQlkHatKYTGQ/PGpal+3VzpeZNSJTiaOXZHBH 4hJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="tQ/bknCA"; 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 z4si1218927oti.93.2019.12.19.02.54.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:17 -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=fail header.i=@linaro.org header.s=google header.b="tQ/bknCA"; 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]:38790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtRg-0005Uk-1E for patch@linaro.org; Thu, 19 Dec 2019 05:54:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNF-0006Xo-Di for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtND-0007x3-0K for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:41 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:56156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNC-0007pp-Mk for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:38 -0500 Received: by mail-wm1-x333.google.com with SMTP id q9so4939770wmj.5 for ; Thu, 19 Dec 2019 02:49:38 -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=d+Pda+ZdRPcyYkSjIEt1t/uTnpjt9VwcL/O1cE3PJHI=; b=tQ/bknCAq+PpnYB7kbXeP4NjPYiW/CwVoYYMVxVjktHTyxk0BNO3JulfdMxU3Z7FzN Ku1HRRzJgACzIJp2ZOF/3TJczpsDEtdepaYFhDOWW8OQBcA3NWC2QZdUQF6mLyAZrQp9 PtG3Ecu1/g/fjG+RdnZkkiFuTa4JyoAr6o+1YBnxZdTSx0DidcsEEfiAgtqGIyJHIvni FTV3BBrqkVieItxjsLW+2rEPA1APj3/LyYRNZuItNSV+VFJp4fhuoHYkRq08W3P1mW8J KTXov3IxcHV89oQ6NNkz73vFdbTvXnHSZ1s2FvvZ/xQnpoCKvepxaAtYqLTrsX8rkW1B EizQ== 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=d+Pda+ZdRPcyYkSjIEt1t/uTnpjt9VwcL/O1cE3PJHI=; b=hULz8Qf4jqx0xShhE4BKr/xC+0TLo7n5EHTkA7/74xIHs8nY6adlBQrpAkrHsRa1m3 PLKEJmT3tWXhxF89QtlBihW+at4BJeeqv8p0myL7+vUTRvN30vzu9/AnaOpRHCFKYyzS D5N3NWyA27j6bSyyU0Ph3uxWNRe5RReApwEzFL0NV4ykY0ZJ1wXLTGrnaabmvKxNyVQl Z0K3h+JKkW99+XRbcNb1uMsdAvoacT1M46En8H8+dK6HvLFNDiwKzjd4vSjE4qJ4p1Tz KbtP2qxGbMuUnJEypPxWw83vsXykN9Ds+3nTvjwLzAmLxjiofYhSwLwRNa/z1U3HaSOR 0ZdQ== X-Gm-Message-State: APjAAAV561rtH0s1QOjpZsLOxQifu/Jaos+OrPRb+ORYtX3htocG1AUn lYaOwC92aUHrPCeS8tMhNhvbVg== X-Received: by 2002:a7b:cd91:: with SMTP id y17mr8990781wmj.140.1576752576877; Thu, 19 Dec 2019 02:49:36 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f1sm5938897wru.6.2019.12.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7F9001FF8C; Thu, 19 Dec 2019 10:49:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/25] configure: allow disable of cross compilation containers Date: Thu, 19 Dec 2019 10:49:10 +0000 Message-Id: <20191219104934.866-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 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: Stefan Weil , Richard Henderson , qemu-devel@nongnu.org, =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Our docker infrastructure isn't quite as multiarch as we would wish so lets allow the user to disable it if they want. This will allow us to use still run check-tcg on non-x86 CI setups. Signed-off-by: Alex Bennée Reviewed-by: Stefan Weil Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Tested-by: Richard Henderson -- 2.20.1 diff --git a/configure b/configure index 84b413dbfcf..e0c66ee9b68 100755 --- a/configure +++ b/configure @@ -302,6 +302,7 @@ audio_win_int="" libs_qga="" debug_info="yes" stack_protector="" +use_containers="yes" if test -e "$source_path/.git" then @@ -1534,6 +1535,10 @@ for opt do ;; --disable-plugins) plugins="no" ;; + --enable-containers) use_containers="yes" + ;; + --disable-containers) use_containers="no" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1717,6 +1722,7 @@ Advanced options (experts only): track the maximum stack usage of stacks created by qemu_alloc_stack --enable-plugins enable plugins via shared library loading + --disable-containers don't use containers for cross-building Optional features, enabled with --enable-FEATURE and disabled with --disable-FEATURE, default is enabled if available: @@ -7992,7 +7998,7 @@ done (for i in $cross_cc_vars; do export $i done -export target_list source_path +export target_list source_path use_containers $source_path/tests/tcg/configure.sh) # temporary config to build submodules diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 6c4a471aeae..210e68396f2 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -36,8 +36,10 @@ TMPC="${TMPDIR1}/qemu-conf.c" TMPE="${TMPDIR1}/qemu-conf.exe" container="no" -if has "docker" || has "podman"; then - container=$($python $source_path/tests/docker/docker.py probe) +if test $use_containers = "yes"; then + if has "docker" || has "podman"; then + container=$($python $source_path/tests/docker/docker.py probe) + fi fi # cross compilers defaults, can be overridden with --cross-cc-ARCH From patchwork Thu Dec 19 10:49:11 2019 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: 182073 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp2095458och; Thu, 19 Dec 2019 02:50:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzbXkEVhLdukkb9wiMBRTPqAa532v2bdfeAcXd5Zq6I1XkWNVZIGfy6ZHzVifkc6kf2vcDf X-Received: by 2002:a9d:6a8f:: with SMTP id l15mr7950346otq.59.1576752606693; Thu, 19 Dec 2019 02:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752606; cv=none; d=google.com; s=arc-20160816; b=tsErgxqfo22EF9OF1yU6nNNYsaY37PI840IZr7wku1LKHl6rLpZSV2vr7vYJK59Txr t72P7VS2r6MjWAu0NqZUY9p/xoSqzbpd6DUhReOS4lfCGvqAm2UCJz/g8yGxhTsgO+Zp 66v6EqY5XZbBs7kby278cyZEO7dq4hVvC8yTNVqDZ/6NM0DAzemA+Gc96inSgk9rAk3e JoKNpZK6A0Aioh5pSHgxRwkBpTN8PPwV79WJbxPZO3kitECJhvVW9lFIYaU8YUCXQpRv mLVQOPYRyv+k57foZNSYP/lcWOqZ4RpgdpKnmhd0vZsJbzu2sDjr6cjWNbKA9cPpvmJv Hnjw== 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=710LliMJ7HC+nQ3MEl8A/s79QTfM7VktgrS1QINsiB4=; b=o8WeusF0IYKRNLUS1BxDFODWvBcGS/GaijZLi61b36cBKVHP1vNMzB1NJMucBC9uuM Wm54uL/4TjUTDhQN/UUVf62AbxPabb2N97bgBhiqBHkQ7eHtIA3K0+xgz+DrnPnvRJCZ YQKlmixG34BxJX6EumPewSFY+OjpI+JZ3yRMd6msXZy0jOzqgQKmiE1eIERak9BQBJc/ KcnBgumaSe9b0xaLnpHNVDVBQDHALW5S2+fP85iMY0TBHl0hT3LlU72qAj/ET6dOdvTN 50SuE5Fr/juSMbaEwOLaxhltXbNstQQSJRkYA71gHoNHbC3cEN+5hDabEiCBMUTCQOen o/gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wPSsy7ga; 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 w16si3007427oih.154.2019.12.19.02.50.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:50:06 -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=fail header.i=@linaro.org header.s=google header.b=wPSsy7ga; 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]:38602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNd-0006e7-Fe for patch@linaro.org; Thu, 19 Dec 2019 05:50:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38459) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNH-0006Y4-DD for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNF-0008CI-Pu for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:43 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:35739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNF-00086j-Eb for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:41 -0500 Received: by mail-wr1-x431.google.com with SMTP id g17so5492959wro.2 for ; Thu, 19 Dec 2019 02:49:41 -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=710LliMJ7HC+nQ3MEl8A/s79QTfM7VktgrS1QINsiB4=; b=wPSsy7gaeRL+3R5VQKzqXRB/nlmvwPzSAKe1N0PSeGa1Bc7XE2TflSt2kAPrz4RkOC fFZpcPYWKXV4GdWCFNFdJLshzO5aqN2KP/CdXqZbTjfad8ausTxKf+VFCQkcqvB43hj5 i+z5Nbq5ScOcPMBs+VT5XqZBd6kpodWp3C/h+Ducib46VXqKUHr8FZbuxzV+dGpYP5iK fW2dgcmwDBDT+eD4grxBnUzJSI1ESIt4dkEtvSx9IiH9TjJCdPjkXk+cuQdxfZY5lPK1 eDmXOWobTcOCxOq/+gr1onRGtgVBQPk0UzVU/i0o7KJSlLs8cYDGlx+qnzQC/K2alOkq v0Qw== 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=710LliMJ7HC+nQ3MEl8A/s79QTfM7VktgrS1QINsiB4=; b=rSyW5GOxHyNfTPOy7JgyP6GUvtFpIn54fEBIQVNJ/xSyMxWwH7op07MJeHFvWVfptD IuZk4Sk7QzdGqRMr7vM424o7FxATjoCdTM2cCMnDZZhppOjOBNhMuZ03/lE8Nmp30SuB zAiQv/V+GbfHmwKQDCErMkcmSsscLSCu7m0XIdtIqYnSkOHO0GtLkoTDuzX6UwdKHRGU yUHDkQNoxdX65TgHsnS3nz/+MyrP6AE52VPQAL/UAyppxh9vjWYonIPdWixrue4KgeK2 08ZfKXMmwlQC+8C0Q1KMMcl66bsG9RL9Ee0IppqXBXTQxB3xTNb6fUm2KUxSyZ3VjO8i SwzQ== X-Gm-Message-State: APjAAAVgAzjVI2U5OSY2ZWUuyozRSXqu2PeB6RnCFiPiK4AKw8eCwnVU dWxcWW0wdedSnY5KxkI9qeKmHg== X-Received: by 2002:adf:eb46:: with SMTP id u6mr8877397wrn.239.1576752580326; Thu, 19 Dec 2019 02:49:40 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p5sm5891469wrt.79.2019.12.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A18C71FF8F; Thu, 19 Dec 2019 10:49:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 02/25] tests/vm: Allow to set qemu-img path Date: Thu, 19 Dec 2019 10:49:11 +0000 Message-Id: <20191219104934.866-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 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: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Wainer dos Santos Moschetta By default VM build test use qemu-img from system's PATH to create the image disk. Due the lack of qemu-img on the system or the desire to simply use a version built with QEMU, it would be nice to allow one to set its path. So this patch makes that possible by reading the path to qemu-img from QEMU_IMG if set, otherwise it fallback to default behavior. Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20191114134246.12073-2-wainersm@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 27f286858ad..ab5be0c7299 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -418,13 +418,15 @@ access, so they SHOULD NOT be exposed to external interfaces if you are concerned about attackers taking control of the guest and potentially exploiting a QEMU security bug to compromise the host. -QEMU binary ------------ +QEMU binaries +------------- By default, qemu-system-x86_64 is searched in $PATH to run the guest. If there isn't one, or if it is older than 2.10, the test won't work. In this case, provide the QEMU binary in env var: ``QEMU=/path/to/qemu-2.10+``. +Likewise the path to qemu-img can be set in QEMU_IMG environment variable. + Make jobs --------- diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index fea348e845c..9e7c46a4735 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -34,6 +34,7 @@ vm-help vm-test: @echo " DEBUG=1 - Enable verbose output on host and interactive debugging" @echo " V=1 - Enable verbose ouput on host and guest commands" @echo " QEMU=/path/to/qemu - Change path to QEMU binary" + @echo " QEMU_IMG=/path/to/qemu-img - Change path to qemu-img tool" vm-build-all: $(addprefix vm-build-, $(IMAGES)) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 53b9515ee22..ed5dd4f3d0e 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -152,6 +152,11 @@ class BaseVM(object): def build_image(self, img): raise NotImplementedError + def exec_qemu_img(self, *args): + cmd = [os.environ.get("QEMU_IMG", "qemu-img")] + cmd.extend(list(args)) + subprocess.check_call(cmd) + def add_source_dir(self, src_dir): name = "data-" + hashlib.sha1(src_dir.encode("utf-8")).hexdigest()[:5] tarfile = os.path.join(self._tmpdir, name + ".tar") diff --git a/tests/vm/centos b/tests/vm/centos index b9e851f2d33..f2f0befd845 100755 --- a/tests/vm/centos +++ b/tests/vm/centos @@ -68,7 +68,7 @@ class CentosVM(basevm.BaseVM): sys.stderr.write("Extracting the image...\n") subprocess.check_call(["ln", "-f", cimg, img_tmp + ".xz"]) subprocess.check_call(["xz", "--keep", "-dvf", img_tmp + ".xz"]) - subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) + self.exec_qemu_img("resize", img_tmp, "50G") self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()]) self.wait_ssh() self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") diff --git a/tests/vm/fedora b/tests/vm/fedora index 7fec1479fb7..8e270fc0f03 100755 --- a/tests/vm/fedora +++ b/tests/vm/fedora @@ -74,9 +74,7 @@ class FedoraVM(basevm.BaseVM): self.print_step("Preparing iso and disk image") subprocess.check_call(["cp", "-f", cimg, iso]) - subprocess.check_call(["qemu-img", "create", "-f", "qcow2", - img_tmp, self.size]) - + self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size) self.print_step("Booting installer") self.boot(img_tmp, extra_args = [ "-bios", "pc-bios/bios-256k.bin", diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 2a19461a909..1825cc58218 100755 --- a/tests/vm/freebsd +++ b/tests/vm/freebsd @@ -82,8 +82,7 @@ class FreeBSDVM(basevm.BaseVM): self.print_step("Preparing iso and disk image") subprocess.check_call(["cp", "-f", cimg, iso_xz]) subprocess.check_call(["xz", "-dvf", iso_xz]) - subprocess.check_call(["qemu-img", "create", "-f", "qcow2", - img_tmp, self.size]) + self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size) self.print_step("Booting installer") self.boot(img_tmp, extra_args = [ diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 611e6cc5b5c..ec6f3563b25 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -77,8 +77,7 @@ class NetBSDVM(basevm.BaseVM): self.print_step("Preparing iso and disk image") subprocess.check_call(["ln", "-f", cimg, iso]) - subprocess.check_call(["qemu-img", "create", "-f", "qcow2", - img_tmp, self.size]) + self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size) self.print_step("Booting installer") self.boot(img_tmp, extra_args = [ diff --git a/tests/vm/openbsd b/tests/vm/openbsd index b92c39f89a6..6df5162dbf4 100755 --- a/tests/vm/openbsd +++ b/tests/vm/openbsd @@ -73,8 +73,7 @@ class OpenBSDVM(basevm.BaseVM): self.print_step("Preparing iso and disk image") subprocess.check_call(["cp", "-f", cimg, iso]) - subprocess.check_call(["qemu-img", "create", "-f", "qcow2", - img_tmp, self.size]) + self.exec_qemu_img("create", "-f", "qcow2", img_tmp, self.size) self.print_step("Booting installer") self.boot(img_tmp, extra_args = [ diff --git a/tests/vm/ubuntu.i386 b/tests/vm/ubuntu.i386 index f611bebdc9d..3834cd7a8df 100755 --- a/tests/vm/ubuntu.i386 +++ b/tests/vm/ubuntu.i386 @@ -70,7 +70,7 @@ class UbuntuX86VM(basevm.BaseVM): sha256sum="28969840626d1ea80bb249c08eef1a4533e8904aa51a327b40f37ac4b4ff04ef") img_tmp = img + ".tmp" subprocess.check_call(["cp", "-f", cimg, img_tmp]) - subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) + self.exec_qemu_img("resize", img_tmp, "50G") self.boot(img_tmp, extra_args = ["-cdrom", self._gen_cloud_init_iso()]) self.wait_ssh() self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") From patchwork Thu Dec 19 10:49:12 2019 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: 182072 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp2095375och; Thu, 19 Dec 2019 02:50:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz+CQ3dM77jlUiOhT9iCGkp50zYch4wRuRpcvfsb/lizV210uv1E4oQRZOM2O9VmEkEoYJJ X-Received: by 2002:a05:6830:10c6:: with SMTP id z6mr8450962oto.203.1576752600004; Thu, 19 Dec 2019 02:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752599; cv=none; d=google.com; s=arc-20160816; b=oucxiOjLZHBmhl4rGTvBHC/cFFojN5F+hxQfLkVt1m5SBQwp/Q8IHGp1PLV1jJJ5uE ybJyyZIhJd/P+9Ne6FcG7mdeUf4Ej0RrWMKlbLPx3/9sjAjg0NbqElegoAlN7CFl5km2 CYiQKDPQ5oeIZW8ctjxxFDaBCH10Yc1xpHlYdRe5eQ8UybE+VupKeLNA4sS9ipBLgjry soIyKatE7vZKaNRbuft1zz8HHG+Leh7IEYISXOC/dnvivC1BsPq1hJfCvbRDLEsoGEDA oqPzj5wxGzUADFeRXueprEEqBzO0gkR3i8RPWekQmTiFcF4zjY4uGQ31PnyBu3kIEr/8 3vVQ== 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=bnYqPNG6o//7k1MDVkGUWOrGmJeXC2A4NyL/DVQdWXI=; b=a605fhj1K+FwL/2SOk5Mc8GLTkQAw71TOgoVwyMuaQQnRIGPjy8NhzfwizdbIWqgvz GiXJpVWIIr6eZH9TwUhA93LzE64LRF01zZ44IcxG+YcWVHPgaYRiLxxM1d2H4xu2xI46 3EbpgqK752/DC+2AYQbvAFs8zqLg95vZxo+eMmzd66V//HCxPJ+hOnnHrNbXSBB/PoUJ UpZ9TPvcv27C66sK0m5zfkxT9Dp9qK/OT4/4KSbCrD4r7jCIeRkniYt2ak/lTNupD4Q6 cuu4e5VthP9/JolRiMg2epqLVXw1hUkHn12PRdvjIhJhXo2YR4L8aZGFpmbh99P5Np+/ G3Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="IfmD/gpF"; 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 s65si2870638otb.260.2019.12.19.02.49.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:49:59 -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=fail header.i=@linaro.org header.s=google header.b="IfmD/gpF"; 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]:38570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNW-0006Y3-On for patch@linaro.org; Thu, 19 Dec 2019 05:49:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38138) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNF-0006Xp-De for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNE-000841-D0 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:41 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:36697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNE-000804-4X for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:40 -0500 Received: by mail-wm1-x32d.google.com with SMTP id p17so5123588wma.1 for ; Thu, 19 Dec 2019 02:49:40 -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=bnYqPNG6o//7k1MDVkGUWOrGmJeXC2A4NyL/DVQdWXI=; b=IfmD/gpFylQLhGXqK+nVtQ09olHVMurWI7zlbaJ0LaPxbdJMnqZ+Lipa45kncwQ2kN F32f6KuWKQe+609O638kEAMVru4qwhWMuvEND5rYZeiDLAzNqkS9D74oIiVDISliWdDb o9usOx0JKodRdrRn9JOvEFd9v8M5I3DEPxCSUb1eyJN+S6nQRZgL+wSgJBOriWuRMpB9 1DSXtt9nKBd2kXifSnSYWmN+vInv4a9W8HuddSokaUSqfwZDx6sTOfYiewt1RyhuQpu4 CvqJOSDyO7yqP2iyJOsXhjctOLADvpESL57ix/zqhGrrbsHmxhYRoGlmn+uoxbfwPlvL zLcA== 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=bnYqPNG6o//7k1MDVkGUWOrGmJeXC2A4NyL/DVQdWXI=; b=sonavFSi9CsCFDSzFF2rI9OcLj4p6aTNUpsEyduHlBdz5cJN+wo1Jhvb8+lHb2PW92 6INlSONdei6w4MmFnz/pAsjbTJQSNDrwRePncr8ioHxm0Aa+66u7FAzZE7Lvz2TiCQ+V 8TDj+hieYoo+XrFKf4RPlGvrCMq5tsItOUVjyp16pcLz9KO245J1oIGZho65QSJqClZ6 YcTHb7V3jzTWL52o8tpV4eBYCz/LIXNY2EzO1O2xI6Hi9PfYAKkh1cbrBR2zsk1K3tET jB5XPQ9cZZOCjo7sQ6y7l4ADU0n4jd+rtaF/c8AnRJnFNti9RStMAt4EjzM9IowiJZfj Hr1g== X-Gm-Message-State: APjAAAW5dhHQdS2sT2DK9/7rVdemm0KkOQmSQJLDJFhcZ2GsRIxP2Zof L+rz6ZY2vY6DbBvghlAwmqvcvw== X-Received: by 2002:a1c:b456:: with SMTP id d83mr9017363wmf.172.1576752579049; Thu, 19 Dec 2019 02:49:39 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q19sm5631354wmc.12.2019.12.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B6CE71FF90; Thu, 19 Dec 2019 10:49:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 03/25] travis.yml: Run tcg tests with tci Date: Thu, 19 Dec 2019 10:49:12 +0000 Message-Id: <20191219104934.866-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d 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: Fam Zheng , Thomas Huth , Stefan Weil , Richard Henderson , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth So far we only have compile coverage for tci. But since commit 2f160e0f9797c7522bfd0d09218d0c9340a5137c ("tci: Add implementation for INDEX_op_ld16u_i64") has been included now, we can also run the "tcg" and "qtest" tests with tci, so let's enable them in Travis now. Since we don't gain much additional test coverage by compiling all targets, and TCI is broken e.g. with the Sparc targets, we also limit the target list to a reasonable subset now (which should still get us test coverage by tests/boot-serial-test for example). Tested-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth Message-Id: <20191204083133.6198-1-thuth@redhat.com> [AJB: just --enable-debug-tcg] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 6cb8af6fa59..15946293ff3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,10 +214,11 @@ matrix: - TEST_CMD="" - # We manually include builds which we disable "make check" for + # Check the TCG interpreter (TCI) - env: - - CONFIG="--enable-debug --enable-tcg-interpreter" - - TEST_CMD="" + - CONFIG="--enable-debug-tcg --enable-tcg-interpreter --disable-kvm --disable-containers + --target-list=alpha-softmmu,arm-softmmu,hppa-softmmu,m68k-softmmu,microblaze-softmmu,moxie-softmmu,ppc-softmmu,s390x-softmmu,x86_64-softmmu" + - TEST_CMD="make check-qtest check-tcg V=1" # We don't need to exercise every backend with every front-end From patchwork Thu Dec 19 10:49:13 2019 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: 182081 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp312997iln; Thu, 19 Dec 2019 02:54:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzrNAbnwfY173xCBacqRuQdKBlG9b/isIJ/JwnXRO4X0UgDm1HJzpIvpMt4KR7ai7s9Ywti X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr7648932otc.24.1576752861073; Thu, 19 Dec 2019 02:54:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752861; cv=none; d=google.com; s=arc-20160816; b=LeI2dhbxKZG1SUg1/9ZuJoOIrWOv4sFdycQhCoel0im1QP6bkspL2m5ogHhrmolwt7 6hefUeHHmE9ntAXGu8o92D/933w1jX9acRIPFW09Hprxs1HgMCKn9rbYMvcO+5SPFR+J ddPyE7Z2XO3dtk7ZVgTR1zAai2IjAYzsPBZxC25Tcmu00ZG0kznXkiH2DK3frsnSPuYV aoHlv9g2JRVjCnlhM19h8SjmTd+8g1yBkxNU8smY1ixpI1rfsPkeyxUQTJZBIFKYyvFu KsIKO44nIOlKIo53gw5yDmP9dnaqFR5k4dgcPX33pP/FVuFo1xZH7GHFLZElVccIn0UT iQ9A== 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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=j78VBSWZWqx0l2KyIwBoPd/xnZTOHL8E2GP1Lc2+0+kZAm1aYbG27LvsImmSA4/anA PBWjdy3eKmVZ3G6MnqKDm89B9RdduTRFpdelxOt8qsY0wfbmHPR5/chhV9Mj9KHR7h6T Qfe307LXTCP1FksZlPvOj9zuzAOm62Ts1SQn1hI2XBVQDv/wtruE66pZenGYCys+ivhY X4YAPlhQ6cvy5XXTQvJeEVO+R5o669VsZYPTGsiMXvRJ94vv4ZiD9vxXDhfCWzqwFrXm KBoBTBscM3TAw/q2XIedBBnr/Ch/xKWveC4k5u5GlTN66nalrWHzWzppFd3rMePKxZ9B njhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Na0l5nj4; 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 p22si3174781ota.43.2019.12.19.02.54.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:21 -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=fail header.i=@linaro.org header.s=google header.b=Na0l5nj4; 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]:38794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtRj-0005ak-TQ for patch@linaro.org; Thu, 19 Dec 2019 05:54:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38584) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNI-0006Z0-3b for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNG-0008I2-NY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:43 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNG-0008Bu-DL for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:42 -0500 Received: by mail-wr1-x432.google.com with SMTP id q6so5457391wro.9 for ; Thu, 19 Dec 2019 02:49:42 -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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=Na0l5nj4hsrrKx0LC54oQSHzoqJeVqjZ9Zcw1rqB0PImGZkYVpu+lQ6X26MPPqI7B4 ZyMJFZKIRmcWCylm2x4ifIZMpqzkyD+WXYgJHECowd5fEaAHwbcbyusHPnrZU99dWWy7 oSTkQeKeSrV+k23+0+mlhO1neGnEkair68rl+0GaSN/vJqA5WUkr5eA/pCx6Eln9g/k2 /8iJS5mMLA8DGi79vjGLeHnQQFHdbMOI1N4pCdMYoQ5XhnIoF6nHXZHqvPv7yeWTctd9 1gG4aWZ8q6ua6L8nPD862NrFs9thsnmJLscspyRCCXQoGNts3/uaQK8LMje87cLuYsDm 2f3g== 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=aKHmlXVnEdxblPaY0W1a7lGdL9lrMsXlAG76mAyvLB0=; b=g+gCpogFeIVgtOMAvvoXIKe3S/nDLA8D7rGmtqJYNHwnMKf7hrgB6YVxhsKsLMJWk+ aDcCCwv8SBuDkWJKvksVkJopHGfuT/KTX8F4yn/M76rCY49+LyiO7SCF4SZdjhC4B1J7 bGpqidPuA1JC+oDu9arZJavgvamsCU+zBVurr6wL2SyOcJqYbT0rZmMXjw+pxkpw1a58 oenTRnMPlMwhSb5EcYsl+DM2bm44O7886MADidKp+7PNS0MXiigzDLRf6VCIUN7/RsSy SVfQdigNkhWHPH2v3c2kxPX/dsmx3ueKsQe1MdOsCpoZAXsluk4wdjJTN82o/ewdiHU1 NvNA== X-Gm-Message-State: APjAAAWxTf0pCsDNzzVA9GPR74Rjm3vkDGLiiZFJurUgpmeVDSUrjZ13 CUZIvGASTV+hIfA+oa7yXBiRrQ== X-Received: by 2002:adf:ef8b:: with SMTP id d11mr8330316wro.45.1576752581233; Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c195sm6275377wmd.45.2019.12.19.02.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CF9CD1FF91; Thu, 19 Dec 2019 10:49:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/25] iotests: Provide a function for checking the creation of huge files Date: Thu, 19 Dec 2019 10:49:13 +0000 Message-Id: <20191219104934.866-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Max Reitz , Cleber Rosa , =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Some tests create huge (but sparse) files, and to be able to run those tests in certain limited environments (like CI containers), we have to check for the possibility to create such files first. Thus let's introduce a common function to check for large files, and replace the already existing checks in the iotests 005 and 220 with this function. Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191204154618.23560-2-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005 index 58442762fe3..b6d03ac37de 100755 --- a/tests/qemu-iotests/005 +++ b/tests/qemu-iotests/005 @@ -59,10 +59,7 @@ fi # Sanity check: For raw, we require a file system that permits the creation # of a HUGE (but very sparse) file. Check we can create it before continuing. if [ "$IMGFMT" = "raw" ]; then - if ! truncate --size=5T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" - fi - rm "$TEST_IMG" + _require_large_file 5T fi echo diff --git a/tests/qemu-iotests/220 b/tests/qemu-iotests/220 index 2d62c5dcac2..15159270d33 100755 --- a/tests/qemu-iotests/220 +++ b/tests/qemu-iotests/220 @@ -42,10 +42,8 @@ echo "== Creating huge file ==" # Sanity check: We require a file system that permits the creation # of a HUGE (but very sparse) file. tmpfs works, ext4 does not. -if ! truncate --size=513T "$TEST_IMG"; then - _notrun "file system on $TEST_DIR does not support large enough files" -fi -rm "$TEST_IMG" +_require_large_file 513T + IMGOPTS='cluster_size=2M,refcount_bits=1' _make_test_img 513T echo "== Populating refcounts ==" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 0cc8acc9edd..6f0582c79af 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -643,5 +643,15 @@ _require_drivers() done } +# Check that we have a file system that allows huge (but very sparse) files +# +_require_large_file() +{ + if ! truncate --size="$1" "$TEST_IMG"; then + _notrun "file system on $TEST_DIR does not support large enough files" + fi + rm "$TEST_IMG" +} + # make sure this script returns success true From patchwork Thu Dec 19 10:49:14 2019 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: 182082 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp313033iln; Thu, 19 Dec 2019 02:54:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz3BMF09ftmJYaQqTcz2TEBnoevVVBE8gBomkwLW+Lqp3gLn4msT6ipXp11TkxQvlkyfbpC X-Received: by 2002:a37:3ce:: with SMTP id 197mr7590542qkd.454.1576752862876; Thu, 19 Dec 2019 02:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752862; cv=none; d=google.com; s=arc-20160816; b=MIu3FBNn+BZeLAp/ksRTUR1LG4U87fuF1qXDZc/c0cVdzOH5QL1UBc1UY5a4Oh102b AkEwMeVNxPtlwhK9gs400qEwYlIJGtuZFeNadhDc2D8UV+tg1RSfzcDY+gnF4LgfRS0G b+zeFFFzAKw9UYrlqzkyzw/sPfG0VJrw+CSEM7bgIJAygIjFu8YWWskKumFFcST3DrZs O0qcyghHaZ5qtCsX91cZcKuGrqyI0IAbL43wBQW/ADxycMnzXEoQjM+W5kHIux2Ijpvt 8Zxt0YW6vthZqobIQ/PzCC5cbRbPBviqRePC+6HAd78NHHGpdZpQN+mb2j8vwLjB/V8/ bzfg== 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=903ieA21LmcrJVAsLL1LFphWZ9y7liPxJNyTsqIDuUs=; b=oPrveKE8CAUA28fb1CQMlX2EvAaPrZ/SxkNdU+kcq0X6TblaD9C0C75BXcfZghBRjw 2S8bNifJ9W1B/aqpqRTptg0bpeBORGTqsKIHP8WyJw/5Je8cINJfRAyY8tlZPZBp7fsV lq65dY6b7IW55BSgoLatEBxxxbipCIuCV1f+4T945d5TCCHXwIoj5soFjORS8V+4Ay1b 0ziR9sJTRQgd9bIwnBv8B9tPy0eyhU5NLFPxoahl5qNLf10evPy0FE1zhms7i253osbh TU1E4Zpp/n0xMBacOTZaT7ndq2Vt/UI+l8nWTbFDg9JbpNfNuR3uq1R/87Sh6xGMPrO5 duuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yk3jf9+4; 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 cj13si2925685qvb.47.2019.12.19.02.54.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:22 -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=fail header.i=@linaro.org header.s=google header.b=yk3jf9+4; 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]:38802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtRl-0005e8-TR for patch@linaro.org; Thu, 19 Dec 2019 05:54:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38824) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNJ-0006dR-PH for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNI-0008S8-Mo for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:45 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:33720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNI-0008NM-E3 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:44 -0500 Received: by mail-wr1-x42d.google.com with SMTP id b6so5516305wrq.0 for ; Thu, 19 Dec 2019 02:49:44 -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=903ieA21LmcrJVAsLL1LFphWZ9y7liPxJNyTsqIDuUs=; b=yk3jf9+4el4JsIh3kBJo7wFoxtSkjc9VVNRqehA+FL/FAsNad/qRHPe4W8n6R6IYDt utdt2eFfNnpEPBSI7lY5MBRS8osAnlNZ+XsYMMRes6SYP0qEhtN2FHXZZMzqRlQCYX5P bJU8oyvHz33djfkHE/UoYwRVumaDE3L3+brcCyG7GOpeFRWoF4apCEVuJsm3C4omRtdz m/rxoWcqwT6sGYOeCYT+RBeqifKJ7deaAGDbiuY0Ak9X0dFDzCT2xGYq/UvNbKPvmvYj 9BfBDZyk57KUQz41W0HBqqPRBhHLicna4ZINLcDq3sbT3CuIAA6x+c0P7jg/mvns2Y41 49EA== 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=903ieA21LmcrJVAsLL1LFphWZ9y7liPxJNyTsqIDuUs=; b=M64Xl3DAP92T8yOqtNxItvELdlKVylCo7iy/j5LSKdpUSv/ubA/odCuxDtJda+3DGo 8eezm9UFskxLSpcioGsUYB3FNikWBxeuOEr3L20LNK7MC6aKJwlR5m0xoSmc4AiPdk8f d7qYQgw3po4aj92HogYO48bzCR1V0LZ73qOfaaKGXfzl0Tn/VB6qnRvSNPKCn4ajH19K cqaYjDor7iukj6vwQz6AcPOfvNo2vp49FOvQVjQk/pCW8UjNLUhadwqq3WZ3dv5W6Ock sc4ju3dAvXFczeUoxxqKpsQ/d/9jE9pN0utW13brJlTGiehKK0HXvuuij1MK4kSEZlWy NFcQ== X-Gm-Message-State: APjAAAW2YInTPD3nMtCZsLsra/aN8XyxEQ0E2gEKoth6zR2QU5x5yLmT +BEdkMNTf8gtdwSTd276P8K+OA== X-Received: by 2002:adf:f3d0:: with SMTP id g16mr9043454wrp.2.1576752583259; Thu, 19 Dec 2019 02:49:43 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x14sm5620446wmj.42.2019.12.19.02.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E3F251FF92; Thu, 19 Dec 2019 10:49:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 05/25] iotests: Skip test 060 if it is not possible to create large files Date: Thu, 19 Dec 2019 10:49:14 +0000 Message-Id: <20191219104934.866-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Max Reitz , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Test 060 fails in the arm64, s390x and ppc64le LXD containers on Travis (which we will hopefully enable in our CI soon). These containers apparently do not allow large files to be created. The repair process in test 060 creates a file of 64 GiB, so test first whether such large files are possible and skip the test if that's not the case. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191204154618.23560-3-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index b91d8321bb8..d96f17a4846 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -49,6 +49,9 @@ _supported_fmt qcow2 _supported_proto file _supported_os Linux +# The repair process will create a large file - so check for availability first +_require_large_file 64G + rt_offset=65536 # 0x10000 (XXX: just an assumption) rb_offset=131072 # 0x20000 (XXX: just an assumption) l1_offset=196608 # 0x30000 (XXX: just an assumption) From patchwork Thu Dec 19 10:49:15 2019 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: 182084 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp313267iln; Thu, 19 Dec 2019 02:54:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyVCXM6F6xN1sJORgWiK8MNPwvzQ7dtjv6MQ3D5w7xHP5txiLc71TjhN6f+3IGyUmaw3w67 X-Received: by 2002:ad4:56a7:: with SMTP id bd7mr7049056qvb.238.1576752880924; Thu, 19 Dec 2019 02:54:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752880; cv=none; d=google.com; s=arc-20160816; b=O7RHDU5YiqTFmVn+5HPe/Cq3RgdLtwGXUhYUyVKiI89deY++6wnyGBmayd3qv6647R IClG/3nc1MoCpBh0I7sz3a+8H6iA1llvWkx5lZ8MpwUhtd3HeX82kLfa74GebMFqPRZN Xz65/cBlKg60tPW4PzcXXsrm4pqgcDCqBS27nrnF/RcRLuE3hLMIVlE8uKkYyH2QDkgP zIZklmP8xVVq56f6D1RApRQWPR+fu5uOnO0dy7JljkMptRSgXPXiSyj7+X7rXkzHszw9 TTa55lYEpjblj9Qg+OTa9MixQVpGykTiZTSo6N8Xsv1eA0UV/gTnouJOiblvrjSTM4mJ uU/Q== 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=ppf+32iUYT5wLQ7K4SiHbEd1II5Q2/neiLzdRWS+Cpo=; b=O7M5iMyR+iooXC6B/XAuUvPXdscf1sKDfy2lA5BepfKcjWhPJMQUuzyc/Sap61D//y VghqRJcNaQsOb4oUQvo/W4eS5vRepG4VRMU3ui8WhXt855MWWMJ9Zq3ZQZpZEe5jrY/c HjolBlF8AfbL0ywbzsRddrKQP0VtATvR557QkUlyP3G+FrTPO++7yvk4dj/nUZEC1pAU uauIs8Jo/dOVV3ofWh6dzZUYi/74LRzDjSJI/kRrGnsC3jIRRqksWl8839ntGyu7gkfr RVgZnpo7WRDyvKD/+kZTerwyYcDfxOLysQNAg3DrQ2eippmPTWmO64emA+9Tfj0FjLfd pQjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oMZwvs0q; 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 x21si2978416qtq.402.2019.12.19.02.54.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:40 -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=fail header.i=@linaro.org header.s=google header.b=oMZwvs0q; 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]:38810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtS4-0005lx-9A for patch@linaro.org; Thu, 19 Dec 2019 05:54:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38990) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNK-0006f7-Vw for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNJ-00007B-PI for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:46 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNJ-0008SO-DV for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:45 -0500 Received: by mail-wr1-x433.google.com with SMTP id c9so5472611wrw.8 for ; Thu, 19 Dec 2019 02:49:45 -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=ppf+32iUYT5wLQ7K4SiHbEd1II5Q2/neiLzdRWS+Cpo=; b=oMZwvs0qYvo5sD2b7x6Sum0AjDageW28Uht7zW+iAotGfwDakn83a8S3zxw3Lzbias WPgK4MRu354i8nUM7T3+0fuyD8lG9ILafGSd9gGZNi3Z0kRUWWoiup+V68AYjC/OvXEe Fb6HgwZMDiw6MNnXyWIvAcm14nvdMlx4KuOFlerja17IIP4zNjmCq9aiW7pOhQTohwqV kmCglnVL10fJR8E5L64LUnu0652EFE3+aXik1PFNvc+RihX4jE4G5qABbJG7eRz4IUfo LnU3RCGzXJl6/YraUuvGb1I8klXP8YLXqVstolOmrO8jqDmeEaz/t9XiMPTFy/sBqWme Awng== 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=ppf+32iUYT5wLQ7K4SiHbEd1II5Q2/neiLzdRWS+Cpo=; b=b5qDtYBAYR74NJXSJgyQ49LPx3G4aXYUXb4kikW0i7A2+tQITiVePO7hT6Cqo3Md8C UFVzunDHEGEIATPnEDj3K5vr48m/LdXjYoWA3vaf+ff5ioLhB5HY/vN+EjObI6pJYhcV pd+MMZr3Q8d2SI1oA3mk3WMpdUQq2RW2TQ02E3b66PHEFndcYsDbHg4xvQvgPRcUnz4o ViSaddokBm/dFWmU0hzDrE8wRgL5X8tZvPMzXzufYcVXAi7IBoMVKo20IZgJHUBSPYij HIhbrWsMuG0bOG8ki0qZ+Mdcrqcu/V/1rYo5161a853VKKepo4vC+iplS6A/B12s511F GbMA== X-Gm-Message-State: APjAAAXREkyQlvzM8Z+VIklkDAbkVvKJQt7OPH4+b/gSkay1/+KNOEzK +5tNWYuBArr3ubQVPKowuYa3Xg== X-Received: by 2002:a5d:4fd0:: with SMTP id h16mr8292145wrw.255.1576752584321; Thu, 19 Dec 2019 02:49:44 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a1sm5676904wmj.40.2019.12.19.02.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 03BEF1FF93; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 06/25] iotests: Skip test 079 if it is not possible to create large files Date: Thu, 19 Dec 2019 10:49:15 +0000 Message-Id: <20191219104934.866-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 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: Kevin Wolf , Thomas Huth , "open list:Block layer core" , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Max Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Test 079 fails in the arm64, s390x and ppc64le LXD containers on Travis (which we will hopefully enable in our CI soon). These containers apparently do not allow large files to be created. Test 079 tries to create a 4G sparse file, which is apparently already too big for these containers, so check first whether we can really create such files before executing the test. Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191204154618.23560-4-thuth@redhat.com> -- 2.20.1 diff --git a/tests/qemu-iotests/079 b/tests/qemu-iotests/079 index 81f0c21f530..78536d3bbfa 100755 --- a/tests/qemu-iotests/079 +++ b/tests/qemu-iotests/079 @@ -39,6 +39,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file nfs +# Some containers (e.g. non-x86 on Travis) do not allow large files +_require_large_file 4G + echo "=== Check option preallocation and cluster_size ===" echo cluster_sizes="16384 32768 65536 131072 262144 524288 1048576 2097152 4194304" From patchwork Thu Dec 19 10:49:16 2019 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: 182083 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp313206iln; Thu, 19 Dec 2019 02:54:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzmXx8BQrVy8IAF6iNZ9mhlvVmKsthVXRlA2V9ck9tU6u3UbgRwSb+1CmwIimND4zXQGlLq X-Received: by 2002:a05:620a:134d:: with SMTP id c13mr7183135qkl.322.1576752877039; Thu, 19 Dec 2019 02:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752877; cv=none; d=google.com; s=arc-20160816; b=CVp3szDgABnodV/+ioatx7r0f1oUFrHueUTINe1jHwhPqTO9YQTi22PLkN7hfb717W dOqKRA5YT4NeE1GhmgEtiKj2Hwq5bT3otWZWVpmZPdbwLwwdJm8SK5i9LCO0NfM0Oo8A D0binsnzo4uLszLUrzN6/TVmmT/ZUVwaP9JlNEoOvS5autfFOe598tBMcorwjOPWxn32 nrufOC0cXnbORcOY+LWpw2Z3W1yarWDgfNbcLNKUvGT9hPniS04KIAxQSc/YJflGnRM4 O76lGlfC9EcjPcEIsbyDRLmq3P/eGDdhn+THNmLjxAqGHX0TCtqjnMfQ0WN3yG5tLV40 EBpA== 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=O/LDCXsheLvMycNdYAZzehR+/HRrv8aczpwXJp22nJc=; b=gfQZg6/P2RSszi9HPlZ0QdKZSF+m9bS2Hl39KIqJyuGgP7XHr3mVYISkKKhBVDkIFI aD71pdJ8jeFFLddsZ/2lXjt4/jN8fGSXzdONZLBJkbWnT1eA4notwFAJCIr2CNUAnVsS +tGOFOl4WlkqQWE4jY9cbJ1Cg0ibgScd6b49F3Lmyz9uboYpJbRVpAgdwXvNXdVG8t3d vPCWwsD1jIe73CT+2m/IjA8U6q6eu5gZyglreX/WbgmiAV2VJ5M2jmsUM8cpP6qOJdE9 v8iCwliNs+NzwKmd5xmRvNfY/ZldJ8lq90M8+vyslzxTdmlGip/OlhylJXiY71VYkfRs JEIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eZmFWH30; 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 h26si2875384qtp.393.2019.12.19.02.54.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:37 -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=fail header.i=@linaro.org header.s=google header.b=eZmFWH30; 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]:38798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtS0-0005c8-0K for patch@linaro.org; Thu, 19 Dec 2019 05:54:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39543) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNO-0006kt-8Q for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNN-0000QR-0p for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:50 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:35830) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNM-0000Ca-Ms for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:48 -0500 Received: by mail-wm1-x330.google.com with SMTP id p17so5127426wmb.0 for ; Thu, 19 Dec 2019 02:49:48 -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=O/LDCXsheLvMycNdYAZzehR+/HRrv8aczpwXJp22nJc=; b=eZmFWH30IrBfN1MziG/qW+3RWVe/g4NkTMXUkb1xBkeBUAsVgVtaLQEqrrVG8h/PRr rm2YilrGBrpZyXdJTihaipMzia76CJq9TNHxjE3KCI84vTseTO9b3tkuLKRlXGpIR99q h2D+RCFDQlak7QTY8nGqQr34sbEtl3+vzsz7SPC0Mwgy81n5j1x+HU/d8O7xlMlk2VOF jbE11X4kWWLZgvKY28x3OCnbU0gtm3OH9MCVG5Zu7Q/WSzU0V8ATfm10qD4HRomf8KOW NZjcfYn9I7e6WB80wR6RtRsc149SFkHREVrjdSvtpb1i/0d0YACRWMwgpuexzKzKCCy8 pEig== 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=O/LDCXsheLvMycNdYAZzehR+/HRrv8aczpwXJp22nJc=; b=MFL5t2Wex4HOLaRxlCl7zoeD478zISbnII6tgLbuwWwQ3iLdP0GOKo37rL+Hc4IhRH UvJA0f5NReo3QJN+PE4XtMNnAR+Ym1nt86IU4DAAXCU0bd8chWDR13buqUo/P4TkZZmy DqEDE7iLfpT1VQASPewXyrpxFpaAEzt9EQoBDMHfxOkhWinSgJU5mNcc/9ke70AJUjgu 2q9Xx55XnDf4R5bz6xAs7dCbulfMRgVlqSR253Kw3v+HCLl8TA7rWnY9EAQGIyXbX1NZ JACPlGs9E79poGbm5mmdJJ29FrlRCYoQ9YQjDBqS0ojeb0o9ukhpCy2QK3UmtJd+WADr qP5A== X-Gm-Message-State: APjAAAUJr5/3SgHa/LvLacrA4JSFlQrj6vTgJE/+k8Cnc5guiZQw4iw9 qkeRyA9In6BpD3ZVCM0k7AA0G3eXse0= X-Received: by 2002:a1c:41c4:: with SMTP id o187mr9248520wma.24.1576752586289; Thu, 19 Dec 2019 02:49:46 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e6sm5932997wru.44.2019.12.19.02.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 179341FF96; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 07/25] tests/hd-geo-test: Skip test when images can not be created Date: Thu, 19 Dec 2019 10:49:16 +0000 Message-Id: <20191219104934.866-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 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: Laurent Vivier , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth In certain environments like restricted containers, we can not create huge test images. To be able to use "make check" in such container environments, too, let's skip the hd-geo-test instead of failing when the test images could not be created. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <20191204154618.23560-5-thuth@redhat.com> -- 2.20.1 diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c index 7e86c5416cc..a2498005440 100644 --- a/tests/hd-geo-test.c +++ b/tests/hd-geo-test.c @@ -34,8 +34,13 @@ static char *create_test_img(int secs) fd = mkstemp(template); g_assert(fd >= 0); ret = ftruncate(fd, (off_t)secs * 512); - g_assert(ret == 0); close(fd); + + if (ret) { + free(template); + template = NULL; + } + return template; } @@ -934,6 +939,10 @@ int main(int argc, char **argv) for (i = 0; i < backend_last; i++) { if (img_secs[i] >= 0) { img_file_name[i] = create_test_img(img_secs[i]); + if (!img_file_name[i]) { + g_test_message("Could not create test images."); + goto test_add_done; + } } else { img_file_name[i] = NULL; } @@ -965,6 +974,7 @@ int main(int argc, char **argv) "skipping hd-geo/override/* tests"); } +test_add_done: ret = g_test_run(); for (i = 0; i < backend_last; i++) { From patchwork Thu Dec 19 10:49:17 2019 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: 182085 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp313362iln; Thu, 19 Dec 2019 02:54:48 -0800 (PST) X-Google-Smtp-Source: APXvYqy9lDN860VSDi76UnZQyU2w3fS2oMNFHtZ/J5jlneAerodxpfDt7eVsT1cNa86g+JYInoGN X-Received: by 2002:ac8:4086:: with SMTP id p6mr6175631qtl.161.1576752888539; Thu, 19 Dec 2019 02:54:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752888; cv=none; d=google.com; s=arc-20160816; b=vdvcHIJ6V2+DWM4tBZ2GPJe++Ymm5jokJpM5yXZszWoVkzidp2BgXYSYa3Z5O6fc0p YLBVjQE0lbzQ6t1xVIo/coBJwISdcI3HxAuQDcqw8HqPIMkEZM3hkb2sYqdcLK57UI1V ayetPeloBPQ+pZjK2lT9kY0y1AZO5x/Bb1C/9j0XUfvM34McyGKYoDeF/JDZ0BoaSlJB 4IM8ckCdiqjR9kPOmQv2xLRgQTTpI/5Ex0fW4FQ6X6EAUckpz4jVLK39/R5OteWdTwxo 4X41r6jyJeWPBhpeV2Qj8pyFCmxcOIQDmKGkgKBrcpBdpptISQlA8WoE4ms0YwpE8hIN bTng== 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=q6QACTT6MNs1QawRF/X6ryVYhQD/X9R+o2LVrD4Tw14=; b=Ae7bdZ5ctxHNMVmETrNyQHvrbFV+nS3q0XsTRet1GRAhmmNLTVfGw/W006bTVKUdG+ /CIKvIBo+RH9svh20uc2bjNDVe7U0Wu8u7n9wzArGooONlXpwwCviZWNEJ2IdgpY464f 4nVDkDgD1LeDaX0rhAdkzOurAQGs0kQP4MDtXUz8V/okkp/KENJj8x6z2WsFuPdv5s3L gg2Vg1+fyaUJ24HVbF8xfmBwCAJxivDhcP/iplY0jLp7o3pmwfO/4QiiXbRftyUdz0eX x55o8mFvcTxAShuOYvpMTsvYMu16pRMaplJnVXganKR7U8sXgTinsblLtJz3kqBO5sPN p9wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I7TgzPE0; 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 e6si2701625qtg.254.2019.12.19.02.54.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:54:48 -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=fail header.i=@linaro.org header.s=google header.b=I7TgzPE0; 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]:38824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtSB-00065y-Sh for patch@linaro.org; Thu, 19 Dec 2019 05:54:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39140) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNL-0006gm-RY for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNK-0000CL-MV for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:47 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNK-00006z-BP for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:46 -0500 Received: by mail-wr1-x42d.google.com with SMTP id g17so5493194wro.2 for ; Thu, 19 Dec 2019 02:49:46 -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=q6QACTT6MNs1QawRF/X6ryVYhQD/X9R+o2LVrD4Tw14=; b=I7TgzPE0szFXokiwAgTKTkzrbZlqX49gLuMLtx84rOsOV0Fmev+rmvopGBVxFnZMSJ ofTsAkyx1sdEgtnwliYCbSOTTrr+R0Ya2maRQ0moIx9MF09IwFgNOXglTGise1K2SNDS VQ/265mb8pT/LC6+RuQnOujs68JL4FlCIM6fV05rvBO6OS1wyc0NzzRedPdvR5wrrdBK Ipz23ptRCUa+Y6CODQJrWrwk30CxGMDQQhCGvtBX0X2FWAyTywpC4mtSJeNavXMuEEbf OFMtFqa/BqMiQLvZEXVrmJO9NpH+ZvRjroS8w6kDr6eaZdkYXMN7b0Ztz5sT4J3iv5vq GCOQ== 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=q6QACTT6MNs1QawRF/X6ryVYhQD/X9R+o2LVrD4Tw14=; b=NHtDm+K0/Th4Sp6IpUk/jEEWZrv11cX2Vs8FX9XJ0y13wzh2fkjMP5vYw9+F/C38w+ NVaXdtl1F6l5RThjQiu9jeBr5P9S0GfKfCCJJHaJnEDLP4tKA2+qGVQ+aKsAVuVVbP/U 4G87JEjAl/sgA26RR93+GG22AUydG2FqPEAsFGv4i0BfRl6XiWkbWG9nHneEXTE6q78M rfWR9vneZahxLpOux7ZqtVMlUh4GeKQcN9q1ruwRFu/cZF1sTGGtct4bC6oKsWNtVQfm grPVuWyVtTFyn/h9/tzCkrs4ElRhtTYc4iqBUaC25DKqjUK67QrUAIba858POOjC81A/ k0Fg== X-Gm-Message-State: APjAAAWHOo7lVkh/msVgubVXBamn6Hzq5t8XW5zbWoI2PbDXMzqgqaZN 3YoOm2xc/txVEXgAGPoy5VF6uw== X-Received: by 2002:adf:e78a:: with SMTP id n10mr9036693wrm.62.1576752585299; Thu, 19 Dec 2019 02:49:45 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s82sm6075064wms.28.2019.12.19.02.49.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2C2021FF98; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 08/25] tests/test-util-filemonitor: Skip test on non-x86 Travis containers Date: Thu, 19 Dec 2019 10:49:17 +0000 Message-Id: <20191219104934.866-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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: Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth test-util-filemonitor fails in restricted non-x86 Travis containers since they apparently blacklisted some required system calls there. Let's simply skip the test if we detect such an environment. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Message-Id: <20191204154618.23560-6-thuth@redhat.com> -- 2.20.1 diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c index 301cd2db619..45009c69f41 100644 --- a/tests/test-util-filemonitor.c +++ b/tests/test-util-filemonitor.c @@ -406,10 +406,21 @@ test_file_monitor_events(void) char *pathdst = NULL; QFileMonitorTestData data; GHashTable *ids = g_hash_table_new(g_int64_hash, g_int64_equal); + char *travis_arch; qemu_mutex_init(&data.lock); data.records = NULL; + /* + * This test does not work on Travis LXD containers since some + * syscalls are blocked in that environment. + */ + travis_arch = getenv("TRAVIS_ARCH"); + if (travis_arch && !g_str_equal(travis_arch, "x86_64")) { + g_test_skip("Test does not work on non-x86 Travis containers."); + return; + } + /* * The file monitor needs the main loop running in * order to receive events from inotify. We must From patchwork Thu Dec 19 10:49:18 2019 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: 182078 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp311209iln; Thu, 19 Dec 2019 02:52:14 -0800 (PST) X-Google-Smtp-Source: APXvYqznzmZzQDgLg735BN+O2hBlYOPO65T40SXMHgo1F1RMwgyM7ug1HO06jVGybF6MjXAojZRh X-Received: by 2002:a05:6830:1b7b:: with SMTP id d27mr8513471ote.78.1576752734619; Thu, 19 Dec 2019 02:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752734; cv=none; d=google.com; s=arc-20160816; b=E9Hp35OxOke+KgyaMDjQOXIznLWduzsUwYlU14mD0wENLvzUR/ZyG533ED/wIBlvqN iX5iBJm627BGSXEwBSexWpWWEdJ/BS6S1XZXCuKpU4OlLSuHTGLf3/POK2a+mCB0/s8u cRJ08hlOIm5PRJPIaP4giGMSOnydXbjXtV6suLfQmY/UYIeBnjqYHtWeFSErBrv5/ScS AizC3U8li66vSFbfEB/jFUNtm3a7B6R9PVzm5SbW5nDc+56BvwqTMtP5grgZyv+AbUhN +Dnj3Whqx4OpjF0yo/uvmJAfxZfxOP1e4uzjiSog4DkcQPNh0EPRa2ao/ycxVnAioPRl e5UQ== 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=a5LpjEJFSdAakd089VcyJTqDappqhvSCYXY3Tn+aHt4=; b=tJfrNyCe3J1k1u6Q0KgT5bmdx+K+n0gPKrlPVhDdZDo50tDARcFmVMToA0PweCFGGQ 5hh7PBrQdq9tHj7av48bZ727EkGmCYb1UgEdiohkEdEAuDIt1fg0IW0ijkE5L/KnxscJ H3aiPy2QQ+wfgLozLouj8t/ZYGUlaf9IAoiBc2lXqfxT/db+TkKfChSb8ASaf31r5n1C CsuztJbnqsPPOcNhFNXSMavLZdQcKVSDTg58A0H3X16guNpP4KlOaRzALdqSWzKW0jXT e3QP7b4gy/ORWs/XmX1DZQ31P4RoAw0/wlmdepIiBx7U6FKbv2eHxmhvI4Y5TV+aTcFC SJfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JLB1pR0z; 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 j9si902054otn.294.2019.12.19.02.52.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:52:14 -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=fail header.i=@linaro.org header.s=google header.b=JLB1pR0z; 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]:38756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtPf-0002JO-2y for patch@linaro.org; Thu, 19 Dec 2019 05:52:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39537) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNO-0006ko-88 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNM-0000PX-QU for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:49 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:43943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNM-0000IW-GU for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:48 -0500 Received: by mail-wr1-x429.google.com with SMTP id d16so5456741wre.10 for ; Thu, 19 Dec 2019 02:49:48 -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=a5LpjEJFSdAakd089VcyJTqDappqhvSCYXY3Tn+aHt4=; b=JLB1pR0z6pXa9MsWupB8kxMxDQ7WAB2749fb4KrRY7OSNW+LPkJr6484vIouretpX+ qPFA6XimSYGz4tuC7nEaSM6k2DG4pLG2s1cZb3vpAfkHeTghVeGEEJY1pvLx5gAsBEK0 bm/23ynRGfjPGrKUeFkbkEs3pzZ9iEpig2KSugVvq09dO2XxCm1orwO/oUJnxmELhb+I ioMPrcDC/NvdqjJXWERhbtplmpb2El+8s4jFtKCmjgUN3PEzzxQVJZNQu1+HOOBBUuLq M78m2RaqYAI/LWdB69VmEt4Sujc9MVgYcWQ2RqsiCjSnXZCwduZDMTG4WZhI0vVd3/CY 4JZw== 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=a5LpjEJFSdAakd089VcyJTqDappqhvSCYXY3Tn+aHt4=; b=iqys0xv71qBRvb635VJEmcuH8GcaBOiBiyrGVAS+0EtMtXbwHQ1ZDKusaL4IKrzHzl vNxCIu7nuB69PSTI55ZhALIXfT/dC1TPiuNu7PyoamvM8qTr10jXZiNANvRnJCeUCSX3 DyUwhlAEVEs9J3up/mNM4PTqm8550cmRCU8D6VqCj+cAS3KHOIs939p4ihXNhkdvOIdw Fw7CnWg8ZltrrTyjyXZXfSIFmC3EWoq7K5Wm+lkifxZIKe8XOABUCq0xbB0rzZTDUVi+ ZFQsw+LBlWPAHAmThCuUSpFRhNwbTocgVVFqel126FMrZSPAj1AQDTbJBvLJ2uOjQCO0 qXnA== X-Gm-Message-State: APjAAAVr2ZKHMon5tKf8tQlRyaRxwhlObZD7hkJ7pADXqTDM0gmc/eK6 P0qWU5gkbSmpzEUoubQwmZVx6A== X-Received: by 2002:a5d:53c1:: with SMTP id a1mr8253423wrw.373.1576752587305; Thu, 19 Dec 2019 02:49:47 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q68sm6750163wme.14.2019.12.19.02.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:41 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 427E81FF99; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 09/25] travis.yml: Enable builds on arm64, ppc64le and s390x Date: Thu, 19 Dec 2019 10:49:18 +0000 Message-Id: <20191219104934.866-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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: Fam Zheng , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Cornelia Huck , qemu-devel@nongnu.org, "open list:S390 general arch..." , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Travis recently added the possibility to test on these architectures, too, so let's enable them in our travis.yml file to extend our test coverage. Unfortunately, the libssh in this Ubuntu version (bionic) is in a pretty unusable Frankenstein state and libspice-server-dev is not available here, so we can not use the global list of packages to install, but have to provide individual package lists instead. Also, some of the iotests crash when using "dist: bionic" on arm64 and ppc64le, thus these two builders have to use "dist: xenial" until the problem is understood / fixed. Signed-off-by: Thomas Huth Acked-by: David Gibson Message-Id: <20191204154618.23560-8-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 15946293ff3..b68566b1fe9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -354,6 +354,92 @@ matrix: - TEST_CMD="make -j3 check-tcg V=1" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" + - arch: arm64 + dist: xenial + addons: + apt_packages: + - libaio-dev + - libattr1-dev + - libbrlapi-dev + - libcap-ng-dev + - libgcrypt20-dev + - libgnutls28-dev + - libgtk-3-dev + - libiscsi-dev + - liblttng-ust-dev + - libncurses5-dev + - libnfs-dev + - libnss3-dev + - libpixman-1-dev + - libpng-dev + - librados-dev + - libsdl2-dev + - libseccomp-dev + - liburcu-dev + - libusb-1.0-0-dev + - libvdeplug-dev + - libvte-2.91-dev + env: + - TEST_CMD="make check check-tcg V=1" + - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}" + + - arch: ppc64le + dist: xenial + addons: + apt_packages: + - libaio-dev + - libattr1-dev + - libbrlapi-dev + - libcap-ng-dev + - libgcrypt20-dev + - libgnutls28-dev + - libgtk-3-dev + - libiscsi-dev + - liblttng-ust-dev + - libncurses5-dev + - libnfs-dev + - libnss3-dev + - libpixman-1-dev + - libpng-dev + - librados-dev + - libsdl2-dev + - libseccomp-dev + - liburcu-dev + - libusb-1.0-0-dev + - libvdeplug-dev + - libvte-2.91-dev + env: + - TEST_CMD="make check check-tcg V=1" + - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user" + + - arch: s390x + dist: bionic + addons: + apt_packages: + - libaio-dev + - libattr1-dev + - libbrlapi-dev + - libcap-ng-dev + - libgcrypt20-dev + - libgnutls28-dev + - libgtk-3-dev + - libiscsi-dev + - liblttng-ust-dev + - libncurses5-dev + - libnfs-dev + - libnss3-dev + - libpixman-1-dev + - libpng-dev + - librados-dev + - libsdl2-dev + - libseccomp-dev + - liburcu-dev + - libusb-1.0-0-dev + - libvdeplug-dev + - libvte-2.91-dev + env: + - TEST_CMD="make check check-tcg V=1" + - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user" # Release builds # The make-release script expect a QEMU version, so our tag must start with a 'v'. From patchwork Thu Dec 19 10:49:19 2019 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: 182079 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp311451iln; Thu, 19 Dec 2019 02:52:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwVdib8qVUkRflRBKkYEfYzkz6wgI52oW84SupLRjvjY8r3nowC8Zf98rxB7XHKa2+OMuc3 X-Received: by 2002:a05:6830:1755:: with SMTP id 21mr6095104otz.323.1576752751944; Thu, 19 Dec 2019 02:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752751; cv=none; d=google.com; s=arc-20160816; b=ONNbMqR5oM2PifON1NKpSY6EOEtEYX9U1VV/3lPzhUFxfXBq/D3QgFMDVKrKkQuhRD +hrWiahZqDNXuKN7Em4CpebBfU5siVPUQzdAyzPdJf0vDAG9qgmxFYYwJMNbix+V1lPU EIfhkRmgcDf5Gau1KJghH0hTnB8Mw8D/0nIDLX4udyBKAsBUl3+NprA0fdWmyqcfQIjO deXDldu45sYFrWjoOiha6Jxu1A8aQXMCJVOmFoj9lkgetAk16syprS/2jJiJAahcCBWX vfBh5ovobzvCLkWd5hG3rWRTWgXydngtju/rEkbUVGYCvJh0gBeuiXaMiM4LHZoaTu/+ 0WQg== 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=tQ2NW34S5Zq+7PW6zNueCL2QW+1AX6K9G7g3BN8KIko=; b=o0VGWRo+Yb4Xq3o3eXpxecXLobqL4ewfl6rS8X1H5cPkp8DN+KOtuMa3BuRtfvya5A KctFVZYm0Hq9wqBNJCV0hS7xFy+XR2mx5/kHD5pe1z9zIYpG8iCAjLuuJRQxYACxOY6e 40nCJRfHC8Jviy7YYrgfbS3XTVV9YeIdnR6+gfxzaijDL+e4QZ6Y/sVexhCv0aI1Dwni +vnq7Fe7b/tokSEwVdpMJycgrAkExZ2wn5aAaXO/enSqPPH94kdGaZEfQ6iQGM2jubzg LmJMa29eh4xNd5yVAJX/YRzPMhxK8tThm7aBCTCjQunYL5jEzR7tud+MKt/KOq7AHSFQ 3ASA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="xZ/Zw7yO"; 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 w26si2755938otl.213.2019.12.19.02.52.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:52:31 -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=fail header.i=@linaro.org header.s=google header.b="xZ/Zw7yO"; 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]:38764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtPy-0002SL-NU for patch@linaro.org; Thu, 19 Dec 2019 05:52:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39800) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNP-0006ne-TV for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNO-0000W6-5I for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:51 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNN-0000Qq-Pl for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:49 -0500 Received: by mail-wm1-x341.google.com with SMTP id p17so5127532wmb.0 for ; Thu, 19 Dec 2019 02:49:49 -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=tQ2NW34S5Zq+7PW6zNueCL2QW+1AX6K9G7g3BN8KIko=; b=xZ/Zw7yO4Lp0lVJbtqEmg3+n5I4PSUdQn7YPjnTPCLRG139mI5qH2ya6oRi1kVzozA Tvxq+aqu5H30z37nmYv8TNlgml7eRLTA+i7T6v5iVLQ2Ko8Mm1mnctrvOZ5doIC8J6jT vXL6OJeB3tN01G9uHW5hHrFn/Wn7izQJK++2QoV5dvmbZ0zjEgX9RaCMOAYWn/zztjuq jwQln6XqmIYE1+tnbRVXvBpy9nDJeV64qx9I/hJaSQ396XY6m8NdACNJzkam/fRnsDW9 6uhfWkHkjKEC+Fal5deegWM3rgqENxUVjdVr/0wxSdWKOl7N/+1gQOdjR/wiAjDAXu/9 5CTw== 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=tQ2NW34S5Zq+7PW6zNueCL2QW+1AX6K9G7g3BN8KIko=; b=iOGZJfy87v+x73ef5IlsM6O+c8SX/qx0JR8J92U5EuZD4ElcJtVjSdwZTDZOVbbGBu BEf4p+5h9qxTUgTQIw05VLVx8Md9z6QSHgVeOxjDDSExQAv0rRXti6DMXnfYCAdqoMEz /66dfAS9exLRD3grqnchfbVsc26xpjnzT4cOl9RozGHgpMRKcN+RIYf34s6hQPPr1cGj h49OOLTlSI6eZ6dnPFbB33Z2LuBtYs2hSXL7q0upn24D0/pB+aiOwe/NuLpoVISvComU jndBGudY56S/Y+KZvpenSEVrBpveJEeh0Kh3cHBpSPd9fWvjCtznGj0zUky2nlIqTEUC ZxSg== X-Gm-Message-State: APjAAAVGiElXBDDntPvnpmurUbU0FkLyrskORXWIq+JMusvdv0Gwf8mV HXNJfGcxax8z0snqyD10GwNX2Q== X-Received: by 2002:a1c:7d93:: with SMTP id y141mr9586505wmc.111.1576752588622; Thu, 19 Dec 2019 02:49:48 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x11sm5790844wmg.46.2019.12.19.02.49.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:42 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5F6BF1FF9A; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 10/25] ci: build out-of-tree Date: Thu, 19 Dec 2019 10:49:19 +0000 Message-Id: <20191219104934.866-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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: Fam Zheng , Thomas Huth , Ed Maste , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Li-Wen Hsu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini Most developers are using out-of-tree builds and it was discussed in the past to only allow those. To prepare for the transition, use out-of-tree builds in all continuous integration jobs. Based on a patch by Marc-André Lureau. Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Li-Wen Hsu Message-Id: <1576074829-56711-1-git-send-email-pbonzini@redhat.com> -- 2.20.1 diff --git a/configure b/configure index e0c66ee9b68..93625811a05 100755 --- a/configure +++ b/configure @@ -6401,6 +6401,7 @@ else echo "local state directory queried at runtime" echo "Windows SDK $win_sdk" fi +echo "Build directory $(pwd)" echo "Source path $source_path" echo "GIT binary $git" echo "GIT submodules $git_submodules" diff --git a/.cirrus.yml b/.cirrus.yml index 27efc48619b..90645fede6b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -22,7 +22,9 @@ macos_task: install_script: - brew install pkg-config python gnu-sed glib pixman make sdl2 script: - - ./configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; } + - mkdir build + - cd build + - ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check -j$(sysctl -n hw.ncpu) @@ -33,6 +35,8 @@ macos_xcode_task: install_script: - brew install pkg-config gnu-sed glib pixman make sdl2 script: - - ./configure --cc=clang || { cat config.log; exit 1; } + - mkdir build + - cd build + - ../configure --cc=clang || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check -j$(sysctl -n hw.ncpu) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3db1b847cc..ebcef0ebe9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,9 @@ build-system1: script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev - - ./configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu + - mkdir build + - cd build + - ../configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu" - make -j2 @@ -16,7 +18,9 @@ build-system2: script: - apt-get install -y -qq libsdl2-dev libgcrypt-dev libbrlapi-dev libaio-dev libfdt-dev liblzo2-dev librdmacm-dev libibverbs-dev libibumad-dev - - ./configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu + - mkdir build + - cd build + - ../configure --enable-werror --target-list="tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu riscv32-softmmu s390x-softmmu sh4-softmmu sparc64-softmmu x86_64-softmmu xtensa-softmmu nios2-softmmu or1k-softmmu" - make -j2 @@ -24,7 +28,9 @@ build-system2: build-disabled: script: - - ./configure --enable-werror --disable-rdma --disable-slirp --disable-curl + - mkdir build + - cd build + - ../configure --enable-werror --disable-rdma --disable-slirp --disable-curl --disable-capstone --disable-live-block-migration --disable-glusterfs --disable-replication --disable-coroutine-pool --disable-smartcard --disable-guest-agent --disable-curses --disable-libxml2 --disable-tpm @@ -37,7 +43,9 @@ build-disabled: build-tcg-disabled: script: - apt-get install -y -qq clang libgtk-3-dev libusb-dev - - ./configure --cc=clang --enable-werror --disable-tcg --audio-drv-list="" + - mkdir build + - cd build + - ../configure --cc=clang --enable-werror --disable-tcg --audio-drv-list="" - make -j2 - make check-unit - make check-qapi-schema @@ -52,7 +60,9 @@ build-tcg-disabled: build-user: script: - - ./configure --enable-werror --disable-system --disable-guest-agent + - mkdir build + - cd build + - ../configure --enable-werror --disable-system --disable-guest-agent --disable-capstone --disable-slirp --disable-fdt - make -j2 - make run-tcg-tests-i386-linux-user run-tcg-tests-x86_64-linux-user @@ -61,7 +71,9 @@ build-clang: script: - apt-get install -y -qq clang libsdl2-dev libattr1-dev libcap-ng-dev xfslibs-dev libiscsi-dev libnfs-dev libseccomp-dev gnutls-dev librbd-dev - - ./configure --cc=clang --cxx=clang++ --enable-werror + - mkdir build + - cd build + - ../configure --cc=clang --cxx=clang++ --enable-werror --target-list="alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu ppc-softmmu s390x-softmmu x86_64-softmmu arm-linux-user" - make -j2 @@ -70,7 +82,9 @@ build-clang: build-tci: script: - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64" - - ./configure --enable-tcg-interpreter + - mkdir build + - cd build + - ../configure --enable-tcg-interpreter --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" - make -j2 - make tests/boot-serial-test tests/cdrom-test tests/pxe-test diff --git a/.shippable.yml b/.shippable.yml index f74a3de3ffd..83aae08bb4c 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -35,5 +35,7 @@ build: options: "-e HOME=/root" ci: - unset CC - - ./configure ${QEMU_CONFIGURE_OPTS} --target-list=${TARGET_LIST} + - mkdir build + - cd build + - ../configure ${QEMU_CONFIGURE_OPTS} --target-list=${TARGET_LIST} - make -j$(($(getconf _NPROCESSORS_ONLN) + 1)) diff --git a/.travis.yml b/.travis.yml index b68566b1fe9..d673ee219e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,8 +73,8 @@ notifications: env: global: - - SRC_DIR="." - - BUILD_DIR="." + - SRC_DIR=".." + - BUILD_DIR="build" - BASE_CONFIG="--disable-docs --disable-tools" - TEST_CMD="make check V=1" # This is broadly a list of "mainline" softmmu targets which have support across the major distros @@ -191,7 +191,8 @@ matrix: - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize" compiler: clang before_script: - - ./configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; } + - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} + - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; } - env: @@ -323,7 +324,8 @@ matrix: - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-pie --disable-linux-user" - TEST_CMD="" before_script: - - ./configure ${CONFIG} --extra-cflags="-g3 -O0 -Wno-error=stringop-truncation -fsanitize=thread -fuse-ld=gold" || { cat config.log && exit 1; } + - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} + - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -Wno-error=stringop-truncation -fsanitize=thread -fuse-ld=gold" || { cat config.log && exit 1; } # Run check-tcg against linux-user @@ -460,5 +462,6 @@ matrix: - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2 - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION} - - ./configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } + - mkdir -p release-build && cd release-build + - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } - make install From patchwork Thu Dec 19 10:49:20 2019 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: 182086 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp314744iln; Thu, 19 Dec 2019 02:56:35 -0800 (PST) X-Google-Smtp-Source: APXvYqw48v15gWfQPamhzuh57Mq0gD5ZbbRWmGcZTn+oLGne11xAXoHL7ewpR2lwjkiyIYL8ZedZ X-Received: by 2002:a05:6214:1150:: with SMTP id b16mr6935951qvt.71.1576752995437; Thu, 19 Dec 2019 02:56:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576752995; cv=none; d=google.com; s=arc-20160816; b=IjmMTEbwJoixiv5UgB5KyLcDOkc+86he7GkAH+y9/F7eSwBFfB3vvNwvCwp6rEF97C EOaVciRHRdUpTz5XwK1msrLPSLL+32Ei8W67PwBdoS279bODJreQ4JTVFtvjIyxqGbUG Zpyl0fB+5Z2DE80MAs3XCajNyFgClbDF3FOikAfhJHSdpv/tpP8CcoZZr4P6gXl96ITb G9IWq8+BWSuDluE4NnzSN6o1jzk0F71bKyNir3t99W6fXRAapEKw/xLC3+147aoFYfkN vlqYYVuCQGmrsbXcxXwia1IdDf2vlpMldg6xfWnF7d5v2wZDzgT6BBuoiFQ7WxgpbiBG NhAQ== 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=E6nvW6fexsDWMN+ZoXwp4ZNbLiQ7+yB+XmIDWRZJcu8=; b=OgiPvLAQO22sXlMnw1r9x/WjC9Utis2pZ196zl1p3MHJMELoK/nCfVImMMjvkHTmuW cUnKDvPdDDg/hQuGxqjXyZbPiOP0a+BxemZX+VvdI8H5tXfpcg/LZVuGTkNc+Mq9/e91 juqncT979jr6UhcbYZfi+8lJcpoFizY5tH4yYO+iN5XbjXY9q1AFzhXpreWcEgMoI5JH dWp0CBguVlHy5P7MU8NMKcsMr9b8BxUUiqzALATZCvwT/Suo03wpwAzOphQu2WWBoOFN C1uqODq+bNUpm598f7Fjal/iX6lyblNblQH1GwIr3LhRAUoXB9S6/Q6QVSYNq2HdsD6H kzVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TuTieeeY; 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 d2si293252qtj.154.2019.12.19.02.56.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:56:35 -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=fail header.i=@linaro.org header.s=google header.b=TuTieeeY; 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]:38864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtTu-0008VY-Mm for patch@linaro.org; Thu, 19 Dec 2019 05:56:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40014) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNR-0006pq-52 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNP-0000fg-Sc for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:52 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:41088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNP-0000af-JO for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:51 -0500 Received: by mail-wr1-x431.google.com with SMTP id c9so5472894wrw.8 for ; Thu, 19 Dec 2019 02:49:51 -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=E6nvW6fexsDWMN+ZoXwp4ZNbLiQ7+yB+XmIDWRZJcu8=; b=TuTieeeY7X2UgCrzy2VBnkgGbRR3n+E/SMAGMjPPGsubYnWuu51pI/0G3YP6Y5I7nX S19PZQeorNFIyo8XmJPDuDsAKKgyqPDCP54TWOYVZ/By5Xdx5RWNslTRarKbDP++KxmY jynEZ7zkCIZdjdrDM4WCg7Nvw0o+B4ukc57N5narWgF8YlxNqA90vSRF40Eq3RLVTDF0 BYrQ+OUCNWZiXvkr2zDptem0idI3AdLT7/KENQAHV+DceDlpoiZWTO53k22mES9uVwk/ E7pmuk87BngzP1yZyXHfhPIdLUu9SZMo4ZetBKlTreoRMX5n2EbBXrRUO7WVh0Y/zIKd w2ww== 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=E6nvW6fexsDWMN+ZoXwp4ZNbLiQ7+yB+XmIDWRZJcu8=; b=sZMCxSRfz90o9ejVqKWbLd7/7I9VUuOdaD1IJaM1p16b9VmCCQuTtjoQcnFw3P9WZI 9jIqO0MWjoa8iLsrOOKHRf9/lzTD8v+Vk97CLM6g1HhxULE5MSxgzCPuKBeu9EfQ96uw iOBjTHwFarFHrVPglmQWo12GLA0BoalNmnIk2kVbYnccdr+MMemIVAHbvsDsTrHEPhxU 8mQSslpww+Bgz4dFFbWfrx6x1bOCfqxH5Vk1jSD5L0EtU/ijpdqeIuLc1mSG8TC10dy6 lWMFjAHdP6qNYXgyPQfYplHho0oRoDCGqCpb/xbc/fsRHoGuW4lnoyrHC6Y8plG/TVoA XkKw== X-Gm-Message-State: APjAAAWmmpejmS1bTm4MUR6Q8DPYDnq07W8Q+qYKd5mqiQnbh38NrWpV d1VR43uF3DnOWLmN0vnwAyTRKw== X-Received: by 2002:adf:e74a:: with SMTP id c10mr8424770wrn.386.1576752590648; Thu, 19 Dec 2019 02:49:50 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h17sm6193828wrs.18.2019.12.19.02.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:42 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 749FF1FF9B; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 11/25] Fix double free issue in qemu_set_log_filename(). Date: Thu, 19 Dec 2019 10:49:20 +0000 Message-Id: <20191219104934.866-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley After freeing the logfilename, we set logfilename to NULL, in case of an error which returns without setting logfilename. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-2-robert.foley@linaro.org> -- 2.20.1 diff --git a/util/log.c b/util/log.c index 1ca13059eef..4316fe74eee 100644 --- a/util/log.c +++ b/util/log.c @@ -113,6 +113,7 @@ void qemu_set_log_filename(const char *filename, Error **errp) { char *pidstr; g_free(logfilename); + logfilename = NULL; pidstr = strstr(filename, "%"); if (pidstr) { From patchwork Thu Dec 19 10:49:21 2019 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: 182087 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp314883iln; Thu, 19 Dec 2019 02:56:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzDjwTA1MJU3KePcMSIotJPUv3Ugq7hgdq8NXgF/Y9Qm88noooWe4ncz1B8vMXSBF1i2YPZ X-Received: by 2002:ae9:e41a:: with SMTP id q26mr7471894qkc.288.1576753004344; Thu, 19 Dec 2019 02:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753004; cv=none; d=google.com; s=arc-20160816; b=NzJbcVHYk1hCVhDII/Nlnal1clSy4WUB6eOtWCzHs0hsX/7NybhLPdpTFgOqu798xe NHKcePjVwqbDm+i7OxOf6fcK6DEqS+ZIS4u8LQszyWTDnHRntPq9D9o9ZxT31bX+/Xfn kBP4eGaKZHe7m8QggDES9P+Q0aU8No7rJ9TVo2Sk3kjDW7uO9KoaKtA52mW7yJxA9WWC cmIrb8HdZ8GtwYV8xG7Omf0Kq3mJTaVTDbPIWQrx3yrUOrMaqX/dj6avvike3uShm7NK 4X6Xiq6p47aNnRtt6dmU9HwYoeXiR+MnMuH0WyfiaxRqPVPGsrxgyNCMa3qNrVtEO8y7 MuwA== 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=P9Lb7ztuATikl7TNtVbTN8vyb1yQBmpZ8Z1emNqMw+U=; b=beYK/KGULQdRO+7K2FXrKcBXTXNWyBWknoPnzek4XAQ5Sx1rqOrxH3VqiL5kzGfej+ c12r2Is8BMVy1X7EVWwCHZ20VQxU7BPXCpcxQ4cGf/D21V3XSWbmI7pJDWS9KYn+2TKq Hke+M1q4ziGRQ4Azv76M4oarUXU9GwGD4J633dn5ty9se0eYHC+l8yGWSU4hf9RFLtTM ZkfjHLOSOMRjV7KJxqdsK67Iq1mcss2accnFmStho3P9Pxrjrg00jXtacoR9aMiOk6Fk upsEnFCgUZr9muwufg4w6i+DL08JnWNj3xVUGTGIhg/Hi4FeC4veKrGQQKjAuSiNzpyl fEyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="dLES/IB2"; 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 q126si3299382qke.75.2019.12.19.02.56.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:56:44 -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=fail header.i=@linaro.org header.s=google header.b="dLES/IB2"; 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]:38876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtU3-0000KD-MK for patch@linaro.org; Thu, 19 Dec 2019 05:56:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNS-0006rh-Bl for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNR-0000mW-1o for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:54 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:38895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNQ-0000hV-Nc for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:52 -0500 Received: by mail-wr1-x433.google.com with SMTP id y17so5504265wrh.5 for ; Thu, 19 Dec 2019 02:49:52 -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=P9Lb7ztuATikl7TNtVbTN8vyb1yQBmpZ8Z1emNqMw+U=; b=dLES/IB2Yra2QENlYcb7uoe69TkKxnfF8dYEVjIq+/WDoIjNtBOF7rpcf4LECdevwQ pUw0iUoXiZC/P8zUnXEya/f5QgSRQeZHYbexifNzWP46Eq0pcT6hQ05gouCcZv1H4PnX QzgpraEtgSPNF+uYXDqa71Gh8EcPWbU7dB/DANysxC5GQQPj7PGouDDmn3BSyki5T0DU fciy+SueMzNCx7f7n/FYDXFp9lCBPRknL4eTxeTPqWUeGoNnKmTAZMd14ZwZMGpX9Bbe 9WzZsN1PQOSHy8e0wgHpnMdCHEU7oYamsZPr/5alMLpXQlDcwjStNqrq/Ix0g0CtPVBU /Dmg== 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=P9Lb7ztuATikl7TNtVbTN8vyb1yQBmpZ8Z1emNqMw+U=; b=A6YGEsAxjPStLUZzCfBEpObFjPlEBlO0aE5w8EEKoJOvMKW4NzqK0rMy0rhHKLocQ4 XgQHL/5AcRB3pqZAHmm7qKa6dt43H/JhPt8IJCAyt9DCea6HmUSWexGDldpLShS9vyZ5 lmjzTUpEegg/oYN7pT1mBODK6LyGoiquSl/1GDd+17rQKN+jCyhi+ukeAO7uKKXuCrJQ 81TfQoLGavxbPwVoCLBetPlOAoR1sNDlcdqgTYLMK3ZvuzRcs/W+PVSNn5Yyx8DcEjI0 OD9Qq689YrZXSERSXxLDnEF1YRkWNlhi/tg6NVm+ERp4YdIXfZ9FZPatsp+/wPhU/JXE Vw+A== X-Gm-Message-State: APjAAAUXQm/IJGtLr/+7Wi6gCYr1lwbVrgcaaELUNuW21LMNh8jVxjPG XtfQsib5pvTD/1YRYxHkVpjwcA== X-Received: by 2002:adf:f3d1:: with SMTP id g17mr8851946wrp.378.1576752591727; Thu, 19 Dec 2019 02:49:51 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z11sm5734133wrt.82.2019.12.19.02.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:42 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8AC561FF9C; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/25] Cleaned up flow of code in qemu_set_log(), to simplify and clarify. Date: Thu, 19 Dec 2019 10:49:21 +0000 Message-Id: <20191219104934.866-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Also added some explanation of the reasoning behind the branches. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-3-robert.foley@linaro.org> -- 2.20.1 diff --git a/util/log.c b/util/log.c index 4316fe74eee..417d16ec66e 100644 --- a/util/log.c +++ b/util/log.c @@ -54,12 +54,25 @@ static bool log_uses_own_buffers; /* enable or disable low levels log */ void qemu_set_log(int log_flags) { + bool need_to_open_file = false; qemu_loglevel = log_flags; #ifdef CONFIG_TRACE_LOG qemu_loglevel |= LOG_TRACE; #endif - if (!qemu_logfile && - (is_daemonized() ? logfilename != NULL : qemu_loglevel)) { + /* + * In all cases we only log if qemu_loglevel is set. + * Also: + * If not daemonized we will always log either to stderr + * or to a file (if there is a logfilename). + * If we are daemonized, + * we will only log if there is a logfilename. + */ + if (qemu_loglevel && (!is_daemonized() || logfilename)) { + need_to_open_file = true; + } + if (qemu_logfile && !need_to_open_file) { + qemu_log_close(); + } else if (!qemu_logfile && need_to_open_file) { if (logfilename) { qemu_logfile = fopen(logfilename, log_append ? "a" : "w"); if (!qemu_logfile) { @@ -93,10 +106,6 @@ void qemu_set_log(int log_flags) log_append = 1; } } - if (qemu_logfile && - (is_daemonized() ? logfilename == NULL : !qemu_loglevel)) { - qemu_log_close(); - } } void qemu_log_needs_buffers(void) From patchwork Thu Dec 19 10:49:22 2019 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: 182088 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp316551iln; Thu, 19 Dec 2019 02:58:45 -0800 (PST) X-Google-Smtp-Source: APXvYqw7xxhK1XtXZ3k1EfMHGEOFXkobH/C1eGgyoyjw2JpP20/5z37xJsibpJoT4N756P0Ws6PR X-Received: by 2002:a37:e507:: with SMTP id e7mr7663298qkg.358.1576753125791; Thu, 19 Dec 2019 02:58:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753125; cv=none; d=google.com; s=arc-20160816; b=oQuewhRe1k58mObY7IYb/NqPEE/Zm0Eco9Ik74G4a28JjilRm5yg6nXA/OgreLZOoi /egQ2MQc6w2tyK4n4xL9xdK3W6jBJFN4tMB1BXghssvjyUksJ6fhuiPcnbltTJXm0voT DmZwZbmY6zF5phse30Th/MsAr4OPSs5D8a6dbYHLl1ZU/Kv1R/oxoXbjFkhk9r7HNQPZ SbNYhG+kjGBc5xR9APpEe1nK4pwoDTRDLgn3TgWZug1V+BbqjDZNIIDc+VgDh4qJXNRK hkf4SYxqbSf0yX60UQsuLhx1Ihbx8t6vAfziyribYCQvgok3i7ToFAGuZFPhzH1BpFnA GsUQ== 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=mUysB+KCVNDJImTrn1g1Sf4sZ1iooDukb6kMQuinDJU=; b=gJtjz+tFRgiQeInOZ0uFP4qBLeztGLhdWfWFlFHi6dHuMgTG6RtgOclQX/4H5mOO50 gwM77kWYzm4b/EaTzHeQPtqqXbHmfw1NsjfKS4oi05bN1ldcXZ/cSntZUm1KGhTWBgv6 jeVQGLUHyWs1GeffqLvWRQh88vsAyzlBEXFgi1VETDVGFXI2g/wF086w8HfmJAz8FMHr Pvji38eYIeVUNFMvWG9uyJugXu6wnCimQMzygQarbBmY9G+Qla/VPmHeEUU5au2e/kPu FzGIheGNYS4KmgmNiNMMh6CzAR6qOSnWH8WioDStMR39Hxf3iPEKaAcQnKdFH97i351X u6Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L40IF6uZ; 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 c70si3508487qkg.64.2019.12.19.02.58.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:58: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=fail header.i=@linaro.org header.s=google header.b=L40IF6uZ; 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]:38896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtW1-0002de-29 for patch@linaro.org; Thu, 19 Dec 2019 05:58:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNU-0006vs-PR for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNT-0000zm-Bq for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:56 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53495) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNT-0000uv-47 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:55 -0500 Received: by mail-wm1-x32a.google.com with SMTP id m24so4930791wmc.3 for ; Thu, 19 Dec 2019 02:49:55 -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=mUysB+KCVNDJImTrn1g1Sf4sZ1iooDukb6kMQuinDJU=; b=L40IF6uZCGZS14txqiYJXwjArg8XcaWe4PMZnAXkRUPHNUdj+todE42Soo70HZB/ck I0T6t/ILA0Bnj9yZZWQhen/ZzE8sQpN5D4psFQZb1Kz3RGkIr8BpRpLNhqh3nlPwjY+t 7aBEpJS1uLi4t4GZ0IkBYsiSHgpHtUIo9r26cVs7Pv5NSVYqzNWWgOsA22kp+8PY1DRi fjFPMvPNQWcRilcc/ge/P9qZi5ATlkhcq7bnABSw3KG8xX4jSbIQOjVeYCVH/Xx6G3Jg DsONUKiYjldLoLZpymZthsX0cifKl3rgkYsO5DbsrQc9jg8bDde7dUCu+gdsou6Toa7n e6Uw== 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=mUysB+KCVNDJImTrn1g1Sf4sZ1iooDukb6kMQuinDJU=; b=EH6tFuH1KDyCheYruzJx8LCbz9nB1fZjeMyTi+d97YaxYxW0ofbZf7bkhkoGAUytML rEtRWYCs3m0G00LposkDyDpXiZUJ+m4tN+lMGL2MxgpdKXGUt9IMPYwaysKpWUtFLIYH 4Nn6qEFWbzLfI2NUF5UCV/1KhyoM+ztlWhonRndRaoFAwbr5qAzSsFBut8v67o5uLt33 jsQRVMl7BfaTYTa7zQryN+1082E149FWxagHnmfQdc5A+T/T37f4uDk8/yfyCO6V3nP9 FZY5NTtFT4VGMZW/0TZ/A6/If+tFfEpbd6OfQMzFBwuCpJKNRh65za+CbtLEfRbmleYL 8uOQ== X-Gm-Message-State: APjAAAXDHWcs7KcOCcnZXy6N1/ShVd7HLTnCsSxzhKxe8YAqb/V0VxIm IVjtxnrOkihDZllUsrmzThYhyhq1CVU= X-Received: by 2002:a1c:9acf:: with SMTP id c198mr8926967wme.175.1576752594098; Thu, 19 Dec 2019 02:49:54 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b67sm6052291wmc.38.2019.12.19.02.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:46 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A02001FF9D; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 13/25] Add a mutex to guarantee single writer to qemu_logfile handle. Date: Thu, 19 Dec 2019 10:49:22 +0000 Message-Id: <20191219104934.866-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Also added qemu_logfile_init() for initializing the logfile mutex. Note that inside qemu_set_log() we needed to add a pair of qemu_mutex_unlock() calls in order to avoid a double lock in qemu_log_close(). This unavoidable temporary ugliness will be cleaned up in a later patch in this series. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-4-robert.foley@linaro.org> -- 2.20.1 diff --git a/util/log.c b/util/log.c index 417d16ec66e..953a66b5a8d 100644 --- a/util/log.c +++ b/util/log.c @@ -24,8 +24,10 @@ #include "qapi/error.h" #include "qemu/cutils.h" #include "trace/control.h" +#include "qemu/thread.h" static char *logfilename; +static QemuMutex qemu_logfile_mutex; FILE *qemu_logfile; int qemu_loglevel; static int log_append = 0; @@ -49,6 +51,11 @@ int qemu_log(const char *fmt, ...) return ret; } +static void __attribute__((__constructor__)) qemu_logfile_init(void) +{ + qemu_mutex_init(&qemu_logfile_mutex); +} + static bool log_uses_own_buffers; /* enable or disable low levels log */ @@ -70,7 +77,9 @@ void qemu_set_log(int log_flags) if (qemu_loglevel && (!is_daemonized() || logfilename)) { need_to_open_file = true; } + qemu_mutex_lock(&qemu_logfile_mutex); if (qemu_logfile && !need_to_open_file) { + qemu_mutex_unlock(&qemu_logfile_mutex); qemu_log_close(); } else if (!qemu_logfile && need_to_open_file) { if (logfilename) { @@ -105,6 +114,7 @@ void qemu_set_log(int log_flags) #endif log_append = 1; } + qemu_mutex_unlock(&qemu_logfile_mutex); } } @@ -240,12 +250,14 @@ void qemu_log_flush(void) /* Close the log file */ void qemu_log_close(void) { + qemu_mutex_lock(&qemu_logfile_mutex); if (qemu_logfile) { if (qemu_logfile != stderr) { fclose(qemu_logfile); } qemu_logfile = NULL; } + qemu_mutex_unlock(&qemu_logfile_mutex); } const QEMULogItem qemu_log_items[] = { From patchwork Thu Dec 19 10:49:23 2019 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: 182101 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp332997iln; Thu, 19 Dec 2019 03:12:36 -0800 (PST) X-Google-Smtp-Source: APXvYqy1h0f8aI0D7nXSQF03g1fPKaeIWGCdxuQLVCh77DWfpYuMQN1cT9/BLIeZ0FQmbF+Anv8h X-Received: by 2002:ae9:e304:: with SMTP id v4mr7432079qkf.399.1576753956078; Thu, 19 Dec 2019 03:12:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753956; cv=none; d=google.com; s=arc-20160816; b=LIlhXJnJ+5AOzdki07qIr3jPvPmEYXS6qvmI+rMK7+s4kmzw2BrKqMwvpjrZR95dFB IZO/d5ojTqEqNkrRTToKPgoevNcj+LFqLRSzqy11VMO1IKmxIaBXc+1XeFaAcxyO2VUS EmiadsjiEqOAksDkLmxXcbeU/PF1Pjc8XazOGjlNBT7L3jGnDhGiY2RaJE8eXSbMEMhX 09PLFkZfgQOV8uJL5yypCNh7ptGgVOeMNfY6tyGrQNtrYnsNHec39D9icUMlwRQqYm6B 4ZfRydUY35AMk7SSZ8kggawHrB4aodNkQU22QnIyftZk7Jd49wtnE/rKr2+di9guSWu5 OH9Q== 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=xNVbpe55d79tM9HPZIL8ONzXUawfaxOna0fvaAKgXs0=; b=mP90FSxoiV06hMpmjH/PL0LVZefW+Hcl6vWVKljU+6esdgeNPVoL900U4IR2CQeT+E uOoCrQN3Wcqi+GsYkr8H4Db8infQEkuSJ1uj7uZAkzocjtnqlT42fcZSP71mQXBOvNPi wMc1LQRmKcQUbiSGaHIK7eM/FirnFi08qJ8mGqnIEXM5VN0MW6u9Fun6YJnvkTBXT50a OtOou0VVUs4Cr6eml5w8GPUGDhY4NQIEjkmekIi88EWA7DVvDmEgFm4v0R5SopW/8kpJ 4+V5zyo2aF5wT2wH8ie6uxZEqpVoBRWb3QEuK83fzN1nbcr58Tx07+ZBt8OafP6K5fwZ MHVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LUs4vp65; 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 c40si3127269qvd.147.2019.12.19.03.12.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:12:36 -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=fail header.i=@linaro.org header.s=google header.b=LUs4vp65; 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]:39276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtjP-0004cG-Ff for patch@linaro.org; Thu, 19 Dec 2019 06:12:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57933) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWj-0003zR-TU for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWg-0001OE-M8 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:29 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWg-0001Ib-Bd for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:26 -0500 Received: by mail-wr1-x441.google.com with SMTP id w15so5531113wru.4 for ; Thu, 19 Dec 2019 02:59: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=xNVbpe55d79tM9HPZIL8ONzXUawfaxOna0fvaAKgXs0=; b=LUs4vp65PtEDA6szHARnD6wtKvFhVL/uudkk0bPPrlJkwDdqf7kPUo/e72EqYrT94D KTzuNmi3ZRFdtirCCvXOsY4yv4pzI/t2YK/iluMBAar9LVDlPRbEHvDKQfsi69cc1ajZ VjhvirNVSPR+xzuLtoyr1TDaQi0Dk68NCgwkvwQMuTLFaJ1DVGJF16Kfn7XuZ6piMWe6 ik1FiZtrBbojxlGtYXKh09L0iBKJ3ubtb4se1pF23lYQRN8zP18jbFFbiS5LTtAKMS/d /waP7QynN2SuhdOnt/TnvpjLfaBiOv104XT6F8vEL+IjrrR5Mj3abMGxFBsMgZEB25zd Vylg== 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=xNVbpe55d79tM9HPZIL8ONzXUawfaxOna0fvaAKgXs0=; b=d91pzp9rCTUQM3ndK7w5rFNXzdcFWAU62BBquh4VWAo4ywQDo8jtMsaKRR4I1kxmOh NC0DMz3h5rpLL3UHhKral4/W8jGjXq4T8MoFwU45+MOTuFvyCAEKbgL9bkSwx5QqF0Ag b2ttNPQfEDIlT6MwJA9yl9pTArIvD75zQsjTtaVXiqaY5UwLECdljLlprZ1qWtqJW19G Az5CkZ6fMt+dZMF9gXT5UxywI8dpJsTxWSCvt2Ei3fG3YS50gJIRmY6A4OzHztERG+ie GJsZTKGVebUh7V8Mz3YoJy5jqvujz8DTKHDijD9rhsADXdMfALxHbkIgDlTN6T3DXrRJ MEbg== X-Gm-Message-State: APjAAAUq5fBFOg6jQA52l88PRVtavvflxIByumPobh0moF+UdPAHZ+vX y/O+x99VzHiVQYG8I33tjQJeyg== X-Received: by 2002:adf:a308:: with SMTP id c8mr8523626wrb.240.1576753165118; Thu, 19 Dec 2019 02:59:25 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c17sm5963609wrr.87.2019.12.19.02.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CAD911FF9E; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/25] qemu_log_lock/unlock now preserves the qemu_logfile handle. Date: Thu, 19 Dec 2019 10:49:23 +0000 Message-Id: <20191219104934.866-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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: Marek Vasut , Robert Foley , Jason Wang , Chris Wulff , Richard Henderson , qemu-devel@nongnu.org, Eduardo Habkost , Michael Walle , "Edgar E. Iglesias" , Paolo Bonzini , Guan Xuetao , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley qemu_log_lock() now returns a handle and qemu_log_unlock() receives a handle to unlock. This allows for changing the handle during logging and ensures the lock() and unlock() are for the same file. Also in target/tilegx/translate.c removed the qemu_log_lock()/unlock() calls (and the log("\n")), since the translator can longjmp out of the loop if it attempts to translate an instruction in an inaccessible page. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-5-robert.foley@linaro.org> -- 2.20.1 diff --git a/include/qemu/log.h b/include/qemu/log.h index a91105b2adc..a7c5b01571f 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -53,14 +53,17 @@ static inline bool qemu_log_separate(void) * qemu_loglevel is never set when qemu_logfile is unset. */ -static inline void qemu_log_lock(void) +static inline FILE *qemu_log_lock(void) { qemu_flockfile(qemu_logfile); + return logfile->fd; } -static inline void qemu_log_unlock(void) +static inline void qemu_log_unlock(FILE *fd) { - qemu_funlockfile(qemu_logfile); + if (fd) { + qemu_funlockfile(fd); + } } /* Logging functions: */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index c01f59c7433..62068d10c3c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -156,7 +156,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) #if defined(DEBUG_DISAS) if (qemu_loglevel_mask(CPU_LOG_TB_CPU) && qemu_log_in_addr_range(itb->pc)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); int flags = 0; if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) { flags |= CPU_DUMP_FPU; @@ -165,7 +165,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) flags |= CPU_DUMP_CCOP; #endif log_cpu_state(cpu, flags); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif /* DEBUG_DISAS */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 9f48da94721..bb325a2bc44 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1804,7 +1804,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM) && qemu_log_in_addr_range(tb->pc)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("OUT: [size=%d]\n", gen_code_size); if (tcg_ctx->data_gen_ptr) { size_t code_size = tcg_ctx->data_gen_ptr - tb->tc.ptr; @@ -1829,7 +1829,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, } qemu_log("\n"); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index f977682be79..603d17ff831 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -138,11 +138,11 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(db->pc_first)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("----------------\n"); ops->disas_log(db, cpu); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif } diff --git a/exec.c b/exec.c index a34c3481840..edafdebeecc 100644 --- a/exec.c +++ b/exec.c @@ -1225,13 +1225,13 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) fprintf(stderr, "\n"); cpu_dump_state(cpu, stderr, CPU_DUMP_FPU | CPU_DUMP_CCOP); if (qemu_log_separate()) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("qemu: fatal: "); qemu_log_vprintf(fmt, ap2); qemu_log("\n"); log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); qemu_log_close(); } va_end(ap2); diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c index 1f81341554f..39c78faf9b2 100644 --- a/hw/net/can/can_sja1000.c +++ b/hw/net/can/can_sja1000.c @@ -247,8 +247,8 @@ int can_sja_accept_filter(CanSJA1000State *s, static void can_display_msg(const char *prefix, const qemu_can_frame *msg) { int i; + FILE *logfile = qemu_log_lock(); - qemu_log_lock(); qemu_log("%s%03X [%01d] %s %s", prefix, msg->can_id & QEMU_CAN_EFF_MASK, @@ -261,7 +261,7 @@ static void can_display_msg(const char *prefix, const qemu_can_frame *msg) } qemu_log("\n"); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); } static void buff2frame_pel(const uint8_t *buff, qemu_can_frame *frame) diff --git a/net/can/can_socketcan.c b/net/can/can_socketcan.c index 8a6ffad40c8..29bfacd4f8a 100644 --- a/net/can/can_socketcan.c +++ b/net/can/can_socketcan.c @@ -76,8 +76,7 @@ QEMU_BUILD_BUG_ON(offsetof(qemu_can_frame, data) static void can_host_socketcan_display_msg(struct qemu_can_frame *msg) { int i; - - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("[cansocketcan]: %03X [%01d] %s %s", msg->can_id & QEMU_CAN_EFF_MASK, msg->can_dlc, @@ -89,7 +88,7 @@ static void can_host_socketcan_display_msg(struct qemu_can_frame *msg) } qemu_log("\n"); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); } static void can_host_socketcan_read(void *opaque) diff --git a/target/cris/translate.c b/target/cris/translate.c index e752bd06093..cb57516a445 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3273,11 +3273,11 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) #if !DISAS_CRIS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("--------------\n"); qemu_log("IN: %s\n", lookup_symbol(pc_start)); log_target_disas(cs, pc_start, dc->pc - pc_start); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif #endif diff --git a/target/i386/translate.c b/target/i386/translate.c index 77e932d8276..7c99ef13854 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2502,14 +2502,15 @@ static void gen_unknown_opcode(CPUX86State *env, DisasContext *s) gen_illegal_opcode(s); if (qemu_loglevel_mask(LOG_UNIMP)) { + FILE *logfile = qemu_log_lock(); target_ulong pc = s->pc_start, end = s->pc; - qemu_log_lock(); + qemu_log("ILLOPC: " TARGET_FMT_lx ":", pc); for (; pc < end; ++pc) { qemu_log(" %02x", cpu_ldub_code(env, pc)); } qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } } diff --git a/target/lm32/translate.c b/target/lm32/translate.c index 778cae1e817..73db9654d66 100644 --- a/target/lm32/translate.c +++ b/target/lm32/translate.c @@ -1137,10 +1137,10 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("\n"); log_target_disas(cs, pc_start, dc->pc - pc_start); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif } diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index bdc7d5326a6..525115b0413 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1765,10 +1765,10 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) #if !SIM_COMPAT if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("--------------\n"); log_target_disas(cs, pc_start, dc->pc - pc_start); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif #endif diff --git a/target/nios2/translate.c b/target/nios2/translate.c index e17656e66fb..82107bf270f 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -892,11 +892,11 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(tb->pc)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("IN: %s\n", lookup_symbol(tb->pc)); log_target_disas(cs, tb->pc, dc->pc - tb->pc); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif } diff --git a/target/tilegx/translate.c b/target/tilegx/translate.c index 68dd4aa2d8e..abce7e1c757 100644 --- a/target/tilegx/translate.c +++ b/target/tilegx/translate.c @@ -2388,7 +2388,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) dc->zero = NULL; if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) { - qemu_log_lock(); qemu_log("IN: %s\n", lookup_symbol(pc_start)); } gen_tb_start(tb); @@ -2417,11 +2416,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) gen_tb_end(tb, num_insns); tb->size = dc->pc - pc_start; tb->icount = num_insns; - - if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) { - qemu_log("\n"); - qemu_log_unlock(); - } } void restore_state_to_opc(CPUTLGState *env, TranslationBlock *tb, diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c index 0e01f35856f..0f6891b8aa3 100644 --- a/target/unicore32/translate.c +++ b/target/unicore32/translate.c @@ -1994,12 +1994,12 @@ done_generating: #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(pc_start)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("----------------\n"); qemu_log("IN: %s\n", lookup_symbol(pc_start)); log_target_disas(cs, pc_start, dc->pc - pc_start); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif tb->size = dc->pc - pc_start; diff --git a/tcg/tcg.c b/tcg/tcg.c index 5475d49ed11..0511266d85d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1085,7 +1085,7 @@ void tcg_prologue_init(TCGContext *s) #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("PROLOGUE: [size=%zu]\n", prologue_size); if (s->data_gen_ptr) { size_t code_size = s->data_gen_ptr - buf0; @@ -1110,7 +1110,7 @@ void tcg_prologue_init(TCGContext *s) } qemu_log("\n"); qemu_log_flush(); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif @@ -4041,11 +4041,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP) && qemu_log_in_addr_range(tb->pc))) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("OP:\n"); tcg_dump_ops(s, false); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif @@ -4086,11 +4086,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_IND) && qemu_log_in_addr_range(tb->pc))) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("OP before indirect lowering:\n"); tcg_dump_ops(s, false); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif /* Replace indirect temps with direct temps. */ @@ -4107,11 +4107,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) #ifdef DEBUG_DISAS if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_OPT) && qemu_log_in_addr_range(tb->pc))) { - qemu_log_lock(); + FILE *logfile = qemu_log_lock(); qemu_log("OP after optimization and liveness analysis:\n"); tcg_dump_ops(s, true); qemu_log("\n"); - qemu_log_unlock(); + qemu_log_unlock(logfile); } #endif From patchwork Thu Dec 19 10:49:24 2019 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: 182094 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp323610iln; Thu, 19 Dec 2019 03:04:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwS05ASJr1xzSH94pKk9oXpP7z2aGQAM4CgKB8BsDUF2vO6/GDjDc0v6LiWrehk8YhbLzBl X-Received: by 2002:ac8:4a97:: with SMTP id l23mr5380013qtq.231.1576753478482; Thu, 19 Dec 2019 03:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753478; cv=none; d=google.com; s=arc-20160816; b=EX+Wt/kDpKITtH72tWdfJVk9IfToqw2luvhXpkgq1guyMbTH17a9ub2mgO5a2MnMv7 aY4o2F55rXxOAJOjeNFLKBvGkkLAkaub1bcL3guz6n1wgRqQSROKAy9Ye3qqLn7o8IYK MAmO6unBfECjuzTMc5BPbx0CwyvF3pbtknFAVqcpPXNMYT9kBdl68z/puThfwP6KtV/2 l9aCRXA6BquiGOr7MeqqrijwhgVzYfwkkwH6iveG/b1+5UPuQ5RSr34WGdfZshzYgp7/ vycROSyqASzIHgFr1eD75iOE7VuKG6P3tNBQtkuHWBQFvhmep7CpkgsneTYm+n/KVpLo BFTg== 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=U1KU4Z1KzUFCaz+vloc4RAfkLAiGkUKbiKWVD5DUYbQ=; b=oejQhfLtXTBDVge8o9oAjyBrHDrU9hH6z9gba9+mFKW1FdhtgVpWk56hRxbPchO2dl SVkzbsPB5zZcCBSAFLeWDRaHDgU3k/b4VJuixRQ+pRoTq5uK/mFmqdyxGcTw/QUra/c8 GLLxNIi4jkXXUuIdiSSzRubdqhgbzBU1PV76pBO5Lk/vs8WEIDbUhUVGN/V+Uta13RjN zBt34nl51Omkcr4dQSR8fZje43kOyXyoz7XxPLfOe8VgNUMV6hikdenTBpEvy4ZXVptk 6jdMiZFe7XYmlVQn/gC27DQfZY3OvmqTQYt60sGieBL447Yplh8x3Zy3i8Lb5gLjnZ2z eOnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W0oEgvRq; 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 l14si2772726qtj.11.2019.12.19.03.04.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:04:38 -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=fail header.i=@linaro.org header.s=google header.b=W0oEgvRq; 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]:39096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtbg-0001xF-DW for patch@linaro.org; Thu, 19 Dec 2019 06:04:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41111) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNX-00070T-GF for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNV-0001BP-Kq for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:59 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:34671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNV-00015q-9o for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:57 -0500 Received: by mail-wm1-x342.google.com with SMTP id f4so6733804wmj.1 for ; Thu, 19 Dec 2019 02:49:57 -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=U1KU4Z1KzUFCaz+vloc4RAfkLAiGkUKbiKWVD5DUYbQ=; b=W0oEgvRqbu34lh3gKeR6jZzBU2a2OL4MEQPJEYdD4BgECYYJQrqGyPIw2QkkgEypJ5 +GcYAwl28oTj26LSWMuWvjhuPVvZ12E0lZgzSe37VQOGyz1s4c+4XergueKZVlZvvIsp lYEt1NwspISAfhxRjq+pAR80SF0oYmmhrXN+XzRklAYC4fqlCj6LDECZzpCQxYv32ZNZ UTviwKCTm4fMkkBcRnSKfjYVIdrbMDEJJxp14AUuIhtWYvAFQCrDTGFf1rPv55JrFEr3 XBMvs5aiNtmbbF/pAWWMs7qJc3X1Z9OHyaTUzJeQPeCivfpI8mbxnG2lWnQglD6YRN7x JO2A== 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=U1KU4Z1KzUFCaz+vloc4RAfkLAiGkUKbiKWVD5DUYbQ=; b=Vk6AP9GsefoVdFjra3ZSM5Nz0TretwaioYOWXC9+VmncXfvVWSu1vKI9x3tCAeSupj 3embhhnALAENUemO8s3EdlZYbkaLWpx3GYs+Ifr6tMvcNKgQy2foXYwGuCKU3gQNmajD gqRD2G02yKcavxF4UhsJ1w8RD1DnGUdZj/shuHb7pDcn42pIvoNc0AyVNiqhl2OBdquN 59X9Ap0tZmygFIvZraGFDFzlgFxacU49XAV1jR0y4RQpHrxudPDnNdaqflGS9KiR5mol 3iHoGUO+bpijti68RpREFhWaZL6JqQd1hHpCdYrbHYRP0F4NfSXQeH0JNumSE7SKis8A QMdQ== X-Gm-Message-State: APjAAAVsSZHbfJEaPckHeXvR0mnqQLWt6q7Ex9rCpRYrNQ0Y2MKkUU9S 92+dzp7ow+CcVm/sqVgiB92UBQ== X-Received: by 2002:a1c:62c1:: with SMTP id w184mr9535862wmb.150.1576752596010; Thu, 19 Dec 2019 02:49:56 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z6sm6093821wrw.36.2019.12.19.02.49.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:51 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E67E31FF9F; Thu, 19 Dec 2019 10:49:35 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 15/25] Add use of RCU for qemu_logfile. Date: Thu, 19 Dec 2019 10:49:24 +0000 Message-Id: <20191219104934.866-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 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: Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley This now allows changing the logfile while logging is active, and also solves the issue of a seg fault while changing the logfile. Any read access to the qemu_logfile handle will use the rcu_read_lock()/unlock() around the use of the handle. To fetch the handle we will use atomic_rcu_read(). We also in many cases do a check for validity of the logfile handle before using it to deal with the case where the file is closed and set to NULL. The cases where we write to the qemu_logfile will use atomic_rcu_set(). Writers will also use call_rcu() with a newly added qemu_logfile_free function for freeing/closing when readers have finished. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-6-robert.foley@linaro.org> -- 2.20.1 diff --git a/include/exec/log.h b/include/exec/log.h index e2cfd436e61..9bd1e4aa20b 100644 --- a/include/exec/log.h +++ b/include/exec/log.h @@ -15,8 +15,15 @@ */ static inline void log_cpu_state(CPUState *cpu, int flags) { + QemuLogFile *logfile; + if (qemu_log_enabled()) { - cpu_dump_state(cpu, qemu_logfile, flags); + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + cpu_dump_state(cpu, logfile->fd, flags); + } + rcu_read_unlock(); } } @@ -40,19 +47,37 @@ static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags) static inline void log_target_disas(CPUState *cpu, target_ulong start, target_ulong len) { - target_disas(qemu_logfile, cpu, start, len); + QemuLogFile *logfile; + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + target_disas(logfile->fd, cpu, start, len); + } + rcu_read_unlock(); } static inline void log_disas(void *code, unsigned long size) { - disas(qemu_logfile, code, size); + QemuLogFile *logfile; + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + disas(logfile->fd, code, size); + } + rcu_read_unlock(); } #if defined(CONFIG_USER_ONLY) /* page_dump() output to the log file: */ static inline void log_page_dump(void) { - page_dump(qemu_logfile); + QemuLogFile *logfile; + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + page_dump(logfile->fd); + } + rcu_read_unlock(); } #endif #endif diff --git a/include/qemu/log.h b/include/qemu/log.h index a7c5b01571f..e0f4e406283 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -3,9 +3,16 @@ /* A small part of this API is split into its own header */ #include "qemu/log-for-trace.h" +#include "qemu/rcu.h" + +typedef struct QemuLogFile { + struct rcu_head rcu; + FILE *fd; +} QemuLogFile; /* Private global variable, don't use */ -extern FILE *qemu_logfile; +extern QemuLogFile *qemu_logfile; + /* * The new API: @@ -25,7 +32,16 @@ static inline bool qemu_log_enabled(void) */ static inline bool qemu_log_separate(void) { - return qemu_logfile != NULL && qemu_logfile != stderr; + QemuLogFile *logfile; + bool res = false; + + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile && logfile->fd != stderr) { + res = true; + } + rcu_read_unlock(); + return res; } #define CPU_LOG_TB_OUT_ASM (1 << 0) @@ -55,8 +71,15 @@ static inline bool qemu_log_separate(void) static inline FILE *qemu_log_lock(void) { - qemu_flockfile(qemu_logfile); - return logfile->fd; + QemuLogFile *logfile; + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + qemu_flockfile(logfile->fd); + return logfile->fd; + } else { + return NULL; + } } static inline void qemu_log_unlock(FILE *fd) @@ -64,6 +87,7 @@ static inline void qemu_log_unlock(FILE *fd) if (fd) { qemu_funlockfile(fd); } + rcu_read_unlock(); } /* Logging functions: */ @@ -73,9 +97,14 @@ static inline void qemu_log_unlock(FILE *fd) static inline void GCC_FMT_ATTR(1, 0) qemu_log_vprintf(const char *fmt, va_list va) { - if (qemu_logfile) { - vfprintf(qemu_logfile, fmt, va); + QemuLogFile *logfile; + + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + vfprintf(logfile->fd, fmt, va); } + rcu_read_unlock(); } /* log only if a bit is set on the current loglevel mask: diff --git a/tcg/tcg.c b/tcg/tcg.c index 0511266d85d..4f616ba38bf 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2114,9 +2114,17 @@ static void tcg_dump_ops(TCGContext *s, bool have_prefs) } if (have_prefs || op->life) { - for (; col < 40; ++col) { - putc(' ', qemu_logfile); + + QemuLogFile *logfile; + + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + for (; col < 40; ++col) { + putc(' ', logfile->fd); + } } + rcu_read_unlock(); } if (op->life) { diff --git a/util/log.c b/util/log.c index 953a66b5a8d..867264da8d0 100644 --- a/util/log.c +++ b/util/log.c @@ -28,7 +28,7 @@ static char *logfilename; static QemuMutex qemu_logfile_mutex; -FILE *qemu_logfile; +QemuLogFile *qemu_logfile; int qemu_loglevel; static int log_append = 0; static GArray *debug_regions; @@ -37,10 +37,14 @@ static GArray *debug_regions; int qemu_log(const char *fmt, ...) { int ret = 0; - if (qemu_logfile) { + QemuLogFile *logfile; + + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { va_list ap; va_start(ap, fmt); - ret = vfprintf(qemu_logfile, fmt, ap); + ret = vfprintf(logfile->fd, fmt, ap); va_end(ap); /* Don't pass back error results. */ @@ -48,6 +52,7 @@ int qemu_log(const char *fmt, ...) ret = 0; } } + rcu_read_unlock(); return ret; } @@ -56,12 +61,24 @@ static void __attribute__((__constructor__)) qemu_logfile_init(void) qemu_mutex_init(&qemu_logfile_mutex); } +static void qemu_logfile_free(QemuLogFile *logfile) +{ + g_assert(logfile); + + if (logfile->fd != stderr) { + fclose(logfile->fd); + } + g_free(logfile); +} + static bool log_uses_own_buffers; /* enable or disable low levels log */ void qemu_set_log(int log_flags) { bool need_to_open_file = false; + QemuLogFile *logfile; + qemu_loglevel = log_flags; #ifdef CONFIG_TRACE_LOG qemu_loglevel |= LOG_TRACE; @@ -79,43 +96,47 @@ void qemu_set_log(int log_flags) } qemu_mutex_lock(&qemu_logfile_mutex); if (qemu_logfile && !need_to_open_file) { - qemu_mutex_unlock(&qemu_logfile_mutex); - qemu_log_close(); + logfile = qemu_logfile; + atomic_rcu_set(&qemu_logfile, NULL); + call_rcu(logfile, qemu_logfile_free, rcu); } else if (!qemu_logfile && need_to_open_file) { + logfile = g_new0(QemuLogFile, 1); if (logfilename) { - qemu_logfile = fopen(logfilename, log_append ? "a" : "w"); - if (!qemu_logfile) { + logfile->fd = fopen(logfilename, log_append ? "a" : "w"); + if (!logfile->fd) { + g_free(logfile); perror(logfilename); _exit(1); } /* In case we are a daemon redirect stderr to logfile */ if (is_daemonized()) { - dup2(fileno(qemu_logfile), STDERR_FILENO); - fclose(qemu_logfile); + dup2(fileno(logfile->fd), STDERR_FILENO); + fclose(logfile->fd); /* This will skip closing logfile in qemu_log_close() */ - qemu_logfile = stderr; + logfile->fd = stderr; } } else { /* Default to stderr if no log file specified */ assert(!is_daemonized()); - qemu_logfile = stderr; + logfile->fd = stderr; } /* must avoid mmap() usage of glibc by setting a buffer "by hand" */ if (log_uses_own_buffers) { static char logfile_buf[4096]; - setvbuf(qemu_logfile, logfile_buf, _IOLBF, sizeof(logfile_buf)); + setvbuf(logfile->fd, logfile_buf, _IOLBF, sizeof(logfile_buf)); } else { #if defined(_WIN32) /* Win32 doesn't support line-buffering, so use unbuffered output. */ - setvbuf(qemu_logfile, NULL, _IONBF, 0); + setvbuf(logfile->fd, NULL, _IONBF, 0); #else - setvbuf(qemu_logfile, NULL, _IOLBF, 0); + setvbuf(logfile->fd, NULL, _IOLBF, 0); #endif log_append = 1; } - qemu_mutex_unlock(&qemu_logfile_mutex); + atomic_rcu_set(&qemu_logfile, logfile); } + qemu_mutex_unlock(&qemu_logfile_mutex); } void qemu_log_needs_buffers(void) @@ -244,18 +265,27 @@ out: /* fflush() the log file */ void qemu_log_flush(void) { - fflush(qemu_logfile); + QemuLogFile *logfile; + + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + if (logfile) { + fflush(logfile->fd); + } + rcu_read_unlock(); } /* Close the log file */ void qemu_log_close(void) { + QemuLogFile *logfile; + qemu_mutex_lock(&qemu_logfile_mutex); - if (qemu_logfile) { - if (qemu_logfile != stderr) { - fclose(qemu_logfile); - } - qemu_logfile = NULL; + logfile = qemu_logfile; + + if (logfile) { + atomic_rcu_set(&qemu_logfile, NULL); + call_rcu(logfile, qemu_logfile_free, rcu); } qemu_mutex_unlock(&qemu_logfile_mutex); } From patchwork Thu Dec 19 10:49:25 2019 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: 182097 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp327062iln; Thu, 19 Dec 2019 03:07:28 -0800 (PST) X-Google-Smtp-Source: APXvYqx+SBIkpGVf3CGwGvLFPXG6pp5I91dmI/7STREbSRanMemx4MXs3HDrgyHtGPkQije6WtDZ X-Received: by 2002:ac8:3467:: with SMTP id v36mr6348225qtb.255.1576753648447; Thu, 19 Dec 2019 03:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753648; cv=none; d=google.com; s=arc-20160816; b=cCHASiE3Lp+H+HqXZF3RXJj70qXxZNDXXC8f7RcGaHQjyP44UwWut1juMbOoXF/9qP ajiWr+gIuHL1z59OtCYjqHeFhSGT9iRL2X0VS8oC0r0illVl36N1dwgZKlkqka/rxpc/ ENP+7Mh2fF3TTk6vuLpAipRq4JtSJ77nzJMXZ2oHzy2cFmOzUMVPk+ysECyrgjE6MuuD e/s3rUVGHIzgEGv9eKjy2RxrJSpmAXvNUeH0mCwcqHWM9D3oxVFqNJARJwyHywcHlQOO BSsF8r+N3YqFpgLOqy0BNR5ZTHkvNSLC8aNtUHNjS/X2qE+Lzro3nnM8hhhlEaEoyj+7 lMeQ== 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=G90giGYO7nxhno/z+r32FbzYuyDm/iXKiuSb+w5/6TE=; b=ov2uHNjchnZAC8BCThYsXtj0mk1RHT5hLg9IiBIbIzBsMkSdDaf2e+6leJFD5zpmhA skW5rLf40v6aR9GUZAKV9kCLrCTOMaEieE5nmMlyUJMw6uCM/4HgExQVmU8c8rSlASS+ VFzn2zB6sRddcYDw4/MeOeSTaTEGKwfRiZ98SgSFQ3VL5MyTTDLtd/kbiMrWiVAxcoGp JjlzV2i7aspsED5di9Dc1ghCUrpCCnq6YHNDB6Nyyi0lK2+g55D3GE1sg4gx3PYYG7mD pvQI24ANi7LghS1u0IQk6ZZtsxtmnn65nPfK/3nqKeF9mDWWdQNQzslFRd+xC5ypi4NN g0sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ult61Fm2; 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 v7si3233126qka.328.2019.12.19.03.07.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:07:28 -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=fail header.i=@linaro.org header.s=google header.b=Ult61Fm2; 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]:39172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihteR-0006EN-KO for patch@linaro.org; Thu, 19 Dec 2019 06:07:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56983) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWd-0003oB-6a for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWb-0000tP-AS for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:22 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:33213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWb-0000nx-0z for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:21 -0500 Received: by mail-wm1-x32e.google.com with SMTP id d139so6769579wmd.0 for ; Thu, 19 Dec 2019 02:59:20 -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=G90giGYO7nxhno/z+r32FbzYuyDm/iXKiuSb+w5/6TE=; b=Ult61Fm21X6ymHJREtKIA8UBETAmW2Icw7I366D2pGafyp1LJxA/R0HwNdoVb11Bb5 zP4tECh/PmgT+hTPCbBsELje9aUI8Z+ul4SztgJ7o7Vb866u9oYhBZ4VmzlwIiWhdQtR P5PuBTNIyIYl/+bxUOwilqMGVSD9VGSanjhFxZoQlYaJMGSv/NXHaZsf0c29wZKUEPSl /mu5xZ/j135Ktw/2uH3Oxj0Jki+jyEt7HTvHbSZJKTXMnc3qXebniGE/VCFg9IqTnlov 2TdoxvfCI4CayAOMoeTK5EjTPhxnkmNMEIo5uwdQtpqLvgU0Yo+FM9NJZZH90agUjCS3 cQLQ== 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=G90giGYO7nxhno/z+r32FbzYuyDm/iXKiuSb+w5/6TE=; b=WIjWJT9YgqqaCjopCTGYPXTK0MPFajcpQhdxc2oT8qPiWXCK6Ij2nesa2IPUrbdsV3 6mm0kfbzxND9LhABZA4Ur43IhDZVqmaPYEEtmYqvzZUXRCwoF0hFutCLJ+AJqwcoImfl sd9So5cSLS3WGPZzYI86YepmpUgKN+33neJ5BuH3o9U0HArRWqF09bKhn2im7rk2tA+U oAwyqHog+2e98mofChVp/5LB3Mgh2XydS4z+6vfTRoOZsZyjEc7cPwUPa+XsbxUG72eh c9p9cs+uyPIOXwCJUSGRnYiJ/xo6oGl7OhTvhgEqX5KCnTYV+VbRmOrfdn50lkCwnd9B W9Yw== X-Gm-Message-State: APjAAAVCXzHfuUCes/nLQHZSP1nETZJ9OJK5OqBKkZwKCudSQPiBX1ts 7UF4AvejxB4B593GaEJHwjSZDQ== X-Received: by 2002:a05:600c:248:: with SMTP id 8mr9583046wmj.175.1576753159844; Thu, 19 Dec 2019 02:59:19 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g7sm6091077wrq.21.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:16 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0725F1FFA3; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 16/25] Added tests for close and change of logfile. Date: Thu, 19 Dec 2019 10:49:25 +0000 Message-Id: <20191219104934.866-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Robert Foley Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley One test ensures that the logfile handle is still valid even if the logfile is changed during logging. The other test validates that the logfile handle remains valid under the logfile lock even if the logfile is closed. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-7-robert.foley@linaro.org> -- 2.20.1 diff --git a/tests/test-logging.c b/tests/test-logging.c index a12585f70af..1e646f045dc 100644 --- a/tests/test-logging.c +++ b/tests/test-logging.c @@ -108,6 +108,82 @@ static void test_parse_path(gconstpointer data) error_free_or_abort(&err); } +static void test_logfile_write(gconstpointer data) +{ + QemuLogFile *logfile; + QemuLogFile *logfile2; + gchar const *dir = data; + Error *err = NULL; + g_autofree gchar *file_path; + g_autofree gchar *file_path1; + FILE *orig_fd; + + /* + * Before starting test, set log flags, to ensure the file gets + * opened below with the call to qemu_set_log_filename(). + * In cases where a logging backend other than log is used, + * this is needed. + */ + qemu_set_log(CPU_LOG_TB_OUT_ASM); + file_path = g_build_filename(dir, "qemu_test_log_write0.log", NULL); + file_path1 = g_build_filename(dir, "qemu_test_log_write1.log", NULL); + + /* + * Test that even if an open file handle is changed, + * our handle remains valid due to RCU. + */ + qemu_set_log_filename(file_path, &err); + g_assert(!err); + rcu_read_lock(); + logfile = atomic_rcu_read(&qemu_logfile); + orig_fd = logfile->fd; + g_assert(logfile && logfile->fd); + fprintf(logfile->fd, "%s 1st write to file\n", __func__); + fflush(logfile->fd); + + /* Change the logfile and ensure that the handle is still valid. */ + qemu_set_log_filename(file_path1, &err); + g_assert(!err); + logfile2 = atomic_rcu_read(&qemu_logfile); + g_assert(logfile->fd == orig_fd); + g_assert(logfile2->fd != logfile->fd); + fprintf(logfile->fd, "%s 2nd write to file\n", __func__); + fflush(logfile->fd); + rcu_read_unlock(); +} + +static void test_logfile_lock(gconstpointer data) +{ + FILE *logfile; + gchar const *dir = data; + Error *err = NULL; + g_autofree gchar *file_path; + + file_path = g_build_filename(dir, "qemu_test_logfile_lock0.log", NULL); + + /* + * Test the use of the logfile lock, such + * that even if an open file handle is closed, + * our handle remains valid for use due to RCU. + */ + qemu_set_log_filename(file_path, &err); + logfile = qemu_log_lock(); + g_assert(logfile); + fprintf(logfile, "%s 1st write to file\n", __func__); + fflush(logfile); + + /* + * Initiate a close file and make sure our handle remains + * valid since we still have the logfile lock. + */ + qemu_log_close(); + fprintf(logfile, "%s 2nd write to file\n", __func__); + fflush(logfile); + qemu_log_unlock(logfile); + + g_assert(!err); +} + /* Remove a directory and all its entries (non-recursive). */ static void rmdir_full(gchar const *root) { @@ -134,6 +210,10 @@ int main(int argc, char **argv) g_test_add_func("/logging/parse_range", test_parse_range); g_test_add_data_func("/logging/parse_path", tmp_path, test_parse_path); + g_test_add_data_func("/logging/logfile_write_path", + tmp_path, test_logfile_write); + g_test_add_data_func("/logging/logfile_lock_path", + tmp_path, test_logfile_lock); rc = g_test_run(); From patchwork Thu Dec 19 10:49:26 2019 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: 182093 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp321046iln; Thu, 19 Dec 2019 03:02:45 -0800 (PST) X-Google-Smtp-Source: APXvYqwBfJ/mtGDyZXpOUqd+JY94G2dBDXpDfQo2x0VH4BYxCKcHORif0jWr1pAZ4SbUqStJJ4+P X-Received: by 2002:aca:90a:: with SMTP id 10mr1908432oij.81.1576753365651; Thu, 19 Dec 2019 03:02:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753365; cv=none; d=google.com; s=arc-20160816; b=ne4K1bHGh0wr84yooubh5mwQFM5/zn/6uPOjjRqBWkIY6z9ZsY3HOjRXfgMi8ItYC4 ncwAYAMqgvfoTtf/vbuhlFkBRQ/OnRSWWPSt6HukSBFs4AOhEkXsnyseCrLXteHOAtmo IreyFaS1XfVxai3UKXm6V3pfwnYefBBPG/hgAuujfHBwL9vjTmG4eHSQ1FIATIcX369v T2hSqjH8CuLubqWBiutjLD7gdQVuvzwmCRdJxHG8JXcaDAy1RNVOowzcPbgH7mCKZ1kp lAxJowsZ3SzecmiX7ddZpFx6LdIE7HrQqKb1KhOgE8+R7nhCUGIlpiylcWLPpMrX/CAd 5BKw== 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=19SBTiRGWbT4vIjJk9Btd3tdZPysUx36M7Ps9JJHnt4=; b=WCXd9pee+D+tZMhXGQTHJa2DjFuGrIyOqbLgf0Oi/wVZPpW4HFDvxt0XW+gLFpumKQ rSFyRZr5K0+AdAghmAK/+hY6riY2sJ989B6FS3mkzNya0Mcr2N11iF8rMbtFeIxUSU9X RKGwGjudetvLVMAgkTjvreJAYluMLf1nZ6tuTgtMxUHsuidMGLib9A6I8XaWamK/BnYZ SHSp0IhZIJ8Ra/AXju8naVbC23p1k44ITFMtmGEYXN2dbRQqt5e5Ag/MQFU34rkC2chZ jZDhN27Tp3k4bPGye6TOdvUT5MyOpueuH28R+av99tF982ufamQTDFhBCTZowirDJg8b 90eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ip/iydWf"; 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 d4si2674434oig.155.2019.12.19.03.02.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:02: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=fail header.i=@linaro.org header.s=google header.b="ip/iydWf"; 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]:39060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtZt-0008FJ-0Q for patch@linaro.org; Thu, 19 Dec 2019 06:02:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56603) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWa-0003io-Ao for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWZ-0000gz-1f for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:20 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:40350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWY-0000a6-Ny for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:18 -0500 Received: by mail-wm1-x32c.google.com with SMTP id t14so5122389wmi.5 for ; Thu, 19 Dec 2019 02:59:18 -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=19SBTiRGWbT4vIjJk9Btd3tdZPysUx36M7Ps9JJHnt4=; b=ip/iydWfZAwQtCTh9V5ZyVbRlA6tbMomQDS9Qrd388MqjwC0pa1PDBE9N3U//ZpMNY Zmwpa/wmaeGDVbbKCklHDUVrR98T3pXDSxVIaLIVBanCzrwZMwJToMBtPnIXGFbqMXqH PmeEUN17iadP49iYyXJlwmvCJS1dhvZE6+GuidpgJ1D7+/CBXzKmr+2XjWJop8higKN8 XPBVUdMgk5mi9mtzHji7uDFvK6DaY8p+d2aABuNcU5ejM9dkKKsJd68B9m1MZ1rP4UCL EA7nf5ymgqtWD4qzdPpTuXa6XqOiKbpYomRhvciDUqA6OqxiSXKzgeOq4A4oVTe0BEJp 4YHQ== 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=19SBTiRGWbT4vIjJk9Btd3tdZPysUx36M7Ps9JJHnt4=; b=oaoHwGjhUzov0pT6C8RP6e/Up6KQzOwFd6w7+WO1Feer9USXamFCUN9DXp6S0kSkOR bgWEimnnV0HrmhiGtr8wD9ANtkXZ/eEdmJFe98boBjKfP2AEVqShLJDLVgjd/qpuL3gh Wn/WbB3JHR8Q4ENhvwcaiwSvYITUoxNiGbeP4ZF2PZ3p+5zJkCXxj+/eSpvLxAv+3pon /OmcNEJ97FMU7gVgVGRkF6ZGaEhWDSFdkEskWZhZ95/+WVBfJmNZYE7+aMZIXmV93lCw /VF03OpALSyI/6U1pC41MysoyPDBT4hGxTOeyb4remdC7eFOwkv6WIsClEEfYrtqb3s2 +yCw== X-Gm-Message-State: APjAAAVRjN3oa8gF0kSyFfKlKiAIyLMqAfZI1mEF/vjAlqw60141pPH6 013FzSVcnqQOPqJ8X8KPjFzJNA== X-Received: by 2002:a05:600c:20f:: with SMTP id 15mr9373206wmi.128.1576753157565; Thu, 19 Dec 2019 02:59:17 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v8sm6121247wrw.2.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1C85A1FFA5; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 17/25] docker: gtester is no longer used Date: Thu, 19 Dec 2019 10:49:26 +0000 Message-Id: <20191219104934.866-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c 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: Fam Zheng , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini We are using tap-driver.pl, do not require anymore gtester to be installed to run the testsuite in docker-based tests. Signed-off-by: Paolo Bonzini Reviewed-by: Thomas Huth Signed-off-by: Alex Bennée Message-Id: <1576632611-55032-1-git-send-email-pbonzini@redhat.com> -- 2.20.1 diff --git a/tests/docker/common.rc b/tests/docker/common.rc index 512202b0a19..02cd67a8c5e 100755 --- a/tests/docker/common.rc +++ b/tests/docker/common.rc @@ -53,12 +53,7 @@ check_qemu() INVOCATION="$@" fi - if command -v gtester > /dev/null 2>&1 && \ - gtester --version > /dev/null 2>&1; then - make $MAKEFLAGS $INVOCATION - else - echo "No working gtester, skipping make $INVOCATION" - fi + make $MAKEFLAGS $INVOCATION } test_fail() From patchwork Thu Dec 19 10:49:27 2019 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: 182091 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp319850iln; Thu, 19 Dec 2019 03:01:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzoqw0Z1U5McGhVhjNtam7cR6c9XcEpZ1lViR3c3a29Yi0MKMtD9NApfvIMsuAtrfH9UFIF X-Received: by 2002:a9d:7b50:: with SMTP id f16mr8442327oto.18.1576753311320; Thu, 19 Dec 2019 03:01:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753311; cv=none; d=google.com; s=arc-20160816; b=aluy/4fHPQ0zexjJ5DuZJjh6sxoPaz9+35oKwKRWAGKtLe3guiY5FIa+LzdgKLPVK/ IMe7fIuV9JOztVScgPvRcRpgvnR4nEXXNnFyiTMk3nH44IeCEK76ws89IIb3SrZtfCyE qqIo5kHoGGrCSYf9WE2XYjP7AMpQa5nyQrCbBkn35lc+B/2JpsqbfQufN+vQcoHDU32C EcowL16ddQ11Z0vWEyMxdzSyNfIwXPfhfNAmzkFI4J8ae7WeExvxSq0Kn97hTT87flWU UpVQf7pB0pIx0bd6MzogMkORX7Fco4wg/GSGvTv/VY8DG5iM38mvQnVfzy818N1pSXh+ PP2w== 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=in0oC21NDNK40en2dSlsiyVxI60+V0LERywCr1z/Gwc=; b=rjfjmavkpS/W5QJMJ0P4r9crM1OUOSQejsKmzEyYI7n3fErFYwSMJk5jSFOShxkD1X 0qmuM0i56byb7t9UV84EFzkRKmZtpJSFQrKD/qcHOvEXSV0pzfDBeP9tU8zS5UyGfd8s B6VRDOfk3VKhx40mSChiJBlW15T7VFs3Bi4pjzmeHwpTfO9McXqiId5/rAZVtKtZ8fqb Q6YguHIVbZbBjuxhfFFQGKTDbmmFt5db9FRhhCZAvh1emPjIzPPS7FW/yB8yM/Qbqdfa wm+45oOT8dwwBw4fWFi/Vic98clXwsoO3cU/yVydFVKJyJf9ORwQOIx5uN1vECfSHJb7 JCDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sVau0Z5V; 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 l19si2822423oii.54.2019.12.19.03.01.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:01:51 -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=fail header.i=@linaro.org header.s=google header.b=sVau0Z5V; 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]:39018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtZ0-0006XU-6m for patch@linaro.org; Thu, 19 Dec 2019 06:01:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40781) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNV-0006xW-O1 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNU-00014M-AH for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:57 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNT-0000zS-VD for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:56 -0500 Received: by mail-wr1-x42f.google.com with SMTP id t2so5504069wrr.1 for ; Thu, 19 Dec 2019 02:49:55 -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=in0oC21NDNK40en2dSlsiyVxI60+V0LERywCr1z/Gwc=; b=sVau0Z5Vq5xOq0XZV132kxd5OtLfww/BWQu8tUX8W1ifnPZqtyPwufyfGDqFxJdmCq sGo5VKxoFypJcCLAm6Rw+/RP+4VAq9VfS9VsbBQHbrSlXji32xra9WbBAwR/KjJWNWgL ABDpJnaLmChU2u0SmMSybzzF6miwLgvLc5jK/w9O3lN27zEgMPUJ/npxDKCRGkLKS9da 9f1kUAmlvSMhmhaCxB2SglHBLlSyio5U/AqyWWLkoiZeHjtgy6sCs1Pg+1N3eJI5CKZ3 8rvdNhRTP64jfLPXX1gp8EiTQ39uBI44iSckVDxjvgnSiLZLnndt1hQZCN2KA3RMz2Y8 U7CQ== 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=in0oC21NDNK40en2dSlsiyVxI60+V0LERywCr1z/Gwc=; b=aI5YVCm+cGxwKdfbvRNw043IfKb/Txc5YTgGFiP67LIaZfRk30w/pFf5+K1kJHu8pF Wu4ZF3lPUr+Oof6IS6R+22d9/vJ9MF8p9JUoMuaGRI9Wih4C+GJONW7FVZ96HvUsbITq zZC4QasfRnViHumSqoeFdG+2/hOVGqOiFnGLsUFcqIRqJKaRnWQA76YGeN+CjoPtHwDm hSmLtTVElYMvHgQNr24kmFnVrJF+upz63Zb4IRJLu7L3zrc/J+9Jc0rBROSPky+ujKp1 2JAL47k8cohpFFM7aGm2+Ysv0aEPJggNByg39OP8w7gNbptnq7u1FgRXEz5ReE4mbub8 tmWQ== X-Gm-Message-State: APjAAAVjQreYQCIj9bV100htrVPTQwa5v1KrZNC/iWXSBHbIzjxVlknH 1aJ9OfiZLXDYtxwQ0FKm4CdAew== X-Received: by 2002:adf:dfc1:: with SMTP id q1mr8601969wrn.155.1576752594921; Thu, 19 Dec 2019 02:49:54 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j12sm6375968wrw.54.2019.12.19.02.49.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:51 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3095D1FFA6; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 18/25] travis.yml: Remove the redundant clang-with-MAIN_SOFTMMU_TARGETS entry Date: Thu, 19 Dec 2019 10:49:27 +0000 Message-Id: <20191219104934.866-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f 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: Fam Zheng , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth We test clang with the MAIN_SOFTMMU_TARGETS twice, once without sanitizers and once with sanitizers enabled. That's somewhat redundant since if compilation and tests succeeded with sanitizers enabled, it should also work fine without sanitizers. Thus remove the clang entry without sanitizers to speed up the CI testing a little bit. Signed-off-by: Thomas Huth Reviewed-by: Wainer dos Santos Moschetta Signed-off-by: Alex Bennée Message-Id: <20191119092147.4260-1-thuth@redhat.com> -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index d673ee219e7..376b7d6dfa8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -180,12 +180,6 @@ matrix: compiler: clang - - env: - - CONFIG="--disable-user --target-list=${MAIN_SOFTMMU_TARGETS}" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default" - compiler: clang - - - env: - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} " - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize" From patchwork Thu Dec 19 10:49:28 2019 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: 182092 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp320362iln; Thu, 19 Dec 2019 03:02:15 -0800 (PST) X-Google-Smtp-Source: APXvYqze7FPds8sdPRweiYlWm91js9iR5WMwAl7aCkkw+FILFu/t2rG65qXg1Cr2oo9fGIsbMR6a X-Received: by 2002:a9d:62c2:: with SMTP id z2mr3611184otk.309.1576753335923; Thu, 19 Dec 2019 03:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753335; cv=none; d=google.com; s=arc-20160816; b=gB0akZfTPuBV0frPeYIDyPyPKsCvEI4c3weHatIFb5TKaIgTL4B6C/ztaBcAYjGDcl klVgSdoAcgeZmI4GRJQJLCSKSjEy8USlHWtboaP7hmS/2bMtYeGw9joG2A0xkpBImR1P bd/Y8pw42XA5awscb/UK/5G61KBrIgvyOutzNgnTG++9gHei7PodhEHKQN/vI7cTPCR5 lPnWzAo7+hJ/Pi/fu+kNvdoGa1OjvbDxQ+5jLIDqimBJBjM/zR/jqLXqcD8Gdmi2BU+X wQ/J1J0VeCvokVnz/4a7clS5i8JCvdMl4GUnL+nCzrvpk34YA8+6UUQPfNauCp8F7U4A Y+HA== 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=KM2z5lJatvSo38TN3JEp2tBoGC1lMW5rj5gagTwUU00=; b=fcc5xTu8kLTEIv5jCYE90fsgpUGcH+U3e/+t2JJIYzSGFAnoW5YJt/5/Iga8VRvQC6 4l2QMrilqjbwrh2vEsLZJpVxW7LyGHowlcz/m5uRuUds8on2FoVGqH/9cMGZGjZv4xxQ k7M+fC6kjbeFlZgWos+AVPzhbGgrztWk4RuZVCzCMBHwDTO3rsWFHYIrjBKMkxVXxHJ9 IShp9blJIv/TYDx1+KGxPr7j1iYCAJIyZutsPJHnQroO4ef+zZo5J8e4LNK/HkkslUNb bIC4mz4zCnia5rdUNOok0M1NaMmChuG+p2LCqDccPktJYg3FWrwuTnnXkbUmY+CKFtP3 SmKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZnEnwskn; 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 w9si3240408otl.138.2019.12.19.03.02.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:02:15 -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=fail header.i=@linaro.org header.s=google header.b=ZnEnwskn; 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]:39044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtZP-00070R-8t for patch@linaro.org; Thu, 19 Dec 2019 06:02:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56776) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWb-0003lR-M1 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWa-0000nH-81 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:21 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:36783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWZ-0000iG-Vn for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:20 -0500 Received: by mail-wm1-x332.google.com with SMTP id p17so5154272wma.1 for ; Thu, 19 Dec 2019 02:59: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=KM2z5lJatvSo38TN3JEp2tBoGC1lMW5rj5gagTwUU00=; b=ZnEnwskn0ws31+evRZJXKY5mZ+iCjYMuIC0PeZtrjOoUapF2ygtXdzTuGgLhYuK/q2 Q1TlPaTKrcKAvIOP+1T2ch+lmZv/IQ8DNkrFgSdpJdoox9XzdzWgvv4X1iLiDj2doQ3S lXUS8q3HqT1dIUxRVw1xEcA3tzJJLvzCRPrrziRxg7cdWJfoWymJYKmBbcn2UnZ2i27c dnm+A9DKaF4MmZOEYw9yHg9fcxgG+48qtPYsGkehYrnOmefbAk3oNwpUXXUrnIbFyFDj NfUw0Eaqe+vQKALBBGzZXfUsNCp19Kz4uyFztRvp9BwnW8mi+OttvSmTpYqQmdFGSpHT uyZw== 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=KM2z5lJatvSo38TN3JEp2tBoGC1lMW5rj5gagTwUU00=; b=GmS7mUeY3yFw4LtOLfrGkBKjZbFxbwjAdR3Xn4PUYok9/oauG/uFCX1MpqI7nRpcm7 7PlGfIxlOhhItnb2bVhcp+O2tEnZAKHfuQFkUIEY0WlfTNiOvCcA2xPPx4YLeuuH8uew B7WgV/cFJGbn4ZyMgSwCRuj6Et+7r0s9l5RkvtXstFU+DPIEHUvS1NWn+WDB+rWv6wwZ zpJPwMB9qAB6Sigz1H9xhYTNUIU6pYb7jUrw8frKQDj8XTrhsYzHr4nw3qL22obLhsU0 ekdPugOnKaVYDNT7yifztrZZWQRtPX/8VvPOn1uMQwPUNG2fQdH0V8dJS6TpnaAW7rSa HS/A== X-Gm-Message-State: APjAAAXzGvwIGHDmMkSHqJgB3Gf9YOL6TwtAYjxh37HwUVD8t6yFFF2i K9uzdQE0CVEBegCH+cE2jXGS1g== X-Received: by 2002:a1c:2187:: with SMTP id h129mr3304548wmh.44.1576753158797; Thu, 19 Dec 2019 02:59:18 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g7sm6091078wrq.21.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 45D501FFA9; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 19/25] linux-user: convert target_mprotect debug to tracepoint Date: Thu, 19 Dec 2019 10:49:28 +0000 Message-Id: <20191219104934.866-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It is a pain to re-compile when you need to debug and tracepoints are a fairly low impact way to instrument QEMU. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 46a6e3a761a..26a83e74069 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -17,7 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" - +#include "trace.h" #include "qemu.h" //#define DEBUG_MMAP @@ -66,13 +66,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) abi_ulong end, host_start, host_end, addr; int prot1, ret; -#ifdef DEBUG_MMAP - printf("mprotect: start=0x" TARGET_ABI_FMT_lx - "len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c\n", start, len, - prot & PROT_READ ? 'r' : '-', - prot & PROT_WRITE ? 'w' : '-', - prot & PROT_EXEC ? 'x' : '-'); -#endif + trace_target_mprotect(start, len, prot); if ((start & ~TARGET_PAGE_MASK) != 0) return -TARGET_EINVAL; diff --git a/linux-user/trace-events b/linux-user/trace-events index 6df234bbb67..8419243de4e 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -11,3 +11,6 @@ user_handle_signal(void *env, int target_sig) "env=%p signal %d" user_host_signal(void *env, int host_sig, int target_sig) "env=%p signal %d (target %d(" user_queue_signal(void *env, int target_sig) "env=%p signal %d" user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_addr) "env=%p frame psw.addr 0x%"PRIx64 " current psw.addr 0x%"PRIx64 + +# mmap.c +target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x" From patchwork Thu Dec 19 10:49:29 2019 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: 182090 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp317529iln; Thu, 19 Dec 2019 02:59:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwc1+WphwBfJ0ZK4TqApdqHXwfYLmSPfl7rrRqAGdZ/dbSBtErj+6KnLSMoKNUvwDQXgJgg X-Received: by 2002:a05:6214:982:: with SMTP id dt2mr6656340qvb.174.1576753190936; Thu, 19 Dec 2019 02:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753190; cv=none; d=google.com; s=arc-20160816; b=d06IMBM8yF2OHK53uEqCochuVOTgbJcZqvn313YdK0ZTu0zC1TD/TztdegZO4T7QzY x49sHF+A69v/SREboptxGtPl4XB3CetYAVXOiSj2Zjcvtv50PywJqiaHEnXaqagUxOce DLMMVkzpZ9AQlPQ9NkFLHPoEyeor3KkL2aelEqjz8bfiO1MgToHJzEJvXxlRHBZvizb5 uMDUW5L9BgGbqum/UzJdX7e47OIEfQ/jMEKKURNrtRTINMAlowQ9s2h4YckS/82xK8iX ZaGbVkYmUqL+Nz5RTqGunCVWdnJJe184VrMHzIpgeyAlfPX/2fQD483IPppdtg3huOYC dyow== 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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=YvdG5I/MSo20lPj2hrdO2mHCteWTUNyUfGcyAllF/Jw4VR/80JNRvAzx+29e5YHhhQ DuhA2g1k4hZTPr+jYM1NZAoVUDCjoEYVqcGZJd1k886pjd/5MQAO94WoRQZCGQVu1kRU yfZ8H9cNv2PVb+dQdG7fxKiQe/G3mCEY7JnYb6+TD+u4r4OMSWc/XuiSHPFz/dCp/mPK G0l+Qwme+uJBhX7OHJqtxlgTk2G3SfwbFba7kZ1lz+GcVpxps35AHbM9xHlGlIHqAFvl IBffhS5VctcVUi16Myw5bLfWIpbMVQOud16qBl768ksKG0cJLAz6gFkiq8odF0hdBslj vmTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Af9MJSlw; 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 p6si2867204qtq.354.2019.12.19.02.59.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:59:50 -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=fail header.i=@linaro.org header.s=google header.b=Af9MJSlw; 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]:38968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtX3-00042K-R7 for patch@linaro.org; Thu, 19 Dec 2019 05:59:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56551) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWa-0003i9-7I for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWY-0000eQ-NE for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:19 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45671) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWY-0000VY-F5 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:18 -0500 Received: by mail-wr1-x433.google.com with SMTP id j42so5479467wrj.12 for ; Thu, 19 Dec 2019 02:59:18 -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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=Af9MJSlwmcFM1EyaVAjOHCcP/0vc/RH8OufuqYNjr+v2PEiw92eL/9YcIkadDD7Ecc 1h66rs5r/VGb0d6uV3foNFneNrrizUXCxJD9FuHje+VelPLuQLMbUsnahZutIQ1EGbdx knOTwHpLSVrlrO6eDPm5Ha10a5DrvBVsV5lkNZe4xS7lFlFJBNXLKp1MVD12QBpqVcKD 6u01T4ZtrrZXmwkn6WFETBMtwY4QrdkchxzJVGvcht5D07RMimy2rBkzb46qMZSQ3xs2 m1AMlgxUjnxtetxF6rfFi3zFt2363OqpBM7KymSR5Zvowa6/+zXC86mq+ISlAdVb4AHs Gxgg== 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=vwsTQPLMkDuqXqnHi4Oibs2v+97DJuoFfknErpqUpNE=; b=st2iEteRYDY1clSdNfGD6eSZo8tol8+jWCSQ0MLhGUv/KUm/WW3J4f5hiee57Q3hAN YQNe3ldRCrhszVX5+wcAzuNELDw2nbzVfOzxhClKbVsPUCwz9LcRMPsn4F+vhr4WmHH0 tYZ0wKP6izdzNNzy8N7KRWeU8kLoEFy+RecpBy/UsvXnhzy0bI8UnRo7xHJ1RUmHxzOg y05XaEjqRy9rOCO4McdmU1oGQgENi29wbicWrTjXu4howGPEyUYw8wS2jm1uRZWn6WM2 rakPIea3ehMgB7b4RfOen7zBRMTp8AyyxIqrErYPZiHLb9mBDjP23OxOtWVIZNV0kyRC 04iQ== X-Gm-Message-State: APjAAAUVaKtZB562e5ZXGQbGGx8Kf8B9Ta38EXlypiL5f6sDedFw3XfO u+y2UbkGf74JMX29u/ByDwk4+Q== X-Received: by 2002:a5d:55d1:: with SMTP id i17mr8496917wrw.165.1576753156608; Thu, 19 Dec 2019 02:59:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f1sm5962764wru.6.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:15 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C5DF1FFAA; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 20/25] linux-user: convert target_mmap debug to tracepoint Date: Thu, 19 Dec 2019 10:49:29 +0000 Message-Id: <20191219104934.866-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It is a pain to re-compile when you need to debug and tracepoints are a fairly low impact way to instrument QEMU. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 26a83e74069..f4f10deaeac 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -363,32 +363,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, abi_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len; mmap_lock(); -#ifdef DEBUG_MMAP - { - printf("mmap: start=0x" TARGET_ABI_FMT_lx - " len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c flags=", - start, len, - prot & PROT_READ ? 'r' : '-', - prot & PROT_WRITE ? 'w' : '-', - prot & PROT_EXEC ? 'x' : '-'); - if (flags & MAP_FIXED) - printf("MAP_FIXED "); - if (flags & MAP_ANONYMOUS) - printf("MAP_ANON "); - switch(flags & MAP_TYPE) { - case MAP_PRIVATE: - printf("MAP_PRIVATE "); - break; - case MAP_SHARED: - printf("MAP_SHARED "); - break; - default: - printf("[MAP_TYPE=0x%x] ", flags & MAP_TYPE); - break; - } - printf("fd=%d offset=" TARGET_ABI_FMT_lx "\n", fd, offset); - } -#endif + trace_target_mmap(start, len, prot, flags, fd, offset); if (!len) { errno = EINVAL; diff --git a/linux-user/trace-events b/linux-user/trace-events index 8419243de4e..8d8d4c3c68c 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -14,3 +14,4 @@ user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_add # mmap.c target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x" +target_mmap(uint64_t start, uint64_t len, int pflags, int mflags, int fd, uint64_t offset) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x flags=0x%x fd=%d offset=0x%"PRIx64 From patchwork Thu Dec 19 10:49:30 2019 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: 182089 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp316758iln; Thu, 19 Dec 2019 02:58:58 -0800 (PST) X-Google-Smtp-Source: APXvYqzqmvQUAtCe0RxtVPLOym2GGeQg6duDngvjFbAbOPQtsbieqGihiaU5xuVcL0g/pnu1FweX X-Received: by 2002:aed:3e12:: with SMTP id l18mr6128764qtf.91.1576753138382; Thu, 19 Dec 2019 02:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753138; cv=none; d=google.com; s=arc-20160816; b=l7wEfVDdQeT9Kqxqde4Fi5R4JxuD24QJAglXXl6DzdLvmZrNdn5eE3YFc7NSTwULcw NhWbc0hmUpydSC/jDHGwhWMYUFyCFl2YU8wvH0NiA7QB9yeJWIXoGsRlhRU+ExHI0ec5 hvTY920cRAcAAMnwhOO5ysh2aCrO2JePuNzPkk4NzChwR8LhENhLbyKg9V1nKczYJPf3 ETFdq6vX1LS5Ot6bzg7AmWwn6qpXAZvkkilCcpkXACaBOTUW/8UTTfvZITRIpVtKLWV4 0gjkeZrMpIgStDjRaDlD/J/OIk1I8RplBSP5VtyGSNlWMPpcoRHqasd9IiET8MZVkY9K PxLA== 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=H8z1MrJa+EblW1lPryKy7epJgduWdqrAx6IGD9b/tew=; b=GK7kFnGvGxGDpF/hqXMMK4aQO248xdHo7dIILFphKYZ6sxSwBG5lvOS6CGuvJnW213 bmcxAt0ULyuuwqCkXpW6FyhrSpbehKypt5dXsckd+u4TMeTt4qbjjdtU3uiBCEzBTICc 1zw0y76XsTVMpotUnLFnBtivzWRzK5BpqLJOuCi0F5IgkfC1YNP15zOnJ8HSvqVc3xhm /ETa6ximOE1w0jSv43eJvqXGBFArWSXc5R3Eq5G0NK2RYPJn88Zty5DHGlzb//jDTmcs /+sJ8AOjOZnekWUdxrBNaxjptJyHYt7ehTfMrixGGakgzDp6Er6JOFAkSqhB/M9LqXyR ZiAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M8EA8SP2; 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 l18si3646220qkg.276.2019.12.19.02.58.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 02:58:58 -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=fail header.i=@linaro.org header.s=google header.b=M8EA8SP2; 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]:38904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWD-0002se-Va for patch@linaro.org; Thu, 19 Dec 2019 05:58:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtNX-00070b-I5 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:50:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtNW-0001F7-Bi for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:59 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:51621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtNW-0001Ah-0b for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:49:58 -0500 Received: by mail-wm1-x32d.google.com with SMTP id d73so4946926wmd.1 for ; Thu, 19 Dec 2019 02:49:57 -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=H8z1MrJa+EblW1lPryKy7epJgduWdqrAx6IGD9b/tew=; b=M8EA8SP2f64jGJ37MO6QOsBQwhO9mff4UYO8O/sNtFKyGReTH+57VN2c1fflGL9C9Z KogucPBhkiu9rQycCsSNoxFyO/2d1k+dHcWqxXWLvXU+X+wPiM3qr1HpWVXwKUbqQNV0 1p02DRS4c2+vvkCApkVpFbQndalxR75ww89Ttb57DFO/KKKnYBbFfHIhsQRNCJI2o7g8 JV+ifsQaRWc6tyFK3y6uH2m3nlWwu5C63TNmriU10Vn0TtZGdljwJXgWnoIEcCR7lAJ8 SUQTfXaPDHjcK8E9DDj8qH/+sDn/mA6ggEnf7M5PAqy3rHBvLgUatiZ+2q4t59m2qm5w PbRQ== 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=H8z1MrJa+EblW1lPryKy7epJgduWdqrAx6IGD9b/tew=; b=RQkwhlSJ3ZYueoBLaa5pOMvilp11MVTdnCdy09//I/l/w5igXIHqhvHNdoTz1ZJENu 2ut63VPWUqbmttAb4SOHhuLmq8jO7aXm1i6xSNg4OQlXwlH2IG133Sz0TIbyg3nbC85r Z83Ludc3Oy+kQcG3h0cqAJV+7YsFQkzwwWuRDcF2mEVuF3qMtctUKrMvTvH+KEXFbU0s 3AtxN/IgA9ctwVwJzw9o8HBsvuF6zFfvf9Ywh469WZFnT5fRjj3H3PLVZPuo3fis4DTO lRf7DE5bgjFmhi+rgdbgEy6UAdxF6r6IEvgIakkvjRotkzueDxO8JrDobxkzioDexCxO 3JuQ== X-Gm-Message-State: APjAAAV/PtSkmgp5JD4l2//4/lpWsxFOomzm+9JI7VRYho94YWTkdN4h BkZXuCqfJ01dlvhtFUG7I/yx2rNuBo0= X-Received: by 2002:a7b:cd0a:: with SMTP id f10mr9648646wmj.56.1576752597021; Thu, 19 Dec 2019 02:49:57 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s15sm6340132wrp.4.2019.12.19.02.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:49:51 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 72DB31FFAB; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 21/25] linux-user: add target_mmap_complete tracepoint Date: Thu, 19 Dec 2019 10:49:30 +0000 Message-Id: <20191219104934.866-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d 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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" For full details we also want to see where the mmaps end up. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-4-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index f4f10deaeac..0b1b43ac3c0 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -538,8 +538,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, the_end1: page_set_flags(start, start + len, prot | PAGE_VALID); the_end: + trace_target_mmap_complete(start); #ifdef DEBUG_MMAP - printf("ret=0x" TARGET_ABI_FMT_lx "\n", start); page_dump(stdout); printf("\n"); #endif diff --git a/linux-user/trace-events b/linux-user/trace-events index 8d8d4c3c68c..6d6aeef7b52 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -15,3 +15,4 @@ user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_add # mmap.c target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x" target_mmap(uint64_t start, uint64_t len, int pflags, int mflags, int fd, uint64_t offset) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x flags=0x%x fd=%d offset=0x%"PRIx64 +target_mmap_complete(uint64_t retaddr) "retaddr=0x%"PRIx64 From patchwork Thu Dec 19 10:49:31 2019 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: 182100 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp331153iln; Thu, 19 Dec 2019 03:10:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzCvs/CjHx+1MkT4L+KrMQfx9uYCM3XGaTmjtpjWIXM7csIl5EOpD5t2XRyTkK3N2CB9TP+ X-Received: by 2002:a05:620a:91c:: with SMTP id v28mr6436549qkv.248.1576753854354; Thu, 19 Dec 2019 03:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753854; cv=none; d=google.com; s=arc-20160816; b=lIIOVzOp0IxwQj8Zux2MFZZpC87keTIMthDP3vAVgddyEbF1XnbBwBgNxBWUQkCKlm wf2/Q1mWbKVWbqU5QEanhF6L8obRAp08FU76Z0ut0AfVav6l4K/Lws1lvKf+KAVWSbEe q+WtxAslWwbRsZY9cQrJnhNkpLaqMwndqRXj5p/asyd6+Di67WdV+NrCpfZL3i1Ry55n su5vcQI4hY+ds+qRUuSGk4yzZMt6yFLkqopgjoLEFh5JbJzXkuzg5ZABQxub+6YY1jvw LE3rQjB7S4EsG4pK3v+05ZVJr+VnulK1EENGUINXGvCtzhLM0nNSvh9IYpMc6tQj81zO n46w== 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=rjDJrz6x/SGN471YkmM/0ztom5/w9/oR2o+AFj80PtQ=; b=ugYlimpEizi8e8rpQ+ih4q99BIs2iHZ+Ngj4uygygYmHgl4K7sab687Q6g7ERKRsyX QeFFrZBtseniUVwDHj5NJ6VC53iQPaz4RubAdsxggl0AREMuGzMYnqPyXY5/CZ/pgpSK 1wHRypVpBTnq6t6I2VGQXWYVD8KYej6O0CzKTwI4X++qpnXcC3G7ljLC+KXX4D1CrRtP 02N8gUfuu2WLdIfkI++0VAy9n9uqua5qjmmR1ghTeZduIu2XVKhmqpX+enrmwmH31vv8 zgfJF91J98+kNmE3xCO5fNrTQPe3seEmv5woRh3ZfISlczSP6dEQxKh1vlaWkPoI05mi 6n/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qsiq10gG; 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 v5si2960022qvw.157.2019.12.19.03.10.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:10:54 -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=fail header.i=@linaro.org header.s=google header.b=qsiq10gG; 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]:39250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihthl-0002kH-P0 for patch@linaro.org; Thu, 19 Dec 2019 06:10:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57951) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWk-0003zZ-1V for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWi-0001Yy-KE for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:29 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33658) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWi-0001U0-BS for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:28 -0500 Received: by mail-wr1-x444.google.com with SMTP id b6so5547414wrq.0 for ; Thu, 19 Dec 2019 02:59:28 -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=rjDJrz6x/SGN471YkmM/0ztom5/w9/oR2o+AFj80PtQ=; b=qsiq10gGXkKpkjtndeMa0YzmhXow3734kohC5sUAoc+NbOyXSEzhywOPk86eu2yIil wx9RZ2A49xYkCZdNyf36zWGyOPWCv2rWCXOho0tS7ifS4H4VDPbsiP+f2cX/aKnQb/wS WPc74fdkKGk27dnJ5wBrXCSvc4gViMIM1daantBQPc4fSbL+Ba1uN51J9x5209zoBk7b LQv7zlVrhd0dmTqQHRaE2WEUzxfEJy8DJCsZqHP5ibLh6IF33srDAYaY5YuDEE2Dpd3t FnMcy47LQDrpto978sYIZCSgZGI28PQ11Hh0D80ibWuLciFwtPwzavLysfsMltJe/LmA 2QJQ== 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=rjDJrz6x/SGN471YkmM/0ztom5/w9/oR2o+AFj80PtQ=; b=XgxBVS6FHWulWHrpZvZQNHGitoXFhXgfjpgH7+uSNO0xC5KvXCfyvlgm2AYk2ouJnV 4wKTxm0kLf120HYGcmt4Nb48a2C0oq+DT8YiyuMZq4wGty2o8xp93d9UaJyX7gaSQXAC Yei7pSBW4ps5a5xIeN751PFRkkf8Q28Nb6m3/4eng9tjVYR4uQHliUzOWWfK5kft8DRw 5txmg42tiF+NUShaX1kqaVWWqVOt+qBO+abmVDLy7IBMwfdhtJxtCKF9Td4pzUvXypTD haNaLYS649Hgb6qnUMuQisvzluQRctL04iMsP4QilIKdNuE/+KoBtJERsdUrLlj6TQPy PUaw== X-Gm-Message-State: APjAAAVMfnOE5b9wLNba+BEOzP0nHBai9dMe4XN2gf2X4osnBTvRAtcA 5dfW0STPxAxgz4C4r5jyG2MTIQ== X-Received: by 2002:adf:ffc5:: with SMTP id x5mr8876623wrs.92.1576753167174; Thu, 19 Dec 2019 02:59:27 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a1sm5967336wrr.80.2019.12.19.02.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:20 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8D2E81FFAC; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 22/25] linux-user: log page table changes under -d page Date: Thu, 19 Dec 2019 10:49:31 +0000 Message-Id: <20191219104934.866-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450: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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The CPU_LOG_PAGE flag is woefully underused and could stand to do extra duty tracking page changes. If the user doesn't want to see the details as things change they still have the tracepoints available. We push the locking into log_page_dump and pass a reason for the banner text. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/exec/log.h b/include/exec/log.h index 9bd1e4aa20b..fcc7b9e00ba 100644 --- a/include/exec/log.h +++ b/include/exec/log.h @@ -69,15 +69,14 @@ static inline void log_disas(void *code, unsigned long size) #if defined(CONFIG_USER_ONLY) /* page_dump() output to the log file: */ -static inline void log_page_dump(void) +static inline void log_page_dump(const char *operation) { - QemuLogFile *logfile; - rcu_read_lock(); - logfile = atomic_rcu_read(&qemu_logfile); + FILE *logfile = qemu_log_lock(); if (logfile) { - page_dump(logfile->fd); + qemu_log("page layout changed following %s\n", operation); + page_dump(logfile); } - rcu_read_unlock(); + qemu_log_unlock(logfile); } #endif #endif diff --git a/bsd-user/main.c b/bsd-user/main.c index 470a8bf79ed..7f4e3cd6271 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -963,7 +963,7 @@ int main(int argc, char **argv) if (qemu_loglevel_mask(CPU_LOG_PAGE)) { qemu_log("guest_base 0x%lx\n", guest_base); - log_page_dump(); + log_page_dump("binary load"); qemu_log("start_brk 0x" TARGET_ABI_FMT_lx "\n", info->start_brk); qemu_log("end_code 0x" TARGET_ABI_FMT_lx "\n", info->end_code); diff --git a/linux-user/main.c b/linux-user/main.c index 6ff7851e86f..8718d03ee21 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -826,7 +826,7 @@ int main(int argc, char **argv, char **envp) if (qemu_loglevel_mask(CPU_LOG_PAGE)) { qemu_log("guest_base 0x%lx\n", guest_base); - log_page_dump(); + log_page_dump("binary load"); qemu_log("start_brk 0x" TARGET_ABI_FMT_lx "\n", info->start_brk); qemu_log("end_code 0x" TARGET_ABI_FMT_lx "\n", info->end_code); diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 0b1b43ac3c0..3d90fa459ca 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" #include "trace.h" +#include "exec/log.h" #include "qemu.h" //#define DEBUG_MMAP @@ -539,10 +540,9 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, page_set_flags(start, start + len, prot | PAGE_VALID); the_end: trace_target_mmap_complete(start); -#ifdef DEBUG_MMAP - page_dump(stdout); - printf("\n"); -#endif + if (qemu_loglevel_mask(CPU_LOG_PAGE)) { + log_page_dump(__func__); + } tb_invalidate_phys_range(start, start + len); mmap_unlock(); return start; From patchwork Thu Dec 19 10:49:32 2019 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: 182096 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp326862iln; Thu, 19 Dec 2019 03:07:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyxd0Kqpy7yemRb1bH/EW1NKfgRz0f3ekAwSFuKLQhOZXKoAXIcJrMWrWr43ndgLkYs0hrG X-Received: by 2002:ac8:3364:: with SMTP id u33mr6464902qta.267.1576753638216; Thu, 19 Dec 2019 03:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753638; cv=none; d=google.com; s=arc-20160816; b=CIN60GDABIah+UHDa1RFmHAKL4k/iW/VnrJNLlRkaXV+nkaTZvvkVkjfcew8MhNApx eHUyWToT+sLeWfYftpqVWcS3zKkmsCHgfdP7MRb4gZtUB0/yEJh9e1bcQHYdAcNEn+f4 qSghI9CkpMp2i/kFCpo6b/Nu9h1dQiAWZYj7tEuZ6VRQ5OUZJi/mBc4fdhiyRYXqDqjE 0aEEOrLxtMfGH7rNED8OEEYAzp+6z6EJi9TfBsTrV5xFPpSXx0lnEPqR+qdjpK81ZK4K dHkgsQUPSyeEULd5u2VarpLcJ04fUMyDNg8EH+iF8l1+NTS/7lSzblu7fUgIDiwWaFD0 25XQ== 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=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=wFInaqv6QDrgTSBfEEJci0Wb6pkpTsHtgIXlOYyJj4dZQmahoTueth8lJlsjP6BNuS DtVDlyyNKRDeQcK/b5B/iaxNKJk2xoXlkEpI63Lv5bBRy6CzwDOU36Dt1NS9nr5y0LsM nvlBdxaHFLInmNwumBCb/rYeQhtqAiyg0tleqWGQGZGgiRRUKDVkpTtzuL05KrrYEI3S 9RaI86oKqgsUKTK4j1SJTYKbXtj0ri5du/6dLB35K2MqKcg0baKW5XkbVxyLLfJVe68a eCmaNDvo9WS7kXIddKQpZwbpT0CYifshAvM07ikHAvEU2TkktFCOlbp+dpwgydT1ZDNp u3qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JK8dcoWi; 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 s20si3290650qkg.56.2019.12.19.03.07.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:07:18 -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=fail header.i=@linaro.org header.s=google header.b=JK8dcoWi; 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]:39162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihteH-0005tR-Hn for patch@linaro.org; Thu, 19 Dec 2019 06:07:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWf-0003s7-92 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWe-00018X-0P for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:25 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:35812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWd-00013X-ON for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:23 -0500 Received: by mail-wr1-x42b.google.com with SMTP id g17so5523689wro.2 for ; Thu, 19 Dec 2019 02:59: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=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=JK8dcoWiDUSE8AbuT1VALJD6l/4fKv23JilB72zO83jaR3QDJUprvr7DKHmC7575Hn 3flvoJiI3WJGLr0MmE9aiw6y7q3X/ChYU3fWlid0FP14piFy4LS7s0fNKv7/jI94zTLB 5iqHpEgSRkqh+ZyHna4HtCbB+svihH8QCGnr5g8j1/5b/sK+9i7RYhfC9f4iXFzxjpop XQtD9u7Wk7DPa6lK5K4ltHLsbdx/0a0EZfssg9jj6lWNf0E14/NV/ZfxkuIJi+zfS3Y8 gMpi5h0HmVqnD7tB2IKa4LnfOfXPBAfIFwo2eOgc74gsy4GOwh+KejtK4DH+AzibwUZx t0rA== 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=92sA2vbfB/cZD8466MabdWOfrm8v8VCFN2q7tL8ddlM=; b=fZh8Cv8bqxt+1Ah7onCsF0rnuvpVeO7E5ogXG3SwkBXR/NWDjcefZA0GAopqC0l1x+ a0A5BfgHYytFIVqOvX/Pe/AhxlR06101kkoY79W5xCxYtaV+ZmeTqhWf8qBBpoG8d+ik jg2tDNTLHdy7xd7xtRzDNFsXBMlcmrXZ6YYSOH+zIVQgJWV81tyRGwxutgG5LteYjDy8 RZHnQyE3C+VNEsgsrhZbzq43f8vcR0hFvDmeBewNpT7LLx0sjiUsUFTRNthmxtBD8R1u VhfZ5q1g8G0Uk07RUxYIdsvfJilmmvpVjn1EE4S1wys83FkY6Wjydqp5UamTsq90QS0p JWyg== X-Gm-Message-State: APjAAAWTQuDcahEepBOPtmIfGVDalRsbsQIKYYM8j7pOm5yMjDHODbwR /GI9+qO/xS2PynhAaTFJi0/OeA== X-Received: by 2002:a5d:534b:: with SMTP id t11mr8920179wrv.120.1576753162550; Thu, 19 Dec 2019 02:59:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a1sm5699879wmj.40.2019.12.19.02.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:19 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A574E1FFAE; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 23/25] linux-user: convert target_munmap debug to a tracepoint Date: Thu, 19 Dec 2019 10:49:32 +0000 Message-Id: <20191219104934.866-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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: Richard Henderson , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the final bit of DEBUG_MMAP to a tracepoint and remove the last remanents of the #ifdef hackery. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191205122518.10010-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 3d90fa459ca..8685f02e7e9 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -21,8 +21,6 @@ #include "exec/log.h" #include "qemu.h" -//#define DEBUG_MMAP - static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER; static __thread int mmap_lock_count; @@ -597,11 +595,8 @@ int target_munmap(abi_ulong start, abi_ulong len) abi_ulong end, real_start, real_end, addr; int prot, ret; -#ifdef DEBUG_MMAP - printf("munmap: start=0x" TARGET_ABI_FMT_lx " len=0x" - TARGET_ABI_FMT_lx "\n", - start, len); -#endif + trace_target_munmap(start, len); + if (start & ~TARGET_PAGE_MASK) return -TARGET_EINVAL; len = TARGET_PAGE_ALIGN(len); diff --git a/linux-user/trace-events b/linux-user/trace-events index 6d6aeef7b52..f6de1b8befc 100644 --- a/linux-user/trace-events +++ b/linux-user/trace-events @@ -16,3 +16,4 @@ user_s390x_restore_sigregs(void *env, uint64_t sc_psw_addr, uint64_t env_psw_add target_mprotect(uint64_t start, uint64_t len, int flags) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x" target_mmap(uint64_t start, uint64_t len, int pflags, int mflags, int fd, uint64_t offset) "start=0x%"PRIx64 " len=0x%"PRIx64 " prot=0x%x flags=0x%x fd=%d offset=0x%"PRIx64 target_mmap_complete(uint64_t retaddr) "retaddr=0x%"PRIx64 +target_munmap(uint64_t start, uint64_t len) "start=0x%"PRIx64" len=0x%"PRIx64 From patchwork Thu Dec 19 10:49:33 2019 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: 182098 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp328996iln; Thu, 19 Dec 2019 03:09:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwIbV2BlpPRryC6K1XLw+a4xrWIsWBHcDxTp6L5lSFvFA+agqCFKbp1qVnYF80V1JgNMb7K X-Received: by 2002:a05:6830:1db3:: with SMTP id z19mr8648337oti.152.1576753745091; Thu, 19 Dec 2019 03:09:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753745; cv=none; d=google.com; s=arc-20160816; b=NKAr2IqBnwnIqWVTMAOvmn1Vvr2yKigriaQq7LmVtRfKHA+gsf1aC+CzQ59yFy8QeB yX/n6wI60f4YO8naZsF2En/mzxIGxhkUHuRvdigO2j6T1l5/Dx0CeF/Okea32UeX8hW4 sEyI8aAxVZSdi3SWYpaFbW0ci+vBMwV/JpYSTz9TvUm0vOjXIER6de+17h8yrJaWAHP8 2HnJu/POMvkAEr3SvmkIxLdZk7d5s5vDGP/gGKAEcF/diUVr0OqgHJRAe00UE8DOQqAD 6V2GYZ4g8+0JQ9Nxfa4yCGEdW3YGmOufnCgd3XvKmA4fQGTQggcsOkrFdaxN6L85kCBM 8ipQ== 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=uLKaiiVcWx70eG0qkNbXF+zMJscr1d+jtw4eifA48Xc=; b=A7ZpbzxUinCSSQyDiSPSW8E4qOqzfvHyHLfAgu2w9E/qX2nJI6Yv0EZLyt/BXNK/2P LmyT4gQBC25Dk7AwqiFUEWq/oBpgV7sxbpcHVZQmYeeR9s1qHKwePdjgEFCzPNYBzyKa 2O/K38cNo/q83R8TtFDrHLF96Ax43Q54RtmCmBH19UcINjsKzkEVlgqdbvMWajct5270 +91DxBNWZw4cvS4hHTsEnxDeOxwlvzWY3S2MA8ziHSYrhczbw/4zB+7DY/BEDwu72cEZ MdhHUk8qA98byw+dEVf05JSnldN6gyz72/k+9aqU6Ne53LtLobxwWEX2/l7D6VPC05FF 8ubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gN1LN8vo; 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 v3si2811635oif.122.2019.12.19.03.09.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:09:05 -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=fail header.i=@linaro.org header.s=google header.b=gN1LN8vo; 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]:39192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtg0-0008UF-74 for patch@linaro.org; Thu, 19 Dec 2019 06:09:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWg-0003u5-HM for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWf-0001G8-9F for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:26 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWf-0001A5-08 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:25 -0500 Received: by mail-wm1-x32d.google.com with SMTP id m24so4960932wmc.3 for ; Thu, 19 Dec 2019 02:59:24 -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=uLKaiiVcWx70eG0qkNbXF+zMJscr1d+jtw4eifA48Xc=; b=gN1LN8vooBN7X/EDhpq1QpMUPDE6G8qMh6rpyNzcJSlQ480NdO4ap8W615ibJn6ekE +XFcQiCMxDIeOXdVmVEmktX2Q+bt1E7bRpRpxAWNKfLEKvX05j+fWCGSxZNOMP3geCEo fJkQDVB0ViPpz4u9Y2irlLaGt2UbQM9sDeaCk1yMvDgHzV4BgmGVVfr5C8ZHE7ujdntW JvmWN1w0ZGcd7giCvE6xAUEw0H43r2WaO5odMmb+eRhhn3zdYBZIfZhyxVc4KzCUDY5R W6zJlFXiWHSbVAWt523ebGjrGHqWbxGr5vLFXaEiy/lKlDx6AeeM6orKN9gbHXK428b/ /2lw== 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=uLKaiiVcWx70eG0qkNbXF+zMJscr1d+jtw4eifA48Xc=; b=EycCdFD++7h97fyQFYr4QeQfR/x9FSy27eka7NHHEEIh8Cuxt8LyZ6vclXMWcZ6l49 kQfZzdML01qb+XB98kXY1pun7maqaCK2b89SgtKDdeica8Fz/vDpcSeZ7CYC9pHLxQ0p BwMvpB62YJBlsHoENT5EWOO12RJoCNVI4bMX65EgebCuVzQUoU+yF9G49eSGhqcLgVLv RaQGLT2I6SLmKZBiq+StArIXfIGtygopq/GL2ePJfIRsnmrOBgExhF3K+QbD+bcgu6Xr PVjJFyr/GGyowbvBv50ESVYlmd/dG7VkOV/AAOkFip1X4g3LO1L58dI8KxEc5wcbDljK oPsg== X-Gm-Message-State: APjAAAV29IFKjo+tU2D0eYEUc6frEa8f0b5U5qW8RrP+IhVd4E1DNLFt v/AC43Y9Rq0NpGro2tPjAtVBzA== X-Received: by 2002:a1c:4907:: with SMTP id w7mr9067854wma.106.1576753163816; Thu, 19 Dec 2019 02:59:23 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y20sm5545442wmi.25.2019.12.19.02.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:19 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BB09B1FFAF; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 24/25] trace: replace hand-crafted pattern_glob with g_pattern_match_simple Date: Thu, 19 Dec 2019 10:49:33 +0000 Message-Id: <20191219104934.866-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We already use g_pattern_match elsewhere so remove the duplication. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Message-Id: <20191205122518.10010-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/trace/control.c b/trace/control.c index d9cafc161bb..0fb81241607 100644 --- a/trace/control.c +++ b/trace/control.c @@ -98,38 +98,6 @@ TraceEvent *trace_event_name(const char *name) return NULL; } -static bool pattern_glob(const char *pat, const char *ev) -{ - while (*pat != '\0' && *ev != '\0') { - if (*pat == *ev) { - pat++; - ev++; - } - else if (*pat == '*') { - if (pattern_glob(pat, ev+1)) { - return true; - } else if (pattern_glob(pat+1, ev)) { - return true; - } else { - return false; - } - } else { - return false; - } - } - - while (*pat == '*') { - pat++; - } - - if (*pat == '\0' && *ev == '\0') { - return true; - } else { - return false; - } -} - - void trace_event_iter_init(TraceEventIter *iter, const char *pattern) { iter->event = 0; @@ -148,8 +116,7 @@ TraceEvent *trace_event_iter_next(TraceEventIter *iter) iter->group++; } if (!iter->pattern || - pattern_glob(iter->pattern, - trace_event_get_name(ev))) { + g_pattern_match_simple(iter->pattern, trace_event_get_name(ev))) { return ev; } } From patchwork Thu Dec 19 10:49:34 2019 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: 182095 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp326753iln; Thu, 19 Dec 2019 03:07:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzBYEjMGLP4YlF44sBJdf3xWJj2gy4ZZ+Yr7n4lFzwlP0VfVdrl5K/Nv01lOavhqcWSXwMJ X-Received: by 2002:aed:3c7b:: with SMTP id u56mr6385789qte.82.1576753632957; Thu, 19 Dec 2019 03:07:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753632; cv=none; d=google.com; s=arc-20160816; b=Ny8rLV/Dyf/oQUrbz1bU1HB+tzeYR6xR3RFXI7I0Rk8XDC4sfsYtGnS1wDfXIwwAA7 dVw9RZIpUahe2GMpXP4s0QiB9SI6IORqkvS7r2Fro/3waxVHCHMQZFAdfx79wcW+SyCt ilZ55XRHxnzD3qQJvPRfFTiOePGMsH+d6Pm/KSw1BRKfnC4uMXfJcGl9X/iQR8oNksCV BARMw1Jfeud+z8M+WRDgLwEBZZZRHexwKIgEq69YZidEHNWzuluxWbT2BbJUtyxZwS+i +B7Wec21H4WKKub2fXbHafUQ6rA5Yhkde7gjXaKTGSlGTyTV0OPQFDhdD7orLHbH9oF5 seZQ== 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=5wZWaLRvYvZmLIMHo5Ts618uNlIbDVM0vsHKMJtTzPM=; b=esXycLlGX6XH29VWeUswMMK6wAwVzE4CAYMfWCkajSUMRPUrw9iPZbzElXPbW6gCci PLp+PNP2m5aO6sPDqWt0zGp56/eqe47uf9+pFv+PFyH8igqJ+P0oi4sHa+NriIYqwNVk Sbl7r5w1Us5COwljFCbEriIRmGX97NAE6advdfqsK89hxqAsV1xyO7dWQK5FagVt6aPx nrP/P76HX6/oqIBmFWLIry2xNYauvtrug815QIcZZ2k8/HLoEra4zvmTHZtJov80wIvr 0rF8Ky70mD2Bv/UBNTI0mOZXIeUqbfz4j7VYpoXAZmNh8ea7y5rFxEwsGsDhVfORAWxD Rhzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a7u7AhMR; 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 v2si2827930qtk.273.2019.12.19.03.07.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2019 03:07:12 -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=fail header.i=@linaro.org header.s=google header.b=a7u7AhMR; 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]:39166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihteC-00065P-2l for patch@linaro.org; Thu, 19 Dec 2019 06:07:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57071) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihtWd-0003pN-N8 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihtWc-00010q-Is for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:23 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:44595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihtWc-0000uz-AC for qemu-devel@nongnu.org; Thu, 19 Dec 2019 05:59:22 -0500 Received: by mail-wr1-x429.google.com with SMTP id q10so5493753wrm.11 for ; Thu, 19 Dec 2019 02:59:22 -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=5wZWaLRvYvZmLIMHo5Ts618uNlIbDVM0vsHKMJtTzPM=; b=a7u7AhMRQ7JvoMkVctN7MwzSHwdmI2dvIPrInk/CzKQA4ESw8rAdEBbfYWz5dkSFNc vS4wVcjVatLj6btwpz58zB/5yYRVt/FQPlL19ePqvWJkrj42N8SHFiV81mQAaetvjj7M zSgvRiCz9O3WY5OEKXVyzk6S0+9Ofl+Rc5l+eCIP6wENA8U2N2Hjl8mKB5Zsed+n5hHO Wdu5NO80QWrbiruRXawX66qxAM51ZMpXYEdJ4jKtx+q/gk0rsY1J4FWEigGNogC3dmVr 3YDqnE6xixCS+u6Ke7ip8R4tsLKq6jOKlYM6kfeQYRxUhyj5Vc6Uj4Er/lRctyic0LFx HLfg== 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=5wZWaLRvYvZmLIMHo5Ts618uNlIbDVM0vsHKMJtTzPM=; b=rQPep7QWV9erphQwoIRaV6q2xXrXpAONVx9fZxzOXDvdt9vedSKgJEjkIjV8/kkcjJ qxat4ga+Cq6Dg9bhyDwnLasLZG3hEj2SirIbX+ulUnbQLIAfHmhDZozAWW+Lp4v61E04 i+WjqkmpyBJq4sjEsd62P13cQ9MjAtgRxF7mG/1rHxKvtku6vXHYQDaAtitckKv0Sftl FWyPD3NlUE5mdRz23rYrnnwHbLAExfB/3rcr64p1R35wlweZUXiAqu1mgaXoxaz1x56W qwKy7Nf1GkbvNnMQSHjZ1RsSUa8FJdfqT6ZPIpbguVlVC6hRk8Kqid1SYrHn1idpScc3 lRBQ== X-Gm-Message-State: APjAAAUAMo0/Qk+EGjwmZKS1q1aPtApSFo1mM8bD6zWmTKq9UpeDcRzB UDkYrliHDVQeTqDUyXKHkj7L6Q== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr8702460wrr.116.1576753161269; Thu, 19 Dec 2019 02:59:21 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 60sm6200327wrn.86.2019.12.19.02.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 02:59:18 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D132C1FFB1; Thu, 19 Dec 2019 10:49:36 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 25/25] tests/tcg: ensure we re-configure if configure.sh is updated Date: Thu, 19 Dec 2019 10:49:34 +0000 Message-Id: <20191219104934.866-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219104934.866-1-alex.bennee@linaro.org> References: <20191219104934.866-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We were only doing this if docker was enabled which isn't quite right. Fixes: fc76c56d3f47 Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20191211170520.7747-17-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/Makefile.prereqs b/tests/tcg/Makefile.prereqs index 7494b31b952..9a29604a839 100644 --- a/tests/tcg/Makefile.prereqs +++ b/tests/tcg/Makefile.prereqs @@ -13,6 +13,6 @@ DOCKER_IMAGE:= ifneq ($(DOCKER_IMAGE),) build-tcg-tests-$(PROBE_TARGET): docker-image-$(DOCKER_IMAGE) +endif $(BUILD_DIR)/tests/tcg/config_$(PROBE_TARGET).mak: config-host.mak config-host.mak: $(SRC_PATH)/tests/tcg/configure.sh -endif