From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v7 06/14] libxl_qmp: Implementation of libxl__ev_qmp_*
Date: Fri, 4 Jan 2019 11:41:58 +0000 [thread overview]
Message-ID: <20190104114158.GB1508@perard.uk.xensource.com> (raw)
In-Reply-To: <23599.16807.146733.72837@mariner.uk.xensource.com>
On Fri, Jan 04, 2019 at 11:21:11AM +0000, Ian Jackson wrote:
> Anthony PERARD writes ("Re: [PATCH v7 06/14] libxl_qmp: Implementation of libxl__ev_qmp_*"):
> > On Fri, Dec 21, 2018 at 03:36:18PM +0000, Ian Jackson wrote:
> > > > + while (ev->tx_buf_off < ev->tx_buf_len) {
> > > > + r = write(fd, ev->tx_buf + ev->tx_buf_off,
> > > > + ev->tx_buf_len - ev->tx_buf_off);
> > > > + if (r < 0) {
> > > > + if (errno == EINTR)
> > > > + continue;
> > > > + if (errno == EWOULDBLOCK)
> > > > + break;
> > > > + LOGED(ERROR, ev->domid, "failed to write to QMP socket");
> > > > + return ERROR_FAIL;
> > > > + }
> > > > + ev->tx_buf_off += r;
> > >
> > > Can you assert that the value of r was within range ? (Perhaps this
> > > is paranoia on my part, but, still.)
> >
> > I do assert the value of tx_buf_off which does include r.
> > But I can add
> > `assert(r > 0 && r <= (ev->rx_buf_size - ev->rx_buf_used));'.
>
> Yes. As I say worrying that write() might return something insane is
> perhaps paranoia.
>
> Do you mean `ev->tx_buf_len - ev->tx_buf_off' like in the write call ?
I was looking at the wrong function :(.
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-01-04 11:42 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-23 13:53 [PATCH v7 00/14] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_* Anthony PERARD
2018-11-23 13:53 ` [PATCH v7 01/14] libxl: Enhance libxl__sendmsg_fds to deal with EINTR and EWOULDBLOCK Anthony PERARD
2018-12-21 14:30 ` Ian Jackson
2019-01-04 12:07 ` Anthony PERARD
2019-01-04 15:58 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 02/14] libxl_qmp: Separate QMP message generation from qmp_send_prepare Anthony PERARD
2018-12-21 14:32 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 03/14] libxl_qmp: Change qmp_qemu_check_version to compare version Anthony PERARD
2018-11-23 13:53 ` [PATCH v7 04/14] libxl: Add wrapper around libxl__json_object_to_json JSON Anthony PERARD
2018-12-21 14:33 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 05/14] libxl: Design of an async API to issue QMP commands to QEMU Anthony PERARD
2018-11-23 13:53 ` [PATCH v7 06/14] libxl_qmp: Implementation of libxl__ev_qmp_* Anthony PERARD
2018-12-21 15:36 ` Ian Jackson
2018-12-21 15:59 ` Ian Jackson
2019-01-03 12:40 ` Anthony PERARD
2019-01-04 11:14 ` Anthony PERARD
2019-01-04 11:21 ` Ian Jackson
2019-01-04 11:41 ` Anthony PERARD [this message]
2018-11-23 13:53 ` [PATCH v7 07/14] libxl_exec: Add libxl__spawn_initiate_failure Anthony PERARD
2018-12-21 15:57 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 08/14] libxl: Add init/dispose of for libxl__domain_build_state Anthony PERARD
2018-12-21 16:00 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 09/14] libxl_dm: Pre-open QMP socket for QEMU Anthony PERARD
2018-12-21 16:01 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 10/14] libxl: Add dmss_init/dispose for libxl__dm_spawn_state Anthony PERARD
2018-11-23 13:53 ` [PATCH v7 11/14] libxl: QEMU startup sync based on QMP Anthony PERARD
2018-12-21 16:03 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 12/14] libxl_qmp: Store advertised QEMU version in libxl__ev_qmp Anthony PERARD
2018-12-21 16:05 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 13/14] libxl: Change libxl__domain_suspend_device_model() to be async Anthony PERARD
2018-12-21 16:09 ` Ian Jackson
2018-11-23 13:53 ` [PATCH v7 14/14] libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp Anthony PERARD
2018-12-21 16:12 ` Ian Jackson
2018-11-23 13:57 ` [PATCH v7 00/14] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_* Anthony PERARD
2018-12-21 16:13 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190104114158.GB1508@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=ian.jackson@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.