From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v6 07/11] libxl_dm: Pre-open QMP socket for QEMU
Date: Wed, 21 Nov 2018 17:14:44 +0000 [thread overview]
Message-ID: <20181121171444.GD2448@perard.uk.xensource.com> (raw)
In-Reply-To: <23534.44948.982140.446746@mariner.uk.xensource.com>
On Fri, Nov 16, 2018 at 11:52:52AM +0000, Ian Jackson wrote:
> > + r = listen(fd, 1);
>
> What is the reasoning behind the choice of 1 for the listen queue
> parameter ?
I may have simply copy that from QEMU, or libvirt. They both call listen
with 1. It is probably to allow at least one connect() call on that
socket to succeed before QEMU start. I don't know if 0 is enough.
> > static int libxl__build_device_model_args_new(libxl__gc *gc,
> > const char *dm, int guest_domid,
> > const libxl_domain_config *guest_config,
> > @@ -944,10 +991,16 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
> > GCSPRINTF("%d", guest_domid), NULL);
> >
> > flexarray_append(dm_args, "-chardev");
> > - flexarray_append(dm_args,
> > - GCSPRINTF("socket,id=libxl-cmd,"
> > - "path=%s,server,nowait",
> > - libxl__qemu_qmp_path(gc, guest_domid)));
> > + if (state->dm_monitor_fd >= 0) {
> > + flexarray_append(dm_args,
> > + GCSPRINTF("socket,id=libxl-cmd,fd=%d,server,nowait",
> > + state->dm_monitor_fd));
>
> I think I suggested (IRL perhaps, and perhaps after you posted this)
> that you might add some asserts to the other
> ..._build_device_model_args_... functions.
Will do.
> > @@ -2000,6 +2053,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
> > if (ret)
> > goto out;
> >
> > + d_state->dm_monitor_fd = -1;
>
> This function calls libxl__domain_make which you have just changed to
> also set this. The situation is now very confusing, I think.
>
> I think it would probably be better to introduce a new function to
> initialise a libxl__domain_build_state, which is called every time one
> comes into existence. Probably as a separate patch.
I'll attempt to do that.
> > @@ -2408,6 +2470,7 @@ out_close:
> > if (logfile_w >= 0) close(logfile_w);
> > out:
> > if (dm_state_fd >= 0) close(dm_state_fd);
> > + if (state->dm_monitor_fd >= 0) close(state->dm_monitor_fd);
>
> I think this cleanup of `state' needs to be split out. There should
> be a dispose function called everywhere a state ceases to exist.
> See above about _init.
Will do.
--
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:[~2018-11-21 17:14 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-12 16:49 [PATCH v6 00/11] libxl: Enable save/restore/migration of a restricted QEMU + libxl__ev_qmp_* Anthony PERARD
2018-11-12 16:49 ` [PATCH v6 01/11] libxl: Enhance libxl__sendmsg_fds to deal with EINTR and EWOULDBLOCK Anthony PERARD
2018-11-12 16:58 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 02/11] libxl_qmp: Separate QMP message generation from qmp_send_prepare Anthony PERARD
2018-11-12 17:20 ` Ian Jackson
2018-11-13 10:59 ` Anthony PERARD
2018-11-13 12:04 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 03/11] libxl_qmp: Change qmp_qemu_check_version to compare version Anthony PERARD
2018-11-12 17:22 ` Ian Jackson
2018-11-22 12:24 ` Anthony PERARD
2018-11-22 12:27 ` Anthony PERARD
2018-11-12 16:49 ` [PATCH v6 04/11] libxl: Design of an async API to issue QMP commands to QEMU Anthony PERARD
2018-11-12 17:29 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 05/11] libxl_qmp: Implementation of libxl__ev_qmp_* Anthony PERARD
2018-11-13 11:33 ` Ian Jackson
2018-11-22 19:04 ` Marek Marczykowski-Górecki
2018-11-23 11:09 ` Anthony PERARD
2018-11-12 16:49 ` [PATCH v6 06/11] libxl_exec: Add libxl__spawn_initiate_failure Anthony PERARD
2018-11-12 17:34 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 07/11] libxl_dm: Pre-open QMP socket for QEMU Anthony PERARD
2018-11-16 11:52 ` Ian Jackson
2018-11-21 17:14 ` Anthony PERARD [this message]
2018-11-12 16:49 ` [PATCH v6 08/11] libxl: QEMU startup sync based on QMP Anthony PERARD
2018-11-16 12:14 ` Ian Jackson
2018-11-21 16:49 ` Anthony PERARD
2018-11-22 14:37 ` Anthony PERARD
2018-11-22 15:48 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 09/11] libxl_qmp: Store advertised QEMU version in libxl__ev_qmp Anthony PERARD
2018-11-16 12:17 ` Ian Jackson
2018-11-12 16:49 ` [PATCH v6 10/11] libxl: Change libxl__domain_suspend_device_model() to be async Anthony PERARD
2018-11-12 16:49 ` [PATCH v6 11/11] libxl: Re-implement domain_suspend_device_model using libxl__ev_qmp Anthony PERARD
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=20181121171444.GD2448@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.