[libvirt] [PATCH 0/2] qemu: support SPICE+unix socket

Cole Robinson crobinso at redhat.com
Mon Mar 21 23:30:43 UTC 2016


qemu has supported SPICE+unix socket listening since 2.3.0. Patch #1
wires it up from domain_conf.c down to qemu, patch #2 adds qemu.conf
spice_auto_unix_socket option

Full disclosure: this duplicates the logic of VNC socket usage, which has
some pre-existing warts:

- When the VM is running with graphics socket=FOO, the runtime XML
  still lists <listen type='address' address='127.0.0.1'/>.
- If using vnc/spice auto socket, it looks like ports can still be
  allocated in the code, though they are never used.
- In fact I suspect there's lots of issues with stray XML port/listen
  being parsed and ending up in the device config, but selectively being
  ignored later. We should probably explicitly ignore/error about those
  combos when parsing the XML so we never have to ignore specific values
  later on.
- The auto socket path is set in qemu_command.c but it should probably
  be set in qemu_process.c with the port stuff. Though there are references
  to vncListen in qemu_command.c which should probably be moved as well.
  The issue with moving them to qemu_process.c is now there isn't any
  pre-existing way to test those bits like via qemuxml2argvtest for
  example. Though finding a way to test the graphics prep stuff would
  be valuable anyways
- teuf suggests: converting <graphics socket=X/> to
  <graphics><listen type='socket' path='FOO'/></graphics> like was done
  with listen= address
- tuef: virsh domdisplay doesn't handle sockets

To avoid yet another rabbit hole I didn't touch any of the above issues,
which basically means spice+unix is no less operationally worse than
vnc+unix :)


Cole Robinson (2):
  qemu: Support SPICE listen over unix socket
  qemu: Add qemu.conf option spice_auto_unix_socket

 docs/schemas/domaincommon.rng                      |  5 ++++
 src/conf/domain_conf.c                             | 26 +++++++++++++--------
 src/conf/domain_conf.h                             |  1 +
 src/qemu/libvirtd_qemu.aug                         |  1 +
 src/qemu/qemu.conf                                 | 11 +++++++++
 src/qemu/qemu_command.c                            | 15 +++++++++---
 src/qemu/qemu_conf.c                               |  1 +
 src/qemu/qemu_conf.h                               |  1 +
 src/qemu/qemu_process.c                            |  3 +++
 src/qemu/test_libvirtd_qemu.aug.in                 |  1 +
 src/security/virt-aa-helper.c                      |  5 ++++
 .../qemuxml2argv-graphics-spice-unix-auto.args     | 21 +++++++++++++++++
 .../qemuxml2argv-graphics-spice-unix-auto.xml      | 27 ++++++++++++++++++++++
 .../qemuxml2argv-graphics-spice-unix.args          | 21 +++++++++++++++++
 .../qemuxml2argv-graphics-spice-unix.xml           | 27 ++++++++++++++++++++++
 tests/qemuxml2argvtest.c                           | 10 ++++++++
 16 files changed, 163 insertions(+), 13 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-unix-auto.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-unix-auto.xml
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-unix.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-unix.xml

-- 
2.5.0




More information about the libvir-list mailing list