All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: [Xen-devel] [XEN PATCH for-4.13 v3 0/7] Fix: libxl workaround, multiple connection to single QMP socket
Date: Mon, 18 Nov 2019 17:13:01 +0000	[thread overview]
Message-ID: <20191118171309.1459302-1-anthony.perard@citrix.com> (raw)

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.fix-ev_qmp-multi-connect-v3

v3:
Two patches left to review:
- libxl: Introduce libxl__ev_immediate (new)
- libxl_qmp: Have a lock for QMP socket access

And Jürgen already gave his ack on 8th of November:
Release-acked-by: Juergen Gross <jgross@suse.com>

Hi,

QEMU's QMP socket doesn't allow multiple concurrent connection. Also, it
listen() on the socket with a `backlog' of only 1. On Linux at least, once that
backlog is filled connect() will return EAGAIN if the socket fd is
non-blocking. libxl may attempt many concurrent connect() attempt if for
example a guest is started with several PCI passthrough devices, and a
connect() failure lead to a failure to start the guest.

Since we can't change the listen()'s `backlog' that QEMU use, we need other
ways to workaround the issue. This patch series introduce a lock to acquire
before attempting to connect() to the QMP socket. Since the lock might be held
for to long, the series also introduce a way to cancel the acquisition of the
lock, this means killing the process that tries to get the lock.

See thread[1] for discussed alternative.
[1] https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg01815.html

Cheers,

Anthony PERARD (7):
  libxl: Introduce libxl__ev_child_kill_deregister
  libxl: Move libxl__ev_devlock declaration
  libxl: Rename ev_devlock to ev_slowlock
  libxl: Introduce libxl__ev_slowlock_dispose
  libxl: libxl__ev_qmp_send now takes an egc
  libxl: Introduce libxl__ev_immediate
  libxl_qmp: Have a lock for QMP socket access

 tools/libxl/libxl_disk.c        |  16 ++--
 tools/libxl/libxl_dm.c          |   8 +-
 tools/libxl/libxl_dom_save.c    |   2 +-
 tools/libxl/libxl_dom_suspend.c |   2 +-
 tools/libxl/libxl_domain.c      |  18 ++--
 tools/libxl/libxl_event.c       |  25 +++++-
 tools/libxl/libxl_fork.c        |  48 +++++++++++
 tools/libxl/libxl_internal.c    |  41 ++++++---
 tools/libxl/libxl_internal.h    | 147 ++++++++++++++++++++------------
 tools/libxl/libxl_pci.c         |   8 +-
 tools/libxl/libxl_qmp.c         | 128 ++++++++++++++++++++-------
 tools/libxl/libxl_usb.c         |  28 +++---
 12 files changed, 336 insertions(+), 135 deletions(-)

-- 
Anthony PERARD


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

             reply	other threads:[~2019-11-18 17:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 17:13 Anthony PERARD [this message]
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 1/7] libxl: Introduce libxl__ev_child_kill_deregister Anthony PERARD
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 2/7] libxl: Move libxl__ev_devlock declaration Anthony PERARD
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 3/7] libxl: Rename ev_devlock to ev_slowlock Anthony PERARD
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 4/7] libxl: Introduce libxl__ev_slowlock_dispose Anthony PERARD
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 5/7] libxl: libxl__ev_qmp_send now takes an egc Anthony PERARD
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 6/7] libxl: Introduce libxl__ev_immediate Anthony PERARD
2019-11-18 17:28   ` Ian Jackson
2019-11-18 17:49     ` Anthony PERARD
2019-11-18 17:57       ` Ian Jackson
2019-11-18 18:10       ` [Xen-devel] [XEN PATCH for-4.13 v4 " Anthony PERARD
2019-11-18 18:12         ` Ian Jackson
2019-11-18 17:13 ` [Xen-devel] [XEN PATCH for-4.13 v3 7/7] libxl_qmp: Have a lock for QMP socket access Anthony PERARD
2019-11-18 17:30   ` Ian Jackson
2019-11-18 23:04     ` Wei Liu

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=20191118171309.1459302-1-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=wl@xen.org \
    --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.