qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Roger Pau Monne <roger.pau@citrix.com>, qemu-devel@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Paul Durrant <paul@xen.org>
Subject: Re: [PATCH] xen: fix build without pci passthrough
Date: Mon, 4 May 2020 12:35:39 +0200	[thread overview]
Message-ID: <ccf11b67-4aaa-5fb2-e23f-674380b47a13@redhat.com> (raw)
In-Reply-To: <20200504101443.3165-1-roger.pau@citrix.com>

Hi Roger,

On 5/4/20 12:14 PM, 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>

See Kconfig fix suggested here:
https://www.mail-archive.com/xen-devel@lists.xenproject.org/msg61844.html

> ---
> 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
> ---
>   hw/xen/xen-common.c | 4 ++++
>   hw/xen/xen_pt.h     | 7 +++++++
>   2 files changed, 11 insertions(+)
> 
> diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c
> index a15070f7f6..c800862419 100644
> --- a/hw/xen/xen-common.c
> +++ b/hw/xen/xen-common.c
> @@ -127,6 +127,7 @@ static void xen_change_state_handler(void *opaque, int running,
>       }
>   }
>   
> +#ifdef CONFIG_XEN_PCI_PASSTHROUGH
>   static bool xen_get_igd_gfx_passthru(Object *obj, Error **errp)
>   {
>       return has_igd_gfx_passthru;
> @@ -136,6 +137,7 @@ static void xen_set_igd_gfx_passthru(Object *obj, bool value, Error **errp)
>   {
>       has_igd_gfx_passthru = value;
>   }
> +#endif
>   
>   static void xen_setup_post(MachineState *ms, AccelState *accel)
>   {
> @@ -197,11 +199,13 @@ static void xen_accel_class_init(ObjectClass *oc, void *data)
>   
>       compat_props_add(ac->compat_props, compat, G_N_ELEMENTS(compat));
>   
> +#ifdef CONFIG_XEN_PCI_PASSTHROUGH
>       object_class_property_add_bool(oc, "igd-passthru",
>           xen_get_igd_gfx_passthru, xen_set_igd_gfx_passthru,
>           &error_abort);
>       object_class_property_set_description(oc, "igd-passthru",
>           "Set on/off to enable/disable igd passthrou", &error_abort);
> +#endif
>   }
>   
>   #define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen")
> 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"
>   #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
> +
>   static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
>   {
>       return (has_igd_gfx_passthru
> 



  reply	other threads:[~2020-05-04 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 10:14 [PATCH] xen: fix build without pci passthrough Roger Pau Monne
2020-05-04 10:35 ` Philippe Mathieu-Daudé [this message]
2020-05-04 10:45   ` Roger Pau Monné
2020-05-11  8:14 ` Roger Pau Monné
2020-05-11 13:40 ` Anthony PERARD
2020-05-19 11:28   ` Roger Pau Monné
2020-05-19 12:20     ` Peter Maydell
2020-05-19 14:15       ` 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=ccf11b67-4aaa-5fb2-e23f-674380b47a13@redhat.com \
    --to=philmd@redhat.com \
    --cc=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).