All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Hyman Huang <yong.huang@smartx.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH] i386/sev: Nitpick at the error message's output
Date: Fri, 5 Jan 2024 16:22:38 +0000	[thread overview]
Message-ID: <ZZgszhW30kyNnbEj@redhat.com> (raw)
In-Reply-To: <c5033954155dfe256f650fc9ca2084c688356317.1704469721.git.yong.huang@smartx.com>

On Sat, Jan 06, 2024 at 12:09:55AM +0800, Hyman Huang wrote:
> The incorrect error message was produced as a result of
> the return number being disregarded on the sev_kvm_init
> failure path.
> 
> For instance, when a user's failure to launch a SEV guest
> is caused by an incorrect IOCTL, the following message is
> reported:
> 
> kvm: sev_kvm_init: failed to initialize ret=-25 fw_error=0
> kvm: failed to initialize kvm: Operation not permitted
> 
> While the error message's accurate output should be:
> 
> kvm: sev_kvm_init: failed to initialize ret=-25 fw_error=0
> kvm: failed to initialize kvm: Inappropriate ioctl for device
> 
> Fix this by returning the return number directly on the
> failure path.
> 
> Signed-off-by: Hyman Huang <yong.huang@smartx.com>
> ---
>  target/i386/sev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


> 
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index 9a71246682..4a69ca457c 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -1019,7 +1019,7 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
>  err:
>      sev_guest = NULL;
>      ram_block_discard_disable(false);
> -    return -1;
> +    return ret;
>  }

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2024-01-05 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 16:09 [PATCH] i386/sev: Nitpick at the error message's output Hyman Huang
2024-01-05 16:22 ` Daniel P. Berrangé [this message]
2024-01-05 16:43 ` Alex Bennée
2024-01-07 11:49   ` Yong Huang

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=ZZgszhW30kyNnbEj@redhat.com \
    --to=berrange@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yong.huang@smartx.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 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.