Re: [Xen-devel] [PATCH v2 02/10] pc: remove has_igd_gfx_passthru global

2015-12-17 Thread Gerd Hoffmann
> > +return (qdev_get_machine->igd_gfx_passthru
> >  && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
> >  }
> 
> Doesn't compile:
> 
> qemu/hw/xen/xen_pt.h: In function ‘is_igd_vga_passthrough’:
> qemu/hw/xen/xen_pt.h:325:29: error: request for member ‘igd_gfx_passthru’ in 
> something not a structure or union
>  return (qdev_get_machine->igd_gfx_passthru

Incremental fix attached (will squash into v2).

cheers,
  Gerd

From b30226140f80202c4d2dda23acae9533aba6136b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann 
Date: Fri, 18 Dec 2015 08:44:48 +0100
Subject: [PATCH] [fixup] build on xen

---
 hw/xen/xen_pt.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index 6d8702b..680fe6e 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -4,6 +4,7 @@
 #include "qemu-common.h"
 #include "hw/xen/xen_common.h"
 #include "hw/pci/pci.h"
+#include "hw/boards.h"
 #include "xen-host-pci-device.h"
 
 void xen_pt_log(const PCIDevice *d, const char *f, ...) GCC_FMT_ATTR(2, 3);
@@ -322,7 +323,8 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice *dev,
 unsigned int function);
 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
 {
-return (qdev_get_machine->igd_gfx_passthru
+MachineState *machine = MACHINE(qdev_get_machine());
+return (machine->igd_gfx_passthru
 && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
 }
 int xen_pt_register_vga_regions(XenHostPCIDevice *dev);
-- 
1.8.3.1

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v2 02/10] pc: remove has_igd_gfx_passthru global

2015-12-17 Thread Eduardo Habkost
On Mon, Dec 14, 2015 at 12:39:34PM +0100, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann 
> ---
>  hw/xen/xen_pt.h |  3 +--
>  vl.c| 10 --
>  2 files changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
> index c545280..6d8702b 100644
> --- a/hw/xen/xen_pt.h
> +++ b/hw/xen/xen_pt.h
> @@ -320,10 +320,9 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice 
> *dev,
>  unsigned int domain,
>  unsigned int bus, unsigned int 
> slot,
>  unsigned int function);
> -extern bool has_igd_gfx_passthru;
>  static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
>  {
> -return (has_igd_gfx_passthru
> +return (qdev_get_machine->igd_gfx_passthru
>  && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
>  }

Doesn't compile:

qemu/hw/xen/xen_pt.h: In function ‘is_igd_vga_passthrough’:
qemu/hw/xen/xen_pt.h:325:29: error: request for member ‘igd_gfx_passthru’ in 
something not a structure or union
 return (qdev_get_machine->igd_gfx_passthru
 ^

-- 
Eduardo

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH v2 02/10] pc: remove has_igd_gfx_passthru global

2015-12-14 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann 
---
 hw/xen/xen_pt.h |  3 +--
 vl.c| 10 --
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index c545280..6d8702b 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -320,10 +320,9 @@ extern void *pci_assign_dev_load_option_rom(PCIDevice *dev,
 unsigned int domain,
 unsigned int bus, unsigned int 
slot,
 unsigned int function);
-extern bool has_igd_gfx_passthru;
 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
 {
-return (has_igd_gfx_passthru
+return (qdev_get_machine->igd_gfx_passthru
 && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
 }
 int xen_pt_register_vga_regions(XenHostPCIDevice *dev);
diff --git a/vl.c b/vl.c
index 4211ff1..e45a1da 100644
--- a/vl.c
+++ b/vl.c
@@ -1365,13 +1365,6 @@ static inline void semihosting_arg_fallback(const char 
*file, const char *cmd)
 }
 }
 
-/* Now we still need this for compatibility with XEN. */
-bool has_igd_gfx_passthru;
-static void igd_gfx_passthru(void)
-{
-has_igd_gfx_passthru = current_machine->igd_gfx_passthru;
-}
-
 /***/
 /* USB devices */
 
@@ -4550,9 +4543,6 @@ int main(int argc, char **argv, char **envp)
 exit(1);
 }
 
-/* Check if IGD GFX passthrough. */
-igd_gfx_passthru();
-
 /* init generic devices */
 if (qemu_opts_foreach(qemu_find_opts("device"),
   device_init_func, NULL, NULL)) {
-- 
1.8.3.1


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel