qga: Improve guest-exec-status error message
authorMarkus Armbruster <armbru@redhat.com>
Tue, 31 Oct 2023 11:10:55 +0000 (12:10 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 17 Nov 2023 09:07:52 +0000 (10:07 +0100)
When the PID passed to guest-exec-status does not exist, we report

    "Invalid parameter 'pid'"

Improve this to

    "PID 1234 does not exist"

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20231031111059.3407803-4-armbru@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
qga/commands.c

index ce172edd2d02dff6518a31a62b3a61a62900af45..88c1c99fe51b55608abd82ce8686fe4ab4e27f8f 100644 (file)
@@ -154,7 +154,7 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)
 
     gei = guest_exec_info_find(pid);
     if (gei == NULL) {
-        error_setg(errp, QERR_INVALID_PARAMETER, "pid");
+        error_setg(errp, "PID " PRId64 " does not exist");
         return NULL;
     }