[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Xen-devel] [PATCH v3 07/11] igd: revamp host config re
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [Xen-devel] [PATCH v3 07/11] igd: revamp host config read |
Date: |
Wed, 6 Jan 2016 16:23:07 +0000 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Wed, 6 Jan 2016, Gerd Hoffmann wrote:
> > > + 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 though, not a socket or pipe where a partial read
> makes sense and will actually happen. If we can't read something
> that'll be because the kernel denies access.
>
> So IMHO it should be fine to treat anything which doesn't give us the
> amount of bytes we asked for as an error condition.
True, still theoretically, it's possible for pread to return early. Who
knows what glibc and linux are going to do in the future.
- Re: [Qemu-devel] [PATCH v3 05/11] igd: TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE: call parent realize, (continued)
[Qemu-devel] [PATCH v3 08/11] igd: add q35 support, Gerd Hoffmann, 2016/01/05
[Qemu-devel] [PATCH v3 03/11] pc: move igd support code to igd.c, Gerd Hoffmann, 2016/01/05
[Qemu-devel] [PATCH v3 07/11] igd: revamp host config read, Gerd Hoffmann, 2016/01/05
[Qemu-devel] [PATCH v3 10/11] igd: handle igd-passthrough-isa-bridge setup in realize(), Gerd Hoffmann, 2016/01/05
[Qemu-devel] [PATCH v3 09/11] igd: move igd-passthrough-isa-bridge to igd.c too, Gerd Hoffmann, 2016/01/05
[Qemu-devel] [PATCH v3 11/11] igd: move igd-passthrough-isa-bridge creation to machine init, Gerd Hoffmann, 2016/01/05