All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [v3][PATCH 0/1] qemu:pci-assign: try to pci-assign.c
@ 2014-09-01 10:36 Tiejun Chen
  2014-09-01 10:36 ` [Qemu-devel] [v3][PATCH 1/1] hw/pci-assign: split pci-assign.c Tiejun Chen
  0 siblings, 1 reply; 7+ messages in thread
From: Tiejun Chen @ 2014-09-01 10:36 UTC (permalink / raw)
  To: mst, aliguori; +Cc: qemu-devel

v3:

* Don't move out those common structures.
* Just include minimum required head file.
* Rename dev_load_option_rom with pci_assign_dev_load_option_rom to avoid
  global namespace pollution.

v2:

* v1 is making so much code inline, so try to move it to an out of line file.
* rename pci-assign not pci_assign.

A you know I'm working on supporting IGD passthrough.

Here we need load VGABIOS to work out IGD case. Obviously something may
be duplicated to kvm codes, we should unify some codes but looks its not
easy to finish that in short time. So as Michael suggestion, at least
we'd better split assigned_dev_load_option_rom to reuse on both kvm
and xen.

I don't finish all IGD stuff patches but here I'd like to post
some related codes to show how to use assigned_dev_load_option_rom()
lately.

+static int get_vgabios(XenPCIPassthroughState *s, void *ptr,
+                       XenHostPCIDevice *dev)
+{
+    int size = 0;
+
+    size = dev_load_option_rom(&s->dev, OBJECT(dev), ptr, dev->domain,
+                               dev->bus, dev->dev, dev->func);
+
+    return size;
+}
+
+int xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev)
+{
+    void *bios = NULL;
+    int bios_size = 0;
+    int rc = 0;
+
+    if (!is_vga_passthrough(dev)) {
+        return rc;
+    }
+
+    bios_size = get_vgabios(s, bios, dev);
+    if (!bios || !bios_size) {
+        XEN_PT_ERR(NULL, "VGA: getting VBIOS!\n");
+        rc = -1;
+        goto out;
+    }
...

----------------------------------------------------------------
Tiejun Chen (1):
      hw/pci-assign: split pci-assign.c
 
 hw/i386/kvm/pci-assign.c    | 46 ++++++++++++++++++++++++++++++----------------
 include/hw/pci/pci-assign.h | 16 ++++++++++++++++
 2 files changed, 46 insertions(+), 16 deletions(-)
 create mode 100644 include/hw/pci/pci-assign.h

Thanks
Tiejun

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-01 11:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01 10:36 [Qemu-devel] [v3][PATCH 0/1] qemu:pci-assign: try to pci-assign.c Tiejun Chen
2014-09-01 10:36 ` [Qemu-devel] [v3][PATCH 1/1] hw/pci-assign: split pci-assign.c Tiejun Chen
2014-09-01 10:46   ` Michael S. Tsirkin
2014-09-01 10:56     ` Chen, Tiejun
2014-09-01 11:08       ` Michael S. Tsirkin
2014-09-01 11:15         ` Chen, Tiejun
2014-09-01 11:19           ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.