diff mbox series

[v5,5/5] dump: Add create_win_dump() stub for non-x86 targets

Message ID 20230224073850.84913-6-philmd@linaro.org
State Superseded
Headers show
Series dump: Make most of it target agnostic (build once) | expand

Commit Message

Philippe Mathieu-Daudé Feb. 24, 2023, 7:38 a.m. UTC
Implement the non-x86 create_win_dump(). We can remove
the last TARGET_X86_64 #ifdef'ry in dump.c, which thus
becomes target-independent. Update meson accordingly.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 dump/dump.c      | 2 --
 dump/meson.build | 2 +-
 dump/win_dump.c  | 5 +++++
 3 files changed, 6 insertions(+), 3 deletions(-)

Comments

Thomas Huth Feb. 24, 2023, 7:52 a.m. UTC | #1
On 24/02/2023 08.38, Philippe Mathieu-Daudé wrote:
> Implement the non-x86 create_win_dump(). We can remove
> the last TARGET_X86_64 #ifdef'ry in dump.c, which thus
> becomes target-independent. Update meson accordingly.
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   dump/dump.c      | 2 --
>   dump/meson.build | 2 +-
>   dump/win_dump.c  | 5 +++++
>   3 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/dump/dump.c b/dump/dump.c
> index 0c96c6e735..7260558852 100644
> --- a/dump/dump.c
> +++ b/dump/dump.c
> @@ -2020,9 +2020,7 @@ static void dump_process(DumpState *s, Error **errp)
>       DumpQueryResult *result = NULL;
>   
>       if (s->has_format && s->format == DUMP_GUEST_MEMORY_FORMAT_WIN_DMP) {
> -#ifdef TARGET_X86_64
>           create_win_dump(s, errp);
> -#endif
>       } else if (s->has_format && s->format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
>           create_kdump_vmcore(s, errp);
>       } else {
> diff --git a/dump/meson.build b/dump/meson.build
> index f13b29a849..7b116f1bd7 100644
> --- a/dump/meson.build
> +++ b/dump/meson.build
> @@ -1,4 +1,4 @@
>   softmmu_ss.add(files('dump-hmp-cmds.c'))
>   
> -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
> +softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
>   specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('win_dump.c'))
> diff --git a/dump/win_dump.c b/dump/win_dump.c
> index ff9c5bd339..0152f7330a 100644
> --- a/dump/win_dump.c
> +++ b/dump/win_dump.c
> @@ -487,4 +487,9 @@ bool win_dump_available(Error **errp)
>       return false;
>   }
>   
> +void create_win_dump(DumpState *s, Error **errp)
> +{
> +    win_dump_available(errp);
> +}
> +
>   #endif

Looks good now, indeed! Thanks for tackling this!

  Thomas
Richard Henderson Feb. 24, 2023, 9:10 p.m. UTC | #2
On 2/23/23 21:38, Philippe Mathieu-Daudé wrote:
> -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
> +softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])

You can remove the when: as well, yes?


r~
Philippe Mathieu-Daudé Feb. 25, 2023, 9:45 a.m. UTC | #3
On 24/2/23 22:10, Richard Henderson wrote:
> On 2/23/23 21:38, Philippe Mathieu-Daudé wrote:
>> -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), 
>> snappy, lzo])
>> +softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), 
>> snappy, lzo])
> 
> You can remove the when: as well, yes?

Good point!
diff mbox series

Patch

diff --git a/dump/dump.c b/dump/dump.c
index 0c96c6e735..7260558852 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -2020,9 +2020,7 @@  static void dump_process(DumpState *s, Error **errp)
     DumpQueryResult *result = NULL;
 
     if (s->has_format && s->format == DUMP_GUEST_MEMORY_FORMAT_WIN_DMP) {
-#ifdef TARGET_X86_64
         create_win_dump(s, errp);
-#endif
     } else if (s->has_format && s->format != DUMP_GUEST_MEMORY_FORMAT_ELF) {
         create_kdump_vmcore(s, errp);
     } else {
diff --git a/dump/meson.build b/dump/meson.build
index f13b29a849..7b116f1bd7 100644
--- a/dump/meson.build
+++ b/dump/meson.build
@@ -1,4 +1,4 @@ 
 softmmu_ss.add(files('dump-hmp-cmds.c'))
 
-specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
+softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo])
 specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('win_dump.c'))
diff --git a/dump/win_dump.c b/dump/win_dump.c
index ff9c5bd339..0152f7330a 100644
--- a/dump/win_dump.c
+++ b/dump/win_dump.c
@@ -487,4 +487,9 @@  bool win_dump_available(Error **errp)
     return false;
 }
 
+void create_win_dump(DumpState *s, Error **errp)
+{
+    win_dump_available(errp);
+}
+
 #endif