[PATCH 3/7] qga: Improve guest-exec-status error message

Markus Armbruster posted 7 patches 1 year ago
Maintainers: Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Harsh Prateek Bora <harshpb@linux.ibm.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Jason Wang <jasowang@redhat.com>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
[PATCH 3/7] qga: Improve guest-exec-status error message
Posted by Markus Armbruster 1 year ago
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>
---
 qga/commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qga/commands.c b/qga/commands.c
index ce172edd2d..88c1c99fe5 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -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;
     }
 
-- 
2.41.0
Re: [PATCH 3/7] qga: Improve guest-exec-status error message
Posted by Philippe Mathieu-Daudé 1 year ago
On 31/10/23 12:10, Markus Armbruster wrote:
> 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>
> ---
>   qga/commands.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH 3/7] qga: Improve guest-exec-status error message
Posted by Konstantin Kostiuk 1 year ago
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Tue, Oct 31, 2023 at 1:11 PM Markus Armbruster <armbru@redhat.com> wrote:

> 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>
> ---
>  qga/commands.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qga/commands.c b/qga/commands.c
> index ce172edd2d..88c1c99fe5 100644
> --- a/qga/commands.c
> +++ b/qga/commands.c
> @@ -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;
>      }
>
> --
> 2.41.0
>
>