This series add support for talking to QEMU guest agent via a vsock
transport.

This transport is attempted when there's no ready virtio-serial channels
**and** the domain has a usable vsock CID.

AF_VSOCK are sockets too, so most of the virtio-serial/UNIX socket code
is reused for everything except the connection lifecycle management
(that is, initial connection etc.).

Since QGA has no readiness notification mechanism for vsock transport,
unlike for virtio-serial transport, we have to knock on the port to
probe for readiness. For that, a custom backoff logic with cancellation
support is implemented.

Both the new virVsockConnectQuiet helper and the vsock QGA connection
logic itself are covered by new tests.

Polina Vishneva (6):
  util: Add virVsockConnectQuiet helper
  qemu: Extract qemuProcessResetAgent helper
  qemu: Add qemuDomainVsockHasGuestCid helper
  qemu: Support AF_VSOCK transport for QGA communication
  tests: Add a unit test for virVsockConnectQuiet()
  tests: Add a test for qemuConnectAgent() to cover the vsock path

 src/hypervisor/qemu_agent.c  |  73 +++++----
 src/hypervisor/qemu_agent.h  |   9 ++
 src/libvirt_private.syms     |   2 +
 src/qemu/qemu_domain.c       |  28 +++-
 src/qemu/qemu_domain.h       |   8 +
 src/qemu/qemu_driver.c       |  16 +-
 src/qemu/qemu_hotplug.c      |   6 +
 src/qemu/qemu_process.c      | 305 +++++++++++++++++++++++++++++++----
 src/qemu/qemu_process.h      |   2 +
 src/util/virvsock.c          |  71 +++++++-
 src/util/virvsock.h          |  10 ++
 tests/meson.build            |   3 +
 tests/qemuagenttest.c        |  43 ++++-
 tests/qemumonitortestutils.c | 119 +++++++++++++-
 tests/qemumonitortestutils.h |   4 +
 tests/qemuvsockagentmock.c   |  65 ++++++++
 tests/virvsockmock.c         | 143 ++++++++++++++++
 tests/virvsocktest.c         | 133 +++++++++++++++
 18 files changed, 963 insertions(+), 77 deletions(-)
 create mode 100644 tests/qemuvsockagentmock.c
 create mode 100644 tests/virvsockmock.c
 create mode 100644 tests/virvsocktest.c

-- 
2.54.0

Reply via email to