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 --- ui/spice-core.c | 7 ++++--- ui/vnc.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'ui') diff --git a/ui/spice-core.c b/ui/spice-core.c index d10818a925..8d54fb320f 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -391,15 +391,16 @@ static SpiceChannelList *qmp_query_spice_channels(void) chan = g_malloc0(sizeof(*chan)); chan->value = g_malloc0(sizeof(*chan->value)); + chan->value->base = g_malloc0(sizeof(*chan->value->base)); paddr = (struct sockaddr *)&item->info->paddr_ext; plen = item->info->plen_ext; getnameinfo(paddr, plen, host, sizeof(host), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); - chan->value->host = g_strdup(host); - chan->value->port = g_strdup(port); - chan->value->family = g_strdup(inet_strfamily(paddr->sa_family)); + chan->value->base->host = g_strdup(host); + chan->value->base->port = g_strdup(port); + chan->value->base->family = inet_netfamily(paddr->sa_family); chan->value->connection_id = item->info->connection_id; chan->value->channel_type = item->info->type; diff --git a/ui/vnc.c b/ui/vnc.c index aac93f0e17..20f8aa3f95 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -321,9 +321,10 @@ static VncClientInfo *qmp_query_vnc_client(const VncState *client) } info = g_malloc0(sizeof(*info)); - info->host = g_strdup(host); - info->service = g_strdup(serv); - info->family = g_strdup(inet_strfamily(sa.ss_family)); + info->base = g_malloc0(sizeof(*info->base)); + info->base->host = g_strdup(host); + info->base->service = g_strdup(serv); + info->base->family = inet_netfamily(sa.ss_family); #ifdef CONFIG_VNC_TLS if (client->tls.session && client->tls.dname) { @@ -398,7 +399,7 @@ VncInfo *qmp_query_vnc(Error **errp) info->service = g_strdup(serv); info->has_family = true; - info->family = g_strdup(inet_strfamily(sa.ss_family)); + info->family = inet_netfamily(sa.ss_family); info->has_auth = true; info->auth = g_strdup(vnc_auth_name(vnc_display)); -- cgit v1.2.3