Re: [Qemu-devel] [PATCH v3 07/11] igd: revamp host config read

2016-01-06 Thread Gerd Hoffmann
> > +for (i = 0; i < len; i++) { > > +rc = pread(config_fd, guest->config + list[i].offset, > > + list[i].len, list[i].offset); > > +if (rc != list[i].len) { > > pread is allowed to return early, returning the number of bytes read. > This is a sysfs file tho

Re: [Qemu-devel] [PATCH v3 07/11] igd: revamp host config read

2016-01-06 Thread Stefano Stabellini
On Tue, 5 Jan 2016, Gerd Hoffmann wrote: > Move all work to the host_pci_config_copy helper function, > which we can easily reuse when adding q35 support. > Open sysfs file only once for all values. Use pread. > Proper error handling. Fix bugs: > > * Don't throw away results (like old host_pci_

[Qemu-devel] [PATCH v3 07/11] igd: revamp host config read

2016-01-05 Thread Gerd Hoffmann
Move all work to the host_pci_config_copy helper function, which we can easily reuse when adding q35 support. Open sysfs file only once for all values. Use pread. Proper error handling. Fix bugs: * Don't throw away results (like old host_pci_config_read did because val was passed by value no