[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen: fix build without pci passthrough
From: |
Roger Pau Monné |
Subject: |
Re: [PATCH] xen: fix build without pci passthrough |
Date: |
Tue, 19 May 2020 13:28:06 +0200 |
On Mon, May 11, 2020 at 02:40:43PM +0100, Anthony PERARD wrote:
> On Mon, May 04, 2020 at 12:14:43PM +0200, Roger Pau Monne wrote:
> > diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
> > index 179775db7b..660dd8a008 100644
> > --- a/hw/xen/xen_pt.h
> > +++ b/hw/xen/xen_pt.h
> > @@ -1,6 +1,7 @@
> > #ifndef XEN_PT_H
> > #define XEN_PT_H
> >
> > +#include "qemu/osdep.h"
>
> Why do you need osdep?
For CONFIG_XEN_PCI_PASSTHROUGH IIRC.
>
> > #include "hw/xen/xen_common.h"
> > #include "hw/pci/pci.h"
> > #include "xen-host-pci-device.h"
> > @@ -322,7 +323,13 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice
> > *dev,
> > unsigned int domain,
> > unsigned int bus, unsigned int
> > slot,
> > unsigned int function);
> > +
> > +#ifdef CONFIG_XEN_PCI_PASSTHROUGH
> > extern bool has_igd_gfx_passthru;
> > +#else
> > +# define has_igd_gfx_passthru false
> > +#endif
>
> I don't quite like the use of define here. Could you introduce a
> function that return a bool instead? And defining that function in
> hw/xen/xen.h like xen_enabled() would be fine I think.
But has_igd_gfx_passthru is defined in xen_pt.c which is only compiled
if CONFIG_XEN_PCI_PASSTHROUGH is defined, yet the variable is set from
xen-common.c. I think the former is fine, an any attempt to set
has_igd_gfx_passthru without CONFIG_XEN_PCI_PASSTHROUGH will result in
a compile error which is easier to catch?
Thanks, Roger.