qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Zhao Liu <zhao1.liu@intel.com>, qemu-devel@nongnu.org
Cc: Michael Roth <michael.roth@amd.com>,
	Konstantin Kostiuk <kkostiuk@redhat.com>
Subject: Re: [PATCH v2] qga/commands-posix: Make ga_wait_child() return boolean
Date: Wed, 17 Jul 2024 12:25:15 +0200	[thread overview]
Message-ID: <a6d1f8a4-5c1f-4dcf-b0dc-c1a019e8ba78@linaro.org> (raw)
In-Reply-To: <20240716162351.270095-1-zhao1.liu@intel.com>

Hi Konstantin,

If there are no other patches on your guest-agent queue,
I can take this patch in my next pull request.

Regards,

Phil.

On 16/7/24 18:23, Zhao Liu wrote:
> Make ga_wait_child() return boolean and check the returned boolean
> in ga_run_command() instead of dereferencing @errp.
> 
> Cc: Michael Roth <michael.roth@amd.com>
> Cc: Konstantin Kostiuk <kkostiuk@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
> v2:
>   * Added Phil's r/b.
>   * Used Phil's polished words.
> ---
>   qga/commands-posix.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 7f05996495a2..64bb0be94479 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -59,7 +59,7 @@
>   #endif
>   #endif
>   
> -static void ga_wait_child(pid_t pid, int *status, Error **errp)
> +static bool ga_wait_child(pid_t pid, int *status, Error **errp)
>   {
>       pid_t rpid;
>   
> @@ -70,10 +70,11 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp)
>       if (rpid == -1) {
>           error_setg_errno(errp, errno, "failed to wait for child (pid: %d)",
>                            pid);
> -        return;
> +        return false;
>       }
>   
>       g_assert(rpid == pid);
> +    return true;
>   }
>   
>   static ssize_t ga_pipe_read_str(int fd[2], char **str)
> @@ -178,8 +179,7 @@ static int ga_run_command(const char *argv[], const char *in_str,
>           goto out;
>       }
>   
> -    ga_wait_child(pid, &status, errp);
> -    if (*errp) {
> +    if (!ga_wait_child(pid, &status, errp)) {
>           goto out;
>       }
>   



  reply	other threads:[~2024-07-17 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 16:23 [PATCH v2] qga/commands-posix: Make ga_wait_child() return boolean Zhao Liu
2024-07-17 10:25 ` Philippe Mathieu-Daudé [this message]
2024-07-17 13:12   ` Konstantin Kostiuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6d1f8a4-5c1f-4dcf-b0dc-c1a019e8ba78@linaro.org \
    --to=philmd@linaro.org \
    --cc=kkostiuk@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).