Blame SOURCES/kvm-dump-Rename-write_elf-_phdr_note-to-prepare_elf-_phd.patch

62547e
From 18fef7f02801d51207d67b8f8ec5f0d828889c78 Mon Sep 17 00:00:00 2001
62547e
From: Janosch Frank <frankja@linux.ibm.com>
62547e
Date: Thu, 11 Aug 2022 12:11:01 +0000
62547e
Subject: [PATCH 29/42] dump: Rename write_elf*_phdr_note to
62547e
 prepare_elf*_phdr_note
62547e
MIME-Version: 1.0
62547e
Content-Type: text/plain; charset=UTF-8
62547e
Content-Transfer-Encoding: 8bit
62547e
62547e
RH-Author: Cédric Le Goater <clg@redhat.com>
62547e
RH-MergeRequest: 226: s390: Enhanced Interpretation for PCI Functions and Secure Execution guest dump
62547e
RH-Bugzilla: 1664378 2043909
62547e
RH-Acked-by: Thomas Huth <thuth@redhat.com>
62547e
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
62547e
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
62547e
RH-Commit: [29/41] 876cea6f6e51be8df2763f56d0daef99d11fdd49
62547e
62547e
The functions in question do not actually write to the file descriptor
62547e
they set up a buffer which is later written to the fd.
62547e
62547e
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
62547e
Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
62547e
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
62547e
Message-Id: <20220811121111.9878-9-frankja@linux.ibm.com>
62547e
(cherry picked from commit 2341a94d3a0a8a93a5a977e642da1807b8edaab8)
62547e
Signed-off-by: Cédric Le Goater <clg@redhat.com>
62547e
---
62547e
 dump/dump.c | 8 ++++----
62547e
 1 file changed, 4 insertions(+), 4 deletions(-)
62547e
62547e
diff --git a/dump/dump.c b/dump/dump.c
62547e
index 8d5226f861..c2c1341ad7 100644
62547e
--- a/dump/dump.c
62547e
+++ b/dump/dump.c
62547e
@@ -261,7 +261,7 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
62547e
     }
62547e
 }
62547e
 
62547e
-static void write_elf64_phdr_note(DumpState *s, Elf64_Phdr *phdr)
62547e
+static void prepare_elf64_phdr_note(DumpState *s, Elf64_Phdr *phdr)
62547e
 {
62547e
     memset(phdr, 0, sizeof(*phdr));
62547e
     phdr->p_type = cpu_to_dump32(s, PT_NOTE);
62547e
@@ -317,7 +317,7 @@ static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s,
62547e
     write_guest_note(f, s, errp);
62547e
 }
62547e
 
62547e
-static void write_elf32_phdr_note(DumpState *s, Elf32_Phdr *phdr)
62547e
+static void prepare_elf32_phdr_note(DumpState *s, Elf32_Phdr *phdr)
62547e
 {
62547e
     memset(phdr, 0, sizeof(*phdr));
62547e
     phdr->p_type = cpu_to_dump32(s, PT_NOTE);
62547e
@@ -365,11 +365,11 @@ static void write_elf_phdr_note(DumpState *s, Error **errp)
62547e
     int ret;
62547e
 
62547e
     if (dump_is_64bit(s)) {
62547e
-        write_elf64_phdr_note(s, &phdr64);
62547e
+        prepare_elf64_phdr_note(s, &phdr64);
62547e
         size = sizeof(phdr64);
62547e
         phdr = &phdr64;
62547e
     } else {
62547e
-        write_elf32_phdr_note(s, &phdr32);
62547e
+        prepare_elf32_phdr_note(s, &phdr32);
62547e
         size = sizeof(phdr32);
62547e
         phdr = &phdr32;
62547e
     }
62547e
-- 
62547e
2.37.3
62547e