* [PATCH 0/2] dump/win_dump: Build almost once @ 2026-01-07 18:05 Philippe Mathieu-Daudé 2026-01-07 18:05 ` [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts Philippe Mathieu-Daudé 2026-01-07 18:05 ` [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX Philippe Mathieu-Daudé 0 siblings, 2 replies; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-07 18:05 UTC (permalink / raw) To: qemu-devel Cc: Ani Sinha, Pierrick Bouvier, Marc-André Lureau, Philippe Mathieu-Daudé Build win_dump stub once on non-Windows or non-x86 hosts. Philippe Mathieu-Daudé (2): dump/win_dump: Abort in create_win_dump() on non-x86 hosts dump/win_dump: Use stubs on non-Windows hosts like POSIX dump/win_dump-stubs.c | 21 +++++++++++++++++++++ dump/win_dump.c | 14 +++++++++----- dump/meson.build | 6 +++++- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 dump/win_dump-stubs.c -- 2.52.0 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts 2026-01-07 18:05 [PATCH 0/2] dump/win_dump: Build almost once Philippe Mathieu-Daudé @ 2026-01-07 18:05 ` Philippe Mathieu-Daudé 2026-01-08 8:24 ` Marc-André Lureau 2026-01-07 18:05 ` [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX Philippe Mathieu-Daudé 1 sibling, 1 reply; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-07 18:05 UTC (permalink / raw) To: qemu-devel Cc: Ani Sinha, Pierrick Bouvier, Marc-André Lureau, Philippe Mathieu-Daudé win_dump_available() reports an error on non-x86 hosts when Windows dump format is not available. In that case win_dump_available() shouldn't be called, otherwise this is a programming error: abort. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- dump/win_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dump/win_dump.c b/dump/win_dump.c index 3162e8bd487..6e07913dfb4 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -489,7 +489,7 @@ bool win_dump_available(Error **errp) void create_win_dump(DumpState *s, Error **errp) { - win_dump_available(errp); + g_assert_not_reached(); } #endif -- 2.52.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts 2026-01-07 18:05 ` [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts Philippe Mathieu-Daudé @ 2026-01-08 8:24 ` Marc-André Lureau 0 siblings, 0 replies; 11+ messages in thread From: Marc-André Lureau @ 2026-01-08 8:24 UTC (permalink / raw) To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Ani Sinha, Pierrick Bouvier Hi On Wed, Jan 7, 2026 at 10:08 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote: > > win_dump_available() reports an error on non-x86 hosts > when Windows dump format is not available. In that case > win_dump_available() shouldn't be called, otherwise this > is a programming error: abort. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> (qmp_dump_guest_memory() should prevent that runtime error) Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > dump/win_dump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dump/win_dump.c b/dump/win_dump.c > index 3162e8bd487..6e07913dfb4 100644 > --- a/dump/win_dump.c > +++ b/dump/win_dump.c > @@ -489,7 +489,7 @@ bool win_dump_available(Error **errp) > > void create_win_dump(DumpState *s, Error **errp) > { > - win_dump_available(errp); > + g_assert_not_reached(); > } > > #endif > -- > 2.52.0 > > -- Marc-André Lureau ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-07 18:05 [PATCH 0/2] dump/win_dump: Build almost once Philippe Mathieu-Daudé 2026-01-07 18:05 ` [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts Philippe Mathieu-Daudé @ 2026-01-07 18:05 ` Philippe Mathieu-Daudé 2026-01-08 8:26 ` Marc-André Lureau 2026-01-08 9:11 ` Daniel P. Berrangé 1 sibling, 2 replies; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-07 18:05 UTC (permalink / raw) To: qemu-devel Cc: Ani Sinha, Pierrick Bouvier, Marc-André Lureau, Philippe Mathieu-Daudé Rather than compiling the same content for all targets (unused most of the time, i.e. qemu-system-avr ...), build it once per POSIX hosts. Check Windows host (less likely) before x86 host. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- dump/win_dump-stubs.c | 21 +++++++++++++++++++++ dump/win_dump.c | 12 ++++++++---- dump/meson.build | 6 +++++- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 dump/win_dump-stubs.c diff --git a/dump/win_dump-stubs.c b/dump/win_dump-stubs.c new file mode 100644 index 00000000000..722c66740a2 --- /dev/null +++ b/dump/win_dump-stubs.c @@ -0,0 +1,21 @@ +/* + * Windows crashdump stubs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "win_dump.h" + +bool win_dump_available(Error **errp) +{ + error_setg(errp, "Windows dump is only available on Windows"); + + return false; +} + +void create_win_dump(DumpState *s, Error **errp) +{ + g_assert_not_reached(); +} diff --git a/dump/win_dump.c b/dump/win_dump.c index 6e07913dfb4..5b2b55d9ff7 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -12,14 +12,16 @@ #include "system/dump.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "win_dump.h" + +#ifdef CONFIG_WIN32 +#if defined(TARGET_X86_64) + #include "exec/cpu-defs.h" #include "hw/core/cpu.h" #include "qemu/win_dump_defs.h" -#include "win_dump.h" #include "cpu.h" -#if defined(TARGET_X86_64) - bool win_dump_available(Error **errp) { return true; @@ -478,7 +480,9 @@ out_cr3: first_x86_cpu->env.cr[3] = saved_cr3; } -#else /* !TARGET_X86_64 */ +#endif /* !TARGET_X86_64 */ + +#else /* !CONFIG_WIN32 */ bool win_dump_available(Error **errp) { diff --git a/dump/meson.build b/dump/meson.build index 4277ce9328a..0aaf3f65d9c 100644 --- a/dump/meson.build +++ b/dump/meson.build @@ -1,2 +1,6 @@ system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) +if host_os == 'windows' + system_ss.add(files('win_dump.c')) +else + system_ss.add(files('win_dump-stubs.c')) +endif -- 2.52.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-07 18:05 ` [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX Philippe Mathieu-Daudé @ 2026-01-08 8:26 ` Marc-André Lureau 2026-01-08 9:11 ` Daniel P. Berrangé 1 sibling, 0 replies; 11+ messages in thread From: Marc-André Lureau @ 2026-01-08 8:26 UTC (permalink / raw) To: Philippe Mathieu-Daudé; +Cc: qemu-devel, Ani Sinha, Pierrick Bouvier Hi On Wed, Jan 7, 2026 at 10:08 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote: > > Rather than compiling the same content for all targets (unused > most of the time, i.e. qemu-system-avr ...), build it once per > POSIX hosts. Check Windows host (less likely) before x86 host. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > dump/win_dump-stubs.c | 21 +++++++++++++++++++++ > dump/win_dump.c | 12 ++++++++---- > dump/meson.build | 6 +++++- > 3 files changed, 34 insertions(+), 5 deletions(-) > create mode 100644 dump/win_dump-stubs.c > > diff --git a/dump/win_dump-stubs.c b/dump/win_dump-stubs.c > new file mode 100644 > index 00000000000..722c66740a2 > --- /dev/null > +++ b/dump/win_dump-stubs.c > @@ -0,0 +1,21 @@ > +/* > + * Windows crashdump stubs > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "qapi/error.h" > +#include "win_dump.h" > + > +bool win_dump_available(Error **errp) > +{ > + error_setg(errp, "Windows dump is only available on Windows"); > + > + return false; > +} > + > +void create_win_dump(DumpState *s, Error **errp) > +{ > + g_assert_not_reached(); > +} > diff --git a/dump/win_dump.c b/dump/win_dump.c > index 6e07913dfb4..5b2b55d9ff7 100644 > --- a/dump/win_dump.c > +++ b/dump/win_dump.c > @@ -12,14 +12,16 @@ > #include "system/dump.h" > #include "qapi/error.h" > #include "qemu/error-report.h" > +#include "win_dump.h" > + > +#ifdef CONFIG_WIN32 Why check CONFIG_WIN32 in a windows-only file? > +#if defined(TARGET_X86_64) > + > #include "exec/cpu-defs.h" > #include "hw/core/cpu.h" > #include "qemu/win_dump_defs.h" > -#include "win_dump.h" > #include "cpu.h" > > -#if defined(TARGET_X86_64) > - > bool win_dump_available(Error **errp) > { > return true; > @@ -478,7 +480,9 @@ out_cr3: > first_x86_cpu->env.cr[3] = saved_cr3; > } > > -#else /* !TARGET_X86_64 */ > +#endif /* !TARGET_X86_64 */ > + > +#else /* !CONFIG_WIN32 */ > > bool win_dump_available(Error **errp) > { > diff --git a/dump/meson.build b/dump/meson.build > index 4277ce9328a..0aaf3f65d9c 100644 > --- a/dump/meson.build > +++ b/dump/meson.build > @@ -1,2 +1,6 @@ > system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) > -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) > +if host_os == 'windows' > + system_ss.add(files('win_dump.c')) > +else > + system_ss.add(files('win_dump-stubs.c')) > +endif > -- > 2.52.0 > > -- Marc-André Lureau ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-07 18:05 ` [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX Philippe Mathieu-Daudé 2026-01-08 8:26 ` Marc-André Lureau @ 2026-01-08 9:11 ` Daniel P. Berrangé 2026-01-08 10:51 ` Philippe Mathieu-Daudé 1 sibling, 1 reply; 11+ messages in thread From: Daniel P. Berrangé @ 2026-01-08 9:11 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: > Rather than compiling the same content for all targets (unused > most of the time, i.e. qemu-system-avr ...), build it once per > POSIX hosts. Check Windows host (less likely) before x86 host. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > dump/win_dump-stubs.c | 21 +++++++++++++++++++++ > dump/win_dump.c | 12 ++++++++---- > dump/meson.build | 6 +++++- > 3 files changed, 34 insertions(+), 5 deletions(-) > create mode 100644 dump/win_dump-stubs.c snip > diff --git a/dump/meson.build b/dump/meson.build > index 4277ce9328a..0aaf3f65d9c 100644 > --- a/dump/meson.build > +++ b/dump/meson.build > @@ -1,2 +1,6 @@ > system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) > -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) > +if host_os == 'windows' > + system_ss.add(files('win_dump.c')) > +else > + system_ss.add(files('win_dump-stubs.c')) > +endif This is very wrong. The win_dump.c file has no association with Windows hosts. It is about creating crash dumps of Windows *guests* in the Windows dump format. The current conditional which builds it on TARGET_X86_64 is correct. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-08 9:11 ` Daniel P. Berrangé @ 2026-01-08 10:51 ` Philippe Mathieu-Daudé 2026-01-08 10:53 ` Daniel P. Berrangé 0 siblings, 1 reply; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-08 10:51 UTC (permalink / raw) To: Daniel P. Berrangé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On 8/1/26 10:11, Daniel P. Berrangé wrote: > On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: >> Rather than compiling the same content for all targets (unused >> most of the time, i.e. qemu-system-avr ...), build it once per >> POSIX hosts. Check Windows host (less likely) before x86 host. >> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> >> --- >> dump/win_dump-stubs.c | 21 +++++++++++++++++++++ >> dump/win_dump.c | 12 ++++++++---- >> dump/meson.build | 6 +++++- >> 3 files changed, 34 insertions(+), 5 deletions(-) >> create mode 100644 dump/win_dump-stubs.c > > snip > >> diff --git a/dump/meson.build b/dump/meson.build >> index 4277ce9328a..0aaf3f65d9c 100644 >> --- a/dump/meson.build >> +++ b/dump/meson.build >> @@ -1,2 +1,6 @@ >> system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) >> -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) >> +if host_os == 'windows' >> + system_ss.add(files('win_dump.c')) >> +else >> + system_ss.add(files('win_dump-stubs.c')) >> +endif > > This is very wrong. > > The win_dump.c file has no association with Windows hosts. It is about > creating crash dumps of Windows *guests* in the Windows dump format. The > current conditional which builds it on TARGET_X86_64 is correct. Great to know this is a *guest* feature and not a *host* one. Something else is currently wrong, because this file is built with qemu-system-avr on macOS. Anyway, I'll revisit, thanks. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-08 10:51 ` Philippe Mathieu-Daudé @ 2026-01-08 10:53 ` Daniel P. Berrangé 2026-01-08 11:14 ` Philippe Mathieu-Daudé 0 siblings, 1 reply; 11+ messages in thread From: Daniel P. Berrangé @ 2026-01-08 10:53 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On Thu, Jan 08, 2026 at 11:51:00AM +0100, Philippe Mathieu-Daudé wrote: > On 8/1/26 10:11, Daniel P. Berrangé wrote: > > On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: > > > Rather than compiling the same content for all targets (unused > > > most of the time, i.e. qemu-system-avr ...), build it once per > > > POSIX hosts. Check Windows host (less likely) before x86 host. > > > > > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > > > --- > > > dump/win_dump-stubs.c | 21 +++++++++++++++++++++ > > > dump/win_dump.c | 12 ++++++++---- > > > dump/meson.build | 6 +++++- > > > 3 files changed, 34 insertions(+), 5 deletions(-) > > > create mode 100644 dump/win_dump-stubs.c > > > > snip > > > > > diff --git a/dump/meson.build b/dump/meson.build > > > index 4277ce9328a..0aaf3f65d9c 100644 > > > --- a/dump/meson.build > > > +++ b/dump/meson.build > > > @@ -1,2 +1,6 @@ > > > system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) > > > -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) > > > +if host_os == 'windows' > > > + system_ss.add(files('win_dump.c')) > > > +else > > > + system_ss.add(files('win_dump-stubs.c')) > > > +endif > > > > This is very wrong. > > > > The win_dump.c file has no association with Windows hosts. It is about > > creating crash dumps of Windows *guests* in the Windows dump format. The > > current conditional which builds it on TARGET_X86_64 is correct. > > Great to know this is a *guest* feature and not a *host* one. > > Something else is currently wrong, because this file is built with > qemu-system-avr on macOS. Why is that a problem ? The entire file content is surrounded with #if defined(TARGET_X86_64) ...the impl... #else ...stubs... #endif soo qemu-system-avr will be building the stubs which is fine. macOS is not a factor, since QEMU is fine to emulate Windows guests on macOS hosts and thus Win dump is in scope for macOS With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-08 10:53 ` Daniel P. Berrangé @ 2026-01-08 11:14 ` Philippe Mathieu-Daudé 2026-01-08 11:36 ` Daniel P. Berrangé 0 siblings, 1 reply; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-08 11:14 UTC (permalink / raw) To: Daniel P. Berrangé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On 8/1/26 11:53, Daniel P. Berrangé wrote: > On Thu, Jan 08, 2026 at 11:51:00AM +0100, Philippe Mathieu-Daudé wrote: >> On 8/1/26 10:11, Daniel P. Berrangé wrote: >>> On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: >>>> Rather than compiling the same content for all targets (unused >>>> most of the time, i.e. qemu-system-avr ...), build it once per >>>> POSIX hosts. Check Windows host (less likely) before x86 host. >>>> >>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> >>>> --- >>>> dump/win_dump-stubs.c | 21 +++++++++++++++++++++ >>>> dump/win_dump.c | 12 ++++++++---- >>>> dump/meson.build | 6 +++++- >>>> 3 files changed, 34 insertions(+), 5 deletions(-) >>>> create mode 100644 dump/win_dump-stubs.c >>> >>> snip >>> >>>> diff --git a/dump/meson.build b/dump/meson.build >>>> index 4277ce9328a..0aaf3f65d9c 100644 >>>> --- a/dump/meson.build >>>> +++ b/dump/meson.build >>>> @@ -1,2 +1,6 @@ >>>> system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) >>>> -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) >>>> +if host_os == 'windows' >>>> + system_ss.add(files('win_dump.c')) >>>> +else >>>> + system_ss.add(files('win_dump-stubs.c')) >>>> +endif >>> >>> This is very wrong. >>> >>> The win_dump.c file has no association with Windows hosts. It is about >>> creating crash dumps of Windows *guests* in the Windows dump format. The >>> current conditional which builds it on TARGET_X86_64 is correct. >> >> Great to know this is a *guest* feature and not a *host* one. >> >> Something else is currently wrong, because this file is built with >> qemu-system-avr on macOS. > > Why is that a problem ? Single binary can not be linked because each target has these same symbols. > The entire file content is surrounded with > > #if defined(TARGET_X86_64) > ...the impl... > #else > ...stubs... > #endif > > soo qemu-system-avr will be building the stubs which is fine. macOS > is not a factor, since QEMU is fine to emulate Windows guests on > macOS hosts and thus Win dump is in scope for macOS > > With regards, > Daniel ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-08 11:14 ` Philippe Mathieu-Daudé @ 2026-01-08 11:36 ` Daniel P. Berrangé 2026-01-08 16:16 ` Philippe Mathieu-Daudé 0 siblings, 1 reply; 11+ messages in thread From: Daniel P. Berrangé @ 2026-01-08 11:36 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On Thu, Jan 08, 2026 at 12:14:30PM +0100, Philippe Mathieu-Daudé wrote: > On 8/1/26 11:53, Daniel P. Berrangé wrote: > > On Thu, Jan 08, 2026 at 11:51:00AM +0100, Philippe Mathieu-Daudé wrote: > > > On 8/1/26 10:11, Daniel P. Berrangé wrote: > > > > On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: > > > > > Rather than compiling the same content for all targets (unused > > > > > most of the time, i.e. qemu-system-avr ...), build it once per > > > > > POSIX hosts. Check Windows host (less likely) before x86 host. > > > > > > > > > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > > > > > --- > > > > > dump/win_dump-stubs.c | 21 +++++++++++++++++++++ > > > > > dump/win_dump.c | 12 ++++++++---- > > > > > dump/meson.build | 6 +++++- > > > > > 3 files changed, 34 insertions(+), 5 deletions(-) > > > > > create mode 100644 dump/win_dump-stubs.c > > > > > > > > snip > > > > > > > > > diff --git a/dump/meson.build b/dump/meson.build > > > > > index 4277ce9328a..0aaf3f65d9c 100644 > > > > > --- a/dump/meson.build > > > > > +++ b/dump/meson.build > > > > > @@ -1,2 +1,6 @@ > > > > > system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) > > > > > -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) > > > > > +if host_os == 'windows' > > > > > + system_ss.add(files('win_dump.c')) > > > > > +else > > > > > + system_ss.add(files('win_dump-stubs.c')) > > > > > +endif > > > > > > > > This is very wrong. > > > > > > > > The win_dump.c file has no association with Windows hosts. It is about > > > > creating crash dumps of Windows *guests* in the Windows dump format. The > > > > current conditional which builds it on TARGET_X86_64 is correct. > > > > > > Great to know this is a *guest* feature and not a *host* one. > > > > > > Something else is currently wrong, because this file is built with > > > qemu-system-avr on macOS. > > > > Why is that a problem ? > > Single binary can not be linked because each target has these same symbols. So we need a make 'win_dump_available()' into a runtime check against the current target == x86, and then unconditionally build the rest of the file ? How do we provide access to target specific types in such builds as merely removing the #ifdef shows missing X86CPU / CPUX86State types for most targets. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :| ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX 2026-01-08 11:36 ` Daniel P. Berrangé @ 2026-01-08 16:16 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 11+ messages in thread From: Philippe Mathieu-Daudé @ 2026-01-08 16:16 UTC (permalink / raw) To: Daniel P. Berrangé Cc: qemu-devel, Ani Sinha, Pierrick Bouvier, Marc-André Lureau On 8/1/26 12:36, Daniel P. Berrangé wrote: > On Thu, Jan 08, 2026 at 12:14:30PM +0100, Philippe Mathieu-Daudé wrote: >> On 8/1/26 11:53, Daniel P. Berrangé wrote: >>> On Thu, Jan 08, 2026 at 11:51:00AM +0100, Philippe Mathieu-Daudé wrote: >>>> On 8/1/26 10:11, Daniel P. Berrangé wrote: >>>>> On Wed, Jan 07, 2026 at 07:05:19PM +0100, Philippe Mathieu-Daudé wrote: >>>>>> Rather than compiling the same content for all targets (unused >>>>>> most of the time, i.e. qemu-system-avr ...), build it once per >>>>>> POSIX hosts. Check Windows host (less likely) before x86 host. >>>>>> >>>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> >>>>>> --- >>>>>> dump/win_dump-stubs.c | 21 +++++++++++++++++++++ >>>>>> dump/win_dump.c | 12 ++++++++---- >>>>>> dump/meson.build | 6 +++++- >>>>>> 3 files changed, 34 insertions(+), 5 deletions(-) >>>>>> create mode 100644 dump/win_dump-stubs.c >>>>> >>>>> snip >>>>> >>>>>> diff --git a/dump/meson.build b/dump/meson.build >>>>>> index 4277ce9328a..0aaf3f65d9c 100644 >>>>>> --- a/dump/meson.build >>>>>> +++ b/dump/meson.build >>>>>> @@ -1,2 +1,6 @@ >>>>>> system_ss.add([files('dump.c', 'dump-hmp-cmds.c'), snappy, lzo]) >>>>>> -specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: files('win_dump.c')) >>>>>> +if host_os == 'windows' >>>>>> + system_ss.add(files('win_dump.c')) >>>>>> +else >>>>>> + system_ss.add(files('win_dump-stubs.c')) >>>>>> +endif >>>>> >>>>> This is very wrong. >>>>> >>>>> The win_dump.c file has no association with Windows hosts. It is about >>>>> creating crash dumps of Windows *guests* in the Windows dump format. The >>>>> current conditional which builds it on TARGET_X86_64 is correct. >>>> >>>> Great to know this is a *guest* feature and not a *host* one. >>>> >>>> Something else is currently wrong, because this file is built with >>>> qemu-system-avr on macOS. >>> >>> Why is that a problem ? >> >> Single binary can not be linked because each target has these same symbols. > > So we need a make 'win_dump_available()' into a runtime check against > the current target == x86, and then unconditionally build the rest of > the file ? How do we provide access to target specific types in such > builds as merely removing the #ifdef shows missing X86CPU / CPUX86State > types for most targets. I went with using a new Kconfig symbol in v2, see: http://lore.kernel.org/qemu-devel/20260108161220.15146-5-philmd@linaro.org/ ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-01-08 16:17 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-07 18:05 [PATCH 0/2] dump/win_dump: Build almost once Philippe Mathieu-Daudé 2026-01-07 18:05 ` [PATCH 1/2] dump/win_dump: Abort in create_win_dump() on non-x86 hosts Philippe Mathieu-Daudé 2026-01-08 8:24 ` Marc-André Lureau 2026-01-07 18:05 ` [PATCH 2/2] dump/win_dump: Use stubs on non-Windows hosts like POSIX Philippe Mathieu-Daudé 2026-01-08 8:26 ` Marc-André Lureau 2026-01-08 9:11 ` Daniel P. Berrangé 2026-01-08 10:51 ` Philippe Mathieu-Daudé 2026-01-08 10:53 ` Daniel P. Berrangé 2026-01-08 11:14 ` Philippe Mathieu-Daudé 2026-01-08 11:36 ` Daniel P. Berrangé 2026-01-08 16:16 ` Philippe Mathieu-Daudé
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.