Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-07 Thread Olaf Hering
Am Wed, 2 Jun 2021 13:41:02 +0200 schrieb Juergen Gross : > Shouldn't you check for zero length iovec elements as in the > writev_exact() case then? It is not clear to me what the purpose of skipping zero-length iov's at the beginning of the iov array in writev_exact is. I assume the syscall (o

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-07 Thread Olaf Hering
Am Wed, 2 Jun 2021 13:41:02 +0200 schrieb Juergen Gross : > Shouldn't you check for zero length iovec elements as in the > writev_exact() case then? I will double check if this is a hard requirement. Olaf pgpz4DuTfvQEM.pgp Description: Digitale Signatur von OpenPGP

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-02 Thread Juergen Gross
On 02.06.21 12:57, Olaf Hering wrote: Am Wed, 2 Jun 2021 08:30:08 +0200 schrieb Juergen Gross : On 01.06.21 18:10, Olaf Hering wrote: +int readv_exact(int fd, const struct iovec *iov, int iovcnt) +if ( len <= 0 ) +{ +rc = -1; Is EOF really an error? I think ye

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-02 Thread Olaf Hering
Am Wed, 2 Jun 2021 12:57:10 +0200 schrieb Olaf Hering : > > This will stop the loop, even if idx hasn't reached iovcnt. > > Yes, it will trigger yet another readv(). > > The "while" might be a leftover from a variant which used repeated read_exact > to finish the function. It should become a

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-02 Thread Olaf Hering
Am Wed, 2 Jun 2021 08:30:08 +0200 schrieb Juergen Gross : > On 01.06.21 18:10, Olaf Hering wrote: > > +int readv_exact(int fd, const struct iovec *iov, int iovcnt) > > +if ( len <= 0 ) > > +{ > > +rc = -1; > Is EOF really an error? I think yes, that's what "exact" i

Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-01 Thread Juergen Gross
On 01.06.21 18:10, Olaf Hering wrote: Read a batch of iovec's. In the common case of short reads, finish individual iov's with read_exact. Signed-off-by: Olaf Hering --- tools/libs/ctrl/xc_private.c | 55 +++- tools/libs/ctrl/xc_private.h | 1 + 2 files cha

[PATCH v20210601 04/38] tools: add readv_exact to libxenctrl

2021-06-01 Thread Olaf Hering
Read a batch of iovec's. In the common case of short reads, finish individual iov's with read_exact. Signed-off-by: Olaf Hering --- tools/libs/ctrl/xc_private.c | 55 +++- tools/libs/ctrl/xc_private.h | 1 + 2 files changed, 55 insertions(+), 1 deletion(-) diff