Extend graphics event to include UNIX socket

Not all VNC/SPICE servers use a TCP socket for their connections.
It is possible to configure a UNIX socket server. The graphics
event must thus include a UNIX socket address type.

* include/libvirt/libvirt.h.in: Add UNIX socket address type
  for graphics event
* src/qemu/qemu_monitor_json.c: Add 'unix' string to address
  type enum
This commit is contained in:
Daniel P. Berrange 2011-10-21 09:14:02 +01:00
parent 9d96f1ce90
commit 6aa27da287
2 changed files with 5 additions and 4 deletions

View File

@ -2894,6 +2894,7 @@ typedef enum {
typedef enum {
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4, /* IPv4 address */
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6, /* IPv6 address */
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX, /* UNIX socket path */
} virDomainEventGraphicsAddressType;
@ -2905,8 +2906,8 @@ typedef enum {
*/
struct _virDomainEventGraphicsAddress {
int family; /* Address family, virDomainEventGraphicsAddressType */
const char *node; /* Address of node (eg IP address) */
const char *service; /* Service name/number (eg TCP port) */
const char *node; /* Address of node (eg IP address, or UNIX path) */
const char *service; /* Service name/number (eg TCP port, or NULL) */
};
typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;

View File

@ -619,8 +619,8 @@ static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr dat
VIR_ENUM_DECL(qemuMonitorGraphicsAddressFamily)
VIR_ENUM_IMPL(qemuMonitorGraphicsAddressFamily, VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6 + 1,
"ipv4", "ipv6");
VIR_ENUM_IMPL(qemuMonitorGraphicsAddressFamily, VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX + 1,
"ipv4", "ipv6", "unix");
static void qemuMonitorJSONHandleVNC(qemuMonitorPtr mon, virJSONValuePtr data, int phase)
{