On 12/12/24 16:57, Paolo Bonzini wrote:
In case of incorrect parameters, kvm_convert_memory() was returning
-1 instead of -EINVAL. The guest won't notice because it will move
anyway to RUN_STATE_INTERNAL_ERROR, but fix this for consistency and
clarity.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
accel/kvm/kvm-all.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Please include a brief docstring:
-- >8 --
diff --git a/include/system/kvm.h b/include/system/kvm.h
index c3a60b28909..923bb07d73d 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -576,6 +576,11 @@ int kvm_create_guest_memfd(uint64_t size, uint64_t
flags, Error **errp);
int kvm_set_memory_attributes_private(hwaddr start, uint64_t size);
int kvm_set_memory_attributes_shared(hwaddr start, uint64_t size);
+/**
+ * kvm_convert_memory:
+ *
+ * Returns: 0 on success, or a negative errno on failure.
+ */
int kvm_convert_memory(hwaddr start, hwaddr size, bool to_private);
#endif
---
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>