[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 14/21] physmem: replace function name with __func__ in ram
From: |
Xiaoyao Li |
Subject: |
[RFC PATCH v2 14/21] physmem: replace function name with __func__ in ram_block_discard_range() |
Date: |
Wed, 13 Sep 2023 23:51:10 -0400 |
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
softmmu/physmem.c | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 2d98a88f41f0..34d580ec0d39 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -3440,16 +3440,15 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t
start, size_t length)
uint8_t *host_startaddr = rb->host + start;
if (!QEMU_PTR_IS_ALIGNED(host_startaddr, rb->page_size)) {
- error_report("ram_block_discard_range: Unaligned start address: %p",
- host_startaddr);
+ error_report("%s: Unaligned start address: %p",
+ __func__, host_startaddr);
goto err;
}
if ((start + length) <= rb->max_length) {
bool need_madvise, need_fallocate;
if (!QEMU_IS_ALIGNED(length, rb->page_size)) {
- error_report("ram_block_discard_range: Unaligned length: %zx",
- length);
+ error_report("%s: Unaligned length: %zx", __func__, length);
goto err;
}
@@ -3479,27 +3478,26 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t
start, size_t length)
* file.
*/
if (!qemu_ram_is_shared(rb)) {
- warn_report_once("ram_block_discard_range: Discarding RAM"
+ warn_report_once("%s: Discarding RAM"
" in private file mappings is possibly"
" dangerous, because it will modify the"
" underlying file and will affect other"
- " users of the file");
+ " users of the file", __func__);
}
ret = fallocate(rb->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
start, length);
if (ret) {
ret = -errno;
- error_report("ram_block_discard_range: Failed to fallocate "
- "%s:%" PRIx64 " +%zx (%d)",
- rb->idstr, start, length, ret);
+ error_report("%s: Failed to fallocate %s:%" PRIx64 " +%zx
(%d)",
+ __func__, rb->idstr, start, length, ret);
goto err;
}
#else
ret = -ENOSYS;
- error_report("ram_block_discard_range: fallocate not
available/file"
+ error_report("%s: fallocate not available/file"
"%s:%" PRIx64 " +%zx (%d)",
- rb->idstr, start, length, ret);
+ __func__, rb->idstr, start, length, ret);
goto err;
#endif
}
@@ -3517,25 +3515,23 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t
start, size_t length)
}
if (ret) {
ret = -errno;
- error_report("ram_block_discard_range: Failed to discard range
"
+ error_report("%s: Failed to discard range "
"%s:%" PRIx64 " +%zx (%d)",
- rb->idstr, start, length, ret);
+ __func__, rb->idstr, start, length, ret);
goto err;
}
#else
ret = -ENOSYS;
- error_report("ram_block_discard_range: MADVISE not available"
- "%s:%" PRIx64 " +%zx (%d)",
- rb->idstr, start, length, ret);
+ error_report("%s: MADVISE not available %s:%" PRIx64 " +%zx (%d)",
+ __func__, rb->idstr, start, length, ret);
goto err;
#endif
}
trace_ram_block_discard_range(rb->idstr, host_startaddr, length,
need_madvise, need_fallocate, ret);
} else {
- error_report("ram_block_discard_range: Overrun block '%s' (%" PRIu64
- "/%zx/" RAM_ADDR_FMT")",
- rb->idstr, start, length, rb->max_length);
+ error_report("%s: Overrun block '%s' (%" PRIu64 "/%zx/"
RAM_ADDR_FMT")",
+ __func__, rb->idstr, start, length, rb->max_length);
}
err:
--
2.34.1
- Re: [RFC PATCH v2 05/21] kvm: Enable KVM_SET_USER_MEMORY_REGION2 for memslot, (continued)
- [RFC PATCH v2 06/21] i386: Add support for sw-protected-vm object, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 07/21] i386/pc: Drop pc_machine_kvm_type(), Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 08/21] target/i386: Implement mc->kvm_type() to get VM type, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 09/21] target/i386: Introduce kvm_confidential_guest_init(), Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 10/21] i386/kvm: Implement kvm_sw_protected_vm_init() for sw-protcted-vm specific functions, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 11/21] kvm: Introduce support for memory_attributes, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 12/21] kvm/memory: Introduce the infrastructure to set the default shared/private value, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 13/21] i386/kvm: Set memory to default private for KVM_X86_SW_PROTECTED_VM, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 14/21] physmem: replace function name with __func__ in ram_block_discard_range(),
Xiaoyao Li <=
- [RFC PATCH v2 15/21] physmem: extract ram_block_discard_range_fd() from ram_block_discard_range(), Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 17/21] kvm: handle KVM_EXIT_MEMORY_FAULT, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 16/21] physmem: Introduce ram_block_convert_range(), Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 18/21] trace/kvm: Add trace for page convertion between shared and private, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 19/21] pci-host/q35: Move PAM initialization above SMRAM initialization, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 20/21] q35: Introduce smm_ranges property for q35-pci-host, Xiaoyao Li, 2023/09/13
- [RFC PATCH v2 21/21] i386: Disable SMM mode for X86_SW_PROTECTED_VM, Xiaoyao Li, 2023/09/13
- Re: [RFC PATCH v2 00/21] QEMU gmem implemention, David Hildenbrand, 2023/09/14