All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v8 06/17] libxl_qmp: Implementation of libxl__ev_qmp_*
Date: Fri, 11 Jan 2019 12:06:07 +0000	[thread overview]
Message-ID: <23608.34479.976461.767202@mariner.uk.xensource.com> (raw)
In-Reply-To: <20190104153056.19138-7-anthony.perard@citrix.com>

Anthony PERARD writes ("[PATCH v8 06/17] libxl_qmp: Implementation of libxl__ev_qmp_*"):
> This patch implement the API libxl__ev_qmp documented in the previous
> patch, "libxl: Design of an async API to issue QMP commands to QEMU".
> 
> Since this API is to interact with QEMU via the QMP protocol, it also
> implement a QMP client. The specification for the QEMU Machine Protocol
> (QMP) can be found in the QEMU repository at:
> https://git.qemu.org/?p=qemu.git;a=blob_plain;f=docs/interop/qmp-spec.txt

Thanks.  I have re-reviewed this and I have only this one question:

> +    while (ev->tx_buf_off < ev->tx_buf_len) {
> +        ssize_t max_write = ev->tx_buf_len - ev->tx_buf_off;
> +        r = write(fd, ev->tx_buf + ev->tx_buf_off, max_write);
> +        if (r < 0) {
> +            if (errno == EINTR)
> +                continue;
> +            if (errno == EWOULDBLOCK)
> +                break;
> +            LOGED(ERROR, ev->domid, "failed to write to QMP socket");
> +            return ERROR_FAIL;
> +        }
> +        assert(r >= 0 && r <= max_write);

Doesn't this want to be
  +        assert(r > 0 && r <= max_write);
?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-01-11 12:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 15:30 [PATCH v8 00/17] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_* Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 01/17] libxl: Enhance libxl__sendmsg_fds to deal with EINTR and EWOULDBLOCK Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 02/17] libxl_qmp: Separate QMP message generation from qmp_send_prepare Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 03/17] libxl_qmp: Change qmp_qemu_check_version to compare version Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 04/17] libxl: Add wrapper around libxl__json_object_to_json JSON Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 05/17] libxl: Design of an async API to issue QMP commands to QEMU Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 06/17] libxl_qmp: Implementation of libxl__ev_qmp_* Anthony PERARD
2019-01-11 12:06   ` Ian Jackson [this message]
2019-01-11 12:16     ` Anthony PERARD
2019-01-11 12:21       ` Ian Jackson
2019-01-04 15:30 ` [PATCH v8 07/17] libxl_exec: Add libxl__spawn_initiate_failure Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 08/17] libxl: Add init/dispose of for libxl__domain_build_state Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 09/17] libxl_dm: Pre-open QMP socket for QEMU Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 10/17] libxl: Add dmss_init/dispose for libxl__dm_spawn_state Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 11/17] libxl: QEMU startup sync based on QMP Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 12/17] libxl_qmp: Store advertised QEMU version in libxl__ev_qmp Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 13/17] libxl: Change libxl__domain_suspend_device_model() to be async Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 14/17] libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp Anthony PERARD
2019-01-04 15:30 ` [PATCH v8 15/17] libxl: Remove unused arg from libxl__sendmsg_fds Anthony PERARD
2019-01-04 16:04   ` Ian Jackson
2019-01-04 15:30 ` [PATCH v8 16/17] libxl_json: Remove libxl__json_object_append_to from header Anthony PERARD
2019-01-04 16:03   ` Ian Jackson
2019-01-04 15:30 ` [PATCH v8 17/17] libxl: Add comments to libxl__json_*get* functions Anthony PERARD
2019-01-11 11:55   ` 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=23608.34479.976461.767202@mariner.uk.xensource.com \
    --to=ian.jackson@citrix.com \
    --cc=anthony.perard@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.