All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Bogorodskiy <bogorodskiy@gmail.com>
To: Brad Smith <brad@comstyle.com>
Cc: Michael Roth <michael.roth@amd.com>,
	Kostiantyn Kostiuk <kkostiuk@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] qga: fix uname() return value check in guest-get-osinfo
Date: Sat, 31 Oct 2026 12:43:00 +0100	[thread overview]
Message-ID: <auXURBeWoOtLaauB@tulp> (raw)
In-Reply-To: <auUjFweAHtj1YSFt@humpty.home.comstyle.com>

  Brad Smith wrote:

> qga: fix uname() return value check in guest-get-osinfo
> 
> POSIX only specifies that uname() returns a non-negative value on
> success. Solaris returns 1, so guest-get-osinfo treated every
> successful call as a failure and reported a stale errno.
> 
> Check for a negative return value instead, as linux-user/uname.c
> already does.
> 
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
>  qga/commands-posix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index dcc683f6c9..23abaf1956 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -1322,7 +1322,7 @@ GuestOSInfo *qmp_guest_get_osinfo(Error **errp)
>  
>      info = g_new0(GuestOSInfo, 1);
>  
> -    if (uname(&kinfo) != 0) {
> +    if (uname(&kinfo) < 0) {
>          error_setg_errno(errp, errno, "uname failed");
>      } else {
>          info->kernel_version = g_strdup(kinfo.version);
> -- 
> 2.56.0
> 
> 

Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>


      reply	other threads:[~2026-10-31 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 23:07 [PATCH] qga: fix uname() return value check in guest-get-osinfo Brad Smith
2026-10-31 11:43 ` Roman Bogorodskiy [this message]

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=auXURBeWoOtLaauB@tulp \
    --to=bogorodskiy@gmail.com \
    --cc=brad@comstyle.com \
    --cc=kkostiuk@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.