[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC XEN PATCH for-4.13 0/4] Fix: libxl workaround, multiple connection to single QMP socket


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Sander Eikelenboom <sander@xxxxxxxxxxxxxx>
  • Date: Sat, 26 Oct 2019 20:45:05 +0200
  • Autocrypt: addr=sander@xxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQMuBFNFDU0RCACWtSq295Y0xaUP3k7jub63jXIfXgGJ+LUbLJeS0mOeRC+xftv3qk9U2aTi z0Glopirh/6aRXb+rcxQ9hOVNfRHKvnHPyb1yC5zNadDAj+E+fO/iW0Yco5OnwUhNfEMkKT9 WKRW4oWD/uv9CkHRaPNZbX3Sd1u1ns0LUML3ayws/kUb7FPrh1CZVhgvfJuD85Kj1YpbHUyU v2nWBT+hoYEfT8y4SfhDPy9UMXrPlUGPFACvWfBy76mxpdTtzfuDk8r1s4hbvVKty29VBEcH 0fFKZmqsywhDWTP9ILibk0azXRvA+6ZD6D9WUBZ0TfC8vy1eG0zEDF7yOThatoYuWlqHAQC1 OFOG97B+zbc1R1HTYZUreUt28VQ1v+2pG/sZj0Mcgwf+N1UdiyS96pFYXUD9z0lQztCETF+I P/tiDapjhlQld6LGfHO3Qk3/tMtgh32TMxOjCTNrP1fn3eOdDRwyn7ZSzcIMZ0j55DXp5ut9 NJ0UxXMGnOWm/Lcz81EhR6QxR6EdgL5iCsJjqSq8DMaBz+dswanOksPrGzJ+IHFYYesRRzdE Z9dQpARCry4c0vX3wX4BG+vRdYHKfM4tHvr+wdM7U3F1ta8C0HU+lFfAH7/nhpxLB9/Ibin8 9+KItaujo4XJhOx8QLNnJiU1bPOvUHGqX2WUn8yb1eLgCx9nZ4YUrP1YDiilrMx9hGMdl0hk gKKoMWh8B2/qChSuKMI2Kwu+uwgAlqz0QuQkWFTLbXLpyHcnayT7TVKsAMgn7i0kl8CaeW9i /r62k2l2yZIXtJuLBEJ1qVZ1P1sXUYuFqIlOjW0VKyJ3IZa6cTLQfRxVN+ETGtAUGJvUpaNa n84nG3vAnmSmCnHDWBxr66wF4+UnIj0sHPlYclJGy/mrxs+OhhCog5NvbpzWAiLeZ1MeyNs+ JwWzW7I4o7PcHAt74PpVDiwhuPUZJs2fXi4u73lPxVfTKJHEHJrxbfgQP/qeWebIwADj1X4q s5njcvNBE+ier8EVwbyTBL7Fzf39Grw/9Kf4CiUCu7kxQTRyHyT/nJWuaMdR00yqEVGctv2n e3qrNqGambQqU2FuZGVyIEVpa2VsZW5ib29tIDxzYW5kZXJAZWlrZWxlbmJvb20uaXQ+iIEE ExEIACkFAlNFDU0CGwMFCQfIF1MHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRChIPzf fJPzZO3KAP9VcRwYdaETTC4+s3gscTMGFDUT+WYcNqpIIn/BLGKuFAD/eglObB2QxiXV4t1T ++6WKsvKtNlmrssnOqOmZyqPZQ8=
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Sat, 26 Oct 2019 18:44:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Openpgp: preference=signencrypt

On 25/10/2019 19:05, Anthony PERARD wrote:
> Patch series available in this git branch:
> https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git 
> br.fix-ev_qmp-multi-connect-v1
> 
> 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.

Hi Anthony,

Just tested with the patch series and it fixes my issue with starting a
guest with several PCI passthrough devices.

Thanks,

Sander


> 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.
> 
> Alternatively to this craziness, it might be possible to increase the 
> `backlog'
> value by having libxl opening the QMP socket on behalf of QEMU. But this is
> only possible with a recent version of QEMU (2.12 or newer, released in Apr
> 2018, or qemu-xen-4.12 or newer). It would involve to discover QEMU's
> capability before we start the DM, which libxl isn't capable yet.
> 
> Cheers,
> 
> Anthony PERARD (4):
>   libxl: Introduce libxl__ev_child_kill
>   libxl: Introduce libxl__ev_qmplock
>   libxl: libxl__ev_qmp_send now takes an egc
>   libxl_qmp: Have a lock for QMP socket access
> 
>  tools/libxl/libxl_disk.c        |  6 +--
>  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      |  8 ++--
>  tools/libxl/libxl_event.c       |  3 +-
>  tools/libxl/libxl_fork.c        | 55 ++++++++++++++++++++++++
>  tools/libxl/libxl_internal.c    | 31 +++++++++++++-
>  tools/libxl/libxl_internal.h    | 53 +++++++++++++++++------
>  tools/libxl/libxl_pci.c         |  8 ++--
>  tools/libxl/libxl_qmp.c         | 75 +++++++++++++++++++++++++--------
>  tools/libxl/libxl_usb.c         | 28 ++++++------
>  12 files changed, 219 insertions(+), 60 deletions(-)
> 


-- 

Met vriendelijke groet,

Sander Eikelenboom
mailto:Sander@xxxxxxxxxxxxxx

Eikelenboom IT Services
Kaapseweg 70
5642 HK Eindhoven
M: 06-14387484

PGP public key for sander@xxxxxxxxxxxxxx:
key id: 0xC4B99EEDECF2AE69
fingerprint: 07BB B819 FF93 E54D 5F5C  0BDE C4B9 9EED ECF2 AE69

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.