QEMU monitor on unix domain socket
Not logged in
  1. QEMU handles "address already in use" error, and successifully rebinds to socket, which is left in the filesystem by previous invocation.

  2. Socket chardev should be created with nowait option, otherwise QEMU would wait until somebody connects to the socket before demonizing.

    Correct options to create socket monitor in the current directory:

    -chardev socket,server,nowait,path=monitor,id=monitor \
    -mon chardev=monitor,mode=readline \
    
  3. QEMU doesn't handle EPIPE well, so if client want to disconnect and let other clients connect, it should shutdown the socket before closing. Otherwise next client might hang after connect.