From: Shuah Khan <skhan@linuxfoundation.org>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>
Cc: kernel@collabora.com, Sean Christopherson <seanjc@google.com>,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch
Date: Mon, 19 Aug 2024 04:01:28 -0600 [thread overview]
Message-ID: <59d825c8-bdaf-4077-be0e-d738b42d2dab@linuxfoundation.org> (raw)
In-Reply-To: <20240819093030.2864163-1-usama.anjum@collabora.com>
On 8/19/24 03:30, Muhammad Usama Anjum wrote:
> The tests are built on per architecture basis. When unsupported
> architecture is specified, it has no tests and TEST_GEN_PROGS is empty.
> The lib.mk has support for not building anything for such case. But KVM
> makefile doesn't handle such case correctly. It doesn't check if
> TEST_GEN_PROGS is empty or not and try to create directory by mkdir.
> Hence mkdir generates the error.
>
> mkdir: missing operand
> Try 'mkdir --help' for more information.
>
> This can be easily fixed by checking if TEST_GEN_PROGS isn't empty
> before calling mkdir.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes since v1:
> - Instead of ignoring error, check TEST_GEN_PROGS's validity first
> ---
> tools/testing/selftests/kvm/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 48d32c5aa3eb7..9f8ed82ff1d65 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -317,7 +317,9 @@ $(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S $(GEN_HDRS)
> $(LIBKVM_STRING_OBJ): $(OUTPUT)/%.o: %.c
> $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -ffreestanding $< -o $@
>
> +ifneq ($(strip $(TEST_GEN_PROGS)),)
> $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
> +endif
> $(SPLIT_TEST_GEN_OBJ): $(GEN_HDRS)
> $(TEST_GEN_PROGS): $(LIBKVM_OBJS)
> $(TEST_GEN_PROGS_EXTENDED): $(LIBKVM_OBJS)
Looks good to me.
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
next prev parent reply other threads:[~2024-08-19 10:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 9:30 [PATCH v2] selftests: kvm: fix mkdir error when building for unsupported arch Muhammad Usama Anjum
2024-08-19 10:01 ` Shuah Khan [this message]
2024-08-19 16:33 ` Sean Christopherson
2024-08-19 22:15 ` Oliver Upton
2024-08-20 6:40 ` Marc Zyngier
2024-08-20 7:26 ` Muhammad Usama Anjum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59d825c8-bdaf-4077-be0e-d738b42d2dab@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=kernel@collabora.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=usama.anjum@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox