* [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options
@ 2024-11-14 12:15 Paolo Bonzini
2024-11-14 12:41 ` Michael Tokarev
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2024-11-14 12:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev
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>
---
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;
+}
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options
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
0 siblings, 2 replies; 4+ messages in thread
From: Michael Tokarev @ 2024-11-14 12:41 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Vitaly Kuznetsov
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?
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options
2024-11-14 12:41 ` Michael Tokarev
@ 2024-11-14 12:52 ` Paolo Bonzini
2024-11-14 12:55 ` Paolo Bonzini
1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2024-11-14 12:52 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: Vitaly Kuznetsov
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 (#ef
> 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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/i386: hyperv: add stub for hyperv_syndbg_query_options
2024-11-14 12:41 ` Michael Tokarev
2024-11-14 12:52 ` Paolo Bonzini
@ 2024-11-14 12:55 ` Paolo Bonzini
1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2024-11-14 12:55 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: Vitaly Kuznetsov
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
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-14 12:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.