All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Luigi Leonardi <leonardi@redhat.com>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Ani Sinha <anisinha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] igvm: populate errp in stub functions
Date: Tue, 9 Jun 2026 14:25:01 +0100	[thread overview]
Message-ID: <aigULaw73khPNxoR@redhat.com> (raw)
In-Reply-To: <20260609-igvm_stubs-v1-1-5f39d6e0db4a@redhat.com>

On Tue, Jun 09, 2026 at 03:20:14PM +0200, Luigi Leonardi wrote:
> Use error_setg() to report that IGVM is not available, matching
> the pattern used by other stubs in the tree.
> 
> Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
> Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
> ---
>  stubs/igvm.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/stubs/igvm.c b/stubs/igvm.c
> index 9e9f683fc9..dfb85eb548 100644
> --- a/stubs/igvm.c
> +++ b/stubs/igvm.c
> @@ -17,15 +17,18 @@ int qigvm_x86_get_mem_map_entry(int index,
>                                  ConfidentialGuestMemoryMapEntry *entry,
>                                  Error **errp)
>  {
> +    error_setg(errp, "IGVM not supported on this platform");
>      return -1;
>  }
>  
>  int qigvm_x86_set_vp_context(void *data, int index, Error **errp)
>  {
> +    error_setg(errp, "IGVM not supported on this platform");
>      return -1;
>  }
>  
>  int qigvm_directive_madt(QIgvm *ctx, const uint8_t *header_data, Error **errp)
>  {
> +    error_setg(errp, "IGVM not supported on this platform");
>      return -1;
>  }

This is not wrong per-se, so on that  basis

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

but are any of these stubs actually reachable when IGVM is not
enabled in the build ? Usually with stubs we find that one
or two methods are the primary entrypoints which must return
an error, at which point everything else becomes unreachable.
The latter cases can just be g_assert_not_reached() as a sanity
check that some unexpected codepath isn't calling in without
checking status earlier. Those would thus would not need
error_setg, nor a 'return' statement.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  reply	other threads:[~2026-06-09 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 13:20 [PATCH] igvm: populate errp in stub functions Luigi Leonardi
2026-06-09 13:25 ` Daniel P. Berrangé [this message]
2026-06-09 13:43   ` Markus Armbruster
2026-06-09 14:02   ` Luigi Leonardi

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=aigULaw73khPNxoR@redhat.com \
    --to=berrange@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=leonardi@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.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.