> +void pt_log(const PCIDevice *d, const char *f, ...) > +{ > + va_list ap; > + > + va_start(ap, f); > + if (d) { > + fprintf(stderr, "[%02x:%02x.%x] ", pci_bus_num(d->bus),
%02x.%d > + PCI_SLOT(d->devfn), PCI_FUNC(d->devfn)); > + } > + vfprintf(stderr, f, ap); > + va_end(ap); > +} > +static uint32_t pt_pci_read_config(PCIDevice *d, uint32_t addr, int len) I wish there was some way to combine this function along with the pt_pci_write_config one. They look so similar. Besides that it looks ok.