From a589569f2f40a0454b52398035cfe7fbe44ab1e9 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Wed, 18 Jun 2014 08:43:30 +0200 Subject: qapi: adjust existing defines In order to let event defines use existing types later, instead of redefine new ones, some old type defines for spice and vnc are changed, and BlockErrorAction is moved from block.h to qapi schema. Note that BlockErrorAction is not merged with BlockdevOnError. At this point, VncInfo is not made a child of VncBasicInfo, because VncBasicInfo has mandatory fields where VncInfo makes them optional. Signed-off-by: Wenchao Xia Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- util/qemu-sockets.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util') diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index a4a1e9d..447720f 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -102,6 +102,16 @@ const char *inet_strfamily(int family) return "unknown"; } +NetworkAddressFamily inet_netfamily(int family) +{ + switch (family) { + case PF_INET6: return NETWORK_ADDRESS_FAMILY_IPV6; + case PF_INET: return NETWORK_ADDRESS_FAMILY_IPV4; + case PF_UNIX: return NETWORK_ADDRESS_FAMILY_UNIX; + } + return NETWORK_ADDRESS_FAMILY_UNKNOWN; +} + int inet_listen_opts(QemuOpts *opts, int port_offset, Error **errp) { struct addrinfo ai,*res,*e; -- cgit v1.1 From 7cfadb6b5291765d360137ac5cab78729bde0272 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Wed, 18 Jun 2014 08:43:50 +0200 Subject: qapi event: convert SPICE events SPICE_INITIALIZED, SPICE_CONNECTED, SPICE_DISCONNECTED and SPICE_MIGRATE_COMPLETED are converted in one patch, since they use some common functions. inet_strfamily() is removed since no callers exist anymore. Note that there is no existing doc for SPICE_MIGRATE_COMPLETED in docs/qmp/qmp-events.txt before this patch. Signed-off-by: Wenchao Xia Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- util/qemu-sockets.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'util') diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 447720f..74cf078 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -92,16 +92,6 @@ static void inet_setport(struct addrinfo *e, int port) } } -const char *inet_strfamily(int family) -{ - switch (family) { - case PF_INET6: return "ipv6"; - case PF_INET: return "ipv4"; - case PF_UNIX: return "unix"; - } - return "unknown"; -} - NetworkAddressFamily inet_netfamily(int family) { switch (family) { -- cgit v1.1