Now that all targets implement this interface, we can replace the
cpu_get_note_size() call with the new interface. We still pick the
first_cpu, which will have to be adapted when we introduce heterogeneous
emulation.

A target implementing get_dump_info is expected to implement
get_note_size as well, so we include this check before calling
get_dump_info.

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 dump/dump.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dump/dump.c b/dump/dump.c
index e43e41838fa..6c3bfe6bf5c 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1860,6 +1860,7 @@ static void dump_init(DumpState *s, int fd, bool 
has_format,
     const SysemuCPUOps *sysemu_ops =
         first_cpu ? CPU_GET_CLASS(first_cpu)->sysemu_ops : NULL;
     if (!sysemu_ops || !sysemu_ops->get_dump_info ||
+        !sysemu_ops->get_note_size ||
         sysemu_ops->get_dump_info(first_cpu, &s->dump_info,
                                   &s->guest_phys_blocks) < 0) {
         error_setg(errp,
@@ -1871,8 +1872,8 @@ static void dump_init(DumpState *s, int fd, bool 
has_format,
         s->dump_info.page_size = qemu_target_page_size();
     }
 
-    s->note_size = cpu_get_note_size(s->dump_info.d_class,
-                                     s->dump_info.d_machine, nr_cpus);
+    s->note_size = sysemu_ops->get_note_size(first_cpu, s->dump_info.d_class,
+                                             s->dump_info.d_machine, nr_cpus);
     assert(s->note_size >= 0);
 
     /*
-- 
2.43.0


Reply via email to