61 lines
1.9 KiB
Diff
61 lines
1.9 KiB
Diff
|
|
From 0c24a55d582e8219b64f2090cbdd21027d496bb1 Mon Sep 17 00:00:00 2001
|
||
|
|
From: boringandboring <wangjinlei_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Mon, 27 Nov 2023 10:44:31 +0800
|
||
|
|
Subject: [PATCH] balloon: Fix a misleading error message
|
||
|
|
|
||
|
|
cherry picked from eeef44b3a583637265f602882a0d058a52e3a33b
|
||
|
|
|
||
|
|
The error message
|
||
|
|
|
||
|
|
{"execute": "balloon", "arguments":{"value": -1}}
|
||
|
|
{"error": {"class": "GenericError", "desc": "Parameter 'target' expects a size"}}
|
||
|
|
|
||
|
|
points to 'target' instead of 'value'. Fix:
|
||
|
|
|
||
|
|
{"error": {"class": "GenericError", "desc": "Parameter 'value' expects a size"}}
|
||
|
|
|
||
|
|
Root cause: qmp_balloon()'s parameter is named @target. Rename it to
|
||
|
|
@value to match the QAPI schema.
|
||
|
|
|
||
|
|
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
||
|
|
Message-ID: <20231031111059.3407803-7-armbru@redhat.com>
|
||
|
|
Reviewed-by: David Hildenbrand <david@redhat.com>
|
||
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
||
|
|
Tested-by: Mario Casquero <mcasquer@redhat.com>
|
||
|
|
|
||
|
|
Signed-off-by: boringandboring <wangjinlei_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
softmmu/balloon.c | 10 +++++-----
|
||
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/softmmu/balloon.c b/softmmu/balloon.c
|
||
|
|
index e0e8969a4b..fda7af832e 100644
|
||
|
|
--- a/softmmu/balloon.c
|
||
|
|
+++ b/softmmu/balloon.c
|
||
|
|
@@ -90,17 +90,17 @@ BalloonInfo *qmp_query_balloon(Error **errp)
|
||
|
|
return info;
|
||
|
|
}
|
||
|
|
|
||
|
|
-void qmp_balloon(int64_t target, Error **errp)
|
||
|
|
+void qmp_balloon(int64_t value, Error **errp)
|
||
|
|
{
|
||
|
|
if (!have_balloon(errp)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
- if (target <= 0) {
|
||
|
|
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
|
||
|
|
+ if (value <= 0) {
|
||
|
|
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "value", "a size");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
- trace_balloon_event(balloon_opaque, target);
|
||
|
|
- balloon_event_fn(balloon_opaque, target);
|
||
|
|
+ trace_balloon_event(balloon_opaque, value);
|
||
|
|
+ balloon_event_fn(balloon_opaque, value);
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|