[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl
- To: Juergen Gross <jgross@xxxxxxxx>
- From: Olaf Hering <olaf@xxxxxxxxx>
- Date: Mon, 7 Jun 2021 13:31:33 +0200
- Arc-authentication-results: i=1; strato.com; dkim=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623065508; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=tSUe+mhW0778pNVSSqM5Qlq2C/BzFqClSM00cyxyRzk=; b=NdNWynOoUorQUmF4+sypuCjJlvDOYuUOoNx5coBcjsUPzUxQQe88kORYKqEdHZ4KsG h2MHkFq3WkpjHitp3+EvVODbJwdOtW4l/iGmqkR+S9Q7R8dSaItB5JSqUC+eNxsrfVST 7ahxRaHsEM7bP529/VdSKjMFQezR9qQmaNBeZ+aCVQ6rB04OvP3HbOgeQYHTka5RXSjI nMzFpu1DVlLSpmZsTg60F86H/fZyyKqtXK0SO1nLSQLynAJolzlaTcTHK5Q8dGlBMyUB wXoFuHR1eY3EiTGqfCly5tFaVe3alCjUJJJSBCO+h4AzUW2PiFuWe/469B3ccFU2D3QF vE2Q==
- Arc-seal: i=1; a=rsa-sha256; t=1623065508; cv=none; d=strato.com; s=strato-dkim-0002; b=OxbxY5O8QxF1r5z5FQ2va6VasBaxrZMIKLr6BfKeojnVXHcWK3hfko1KXEpF509C5e 2RtlNfAyjiGP4r98jUnV1TfjKMFExHLGgtrE5pOAMZWxSGA0kVO2oD4WKqrZUEGH5kj+ Q6HEH96r0hiiXH41iO0vzNQrRWPh4X3FfSQDjjgc6IA6oVG8cLcfzL6HrEhX+WMz2pZI 3LeruEvVfBw/qpfn3v8MO169JMxO7nUZufEjCN29fFfBiWcEwoMHF3mbMFW5F0cphpyv 9N+oIse76rlz20vn/3nF01nweqKlI7CMmsAE5zumovcMJ6fDugdblos8opfp2S6zRkJf T1sg==
- Authentication-results: strato.com; dkim=none
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 07 Jun 2021 11:32:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Am Wed, 2 Jun 2021 13:41:02 +0200
schrieb Juergen Gross <jgross@xxxxxxxx>:
> 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 (or libc) will just skip them anyway. The code would not
handle empty iov's in the middle of the array. Perhaps writev_exact should be
done in the same way as my readv_exact, that would also remove the need for
malloc. I think in the past I had a patch to do just that. Maybe just locally,
maybe I sent it to this list.
In case of readv_exact, only the trailing incomplete iov will be filled with
read_exact. I think the length parameter for read_exact can not become zero,
"len" would already be zero. Zero-length iov's will be skipped by the loop
AFAICS.
Olaf
Attachment:
pgp9Q3eYW0bAc.pgp
Description: Digitale Signatur von OpenPGP
|