From: Anthony PERARD <anthony.perard@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Stefano Stabellini <sstabellini@kernel.org>,
qemu-devel@nongnu.org, Paul Durrant <paul@xen.org>
Subject: Re: [PATCH v2] xen: fix build without pci passthrough
Date: Tue, 19 May 2020 16:52:58 +0100 [thread overview]
Message-ID: <20200519155258.GC2105@perard.uk.xensource.com> (raw)
In-Reply-To: <20200519143101.75330-1-roger.pau@citrix.com>
On Tue, May 19, 2020 at 04:31:01PM +0200, Roger Pau Monne wrote:
> has_igd_gfx_passthru is only available when QEMU is built with
> CONFIG_XEN_PCI_PASSTHROUGH, and hence shouldn't be used in common
> code without checking if it's available.
>
> Fixes: 46472d82322d0 ('xen: convert "-machine igd-passthru" to an accelerator property')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Paul Durrant <paul@xen.org>
> Cc: xen-devel@lists.xenproject.org
> ---
> Changes since v1:
> - Do not include osdep in header file.
> - Always add the setters/getters of igd-passthru, report an error
> when attempting to set igd-passthru without built in
> pci-passthrough support.
> ---
> hw/xen/xen-common.c | 4 ++++
> hw/xen/xen_pt.h | 6 ++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c
> index 70564cc952..d758770da0 100644
> --- a/hw/xen/xen-common.c
> +++ b/hw/xen/xen-common.c
> @@ -134,7 +134,11 @@ static bool xen_get_igd_gfx_passthru(Object *obj, Error **errp)
>
> static void xen_set_igd_gfx_passthru(Object *obj, bool value, Error **errp)
> {
> +#ifdef CONFIG_XEN_PCI_PASSTHROUGH
> has_igd_gfx_passthru = value;
> +#else
> + error_setg(errp, "Xen PCI passthrough support not built in");
> +#endif
> }
>
There's an issue that I haven't thought about before.
CONFIG_XEN_PCI_PASSTHROUGH is never defined in xen-common.c. So
xen_set_igd_gfx_passthru will always return an error.
I'm not sure what to do about that yet, maybe change the way that
CONFIG_ is defined, or maybe have have the setter/getter in xen_pt.c
with a stub in stubs/ which would return an error. or maybe some other
way.
--
Anthony PERARD
next prev parent reply other threads:[~2020-05-19 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 14:31 [PATCH v2] xen: fix build without pci passthrough Roger Pau Monne
2020-05-19 15:52 ` Anthony PERARD [this message]
2020-05-19 17:48 ` Roger Pau Monné
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=20200519155258.GC2105@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 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).