[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen: fix build without pci passthrough


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 19 May 2020 16:52:58 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Tue, 19 May 2020 15:53:25 +0000
  • Ironport-sdr: El7oOCcy1szBJ5zYjhYjThPqPzQODLg8uLNYfOHWUvO6Kb3R3YqEhEkxJkWmWZu7/B9Dmmdh9q GrymMtBPqIErwSlD4nIxYx7YidRjO4QcnRPw+jwHHBlMBV0c+roR0b/1UvaHr+pCE2Vl0Wml8t ASWDpvsj54Cb16cDC1gjtudozZkVsB31t9vWpeHYDfUcS6T2bsA00AnUwqRi/gHMORBFBkGgOy lsq6UaA/bSMbr7DqErUgz4vU/5Otv2jm06g8UtW9KNyXaHE7rr5cPxUJAsUC9F00uU07R2xbeA KJs=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxx>
> ---
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
> Cc: Paul Durrant <paul@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> ---
> 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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.