From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options
Date: Thu, 14 Nov 2024 13:55:57 +0100 [thread overview]
Message-ID: <34bbd871-3050-48b3-8a5c-3d8e1c73816b@redhat.com> (raw)
In-Reply-To: <a3ad589c-26f8-46b9-b3b0-967ad9620768@tls.msk.ru>
On 11/14/24 13:41, Michael Tokarev wrote:
> 14.11.2024 15:15, Paolo Bonzini wrote:
>> Building without CONFIG_HYPERV is currently broken due to a missing
>> symbol 'hyperv_syndbg_query_options'. Add it to the stubs
>> that exist for that very reasons.
>>
>> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> Rewviewed-by: Michael Tokarev <mjt@tls.msk.ru>
>
> I'm a bit confused though, - why a stub is "better" than an #ifdef,
> especially in such simple cases?
To be honest the #ifdef was the first thing I did (#ifdef
CONFIG_HYPERV). I switched to the stub just to avoid doing the same
thing in two different ways.
In general I prefer stubs because they put all the code in one place.
For example there is a benefit, which doesn't apply here, when you have
stubs with Error** arguments. Then it's easier to make the error text
consistent.
Paolo
> Restoring the #ifdef around this place fixes the build.
> I understand if the function in question were used in lots of
> places around the code, but here it's not the case.
>
> Another option would be, instead of stubs, to use:
>
> #ifndef CONFIG_SYNDBY
> #define hyperv_syndbg_query_options() 0
> #endif
>
> which will make stubs unnecessary entirely.
>
>> ---
>> target/i386/kvm/hyperv-stub.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/target/i386/kvm/hyperv-stub.c b/target/i386/kvm/hyperv-
>> stub.c
>> index 3263dcf05d3..5836f53c23b 100644
>> --- a/target/i386/kvm/hyperv-stub.c
>> +++ b/target/i386/kvm/hyperv-stub.c
>> @@ -56,3 +56,8 @@ void hyperv_x86_synic_update(X86CPU *cpu)
>> void hyperv_x86_set_vmbus_recommended_features_enabled(void)
>> {
>> }
>> +
>> +uint64_t hyperv_syndbg_query_options(void)
>> +{
>> + return 0;
>> +}
>
> Thanks,
>
> /mjt
>
>
prev parent reply other threads:[~2024-11-14 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 12:15 [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options Paolo Bonzini
2024-11-14 12:41 ` Michael Tokarev
2024-11-14 12:52 ` Paolo Bonzini
2024-11-14 12:55 ` Paolo Bonzini [this message]
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=34bbd871-3050-48b3-8a5c-3d8e1c73816b@redhat.com \
--to=pbonzini@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=vkuznets@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.