From: Ian Jackson Date: Tue, 31 Mar 2009 10:41:09 +0000 (+0100) Subject: ioemu: Read pass-through vslot from xend X-Git-Tag: xen-3.4.0-rc2~23 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=239e32d920f35166147ae2e7ab3d61e34819fa0c;p=qemu-xen-3.4-testing.git ioemu: Read pass-through vslot from xend This reads the vslot information supplied by xend, and should be the final piece for this feature on the ioemu side. There is also a xend portion of this patch which I will post separately. Signed-off-by: Simon Horman --- diff --git a/xenstore.c b/xenstore.c index ef7b5f34..67bae635 100644 --- a/xenstore.c +++ b/xenstore.c @@ -584,6 +584,24 @@ void xenstore_parse_domain_config(int hvm_domid) strcat(direct_pci_str, dev); + if (pasprintf(&buf, "/local/domain/0/backend/pci/%u/%u/vslot-%d", + hvm_domid, pci_devid, i) != -1) { + free(dev); + dev = xs_read(xsh, XBT_NULL, buf, &len); + } + if ( dev ) { + if (strlen(dev) + strlen(direct_pci_str) > + DIRECT_PCI_STR_LEN - 2) { + fprintf(stderr, "qemu: too many pci pass-through " + "devices\n"); + memset(direct_pci_str, 0, DIRECT_PCI_STR_LEN); + goto out; + } + strcat(direct_pci_str, "@"); + strcat(direct_pci_str, dev); + } + + if (pasprintf(&buf, "/local/domain/0/backend/pci/%u/%u/opts-%d", hvm_domid, pci_devid, i) != -1) { free(dev);