- primitive type is not supported as return value.
so make structure.
- remove unused command
Change-Id: I5e0a309f2cd31623bff89b9c45a067bec90139c4
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
hmp_handle_error(mon, &err);
}
+#if defined(CONFIG_MARU)
void hmp_get_link(Monitor *mon, const QDict *qdict)
{
const char *name = qdict_get_str(qdict, "name");
Error *errp = NULL;
-
- bool is_up = qmp_get_link(name, &errp);
+ LinkInfo *info;
+ info = qmp_get_link(name, &errp);
if (errp) {
hmp_handle_error(mon, &errp);
+ g_free(info);
return;
}
- monitor_printf(mon, "%s\n", is_up ? "on": "off");
+ monitor_printf(mon, "%s\n", info->is_up ? "on": "off");
+ g_free(info);
}
+#endif
void hmp_block_passwd(Monitor *mon, const QDict *qdict)
{
void hmp_system_wakeup(Monitor *mon, const QDict *qdict);
void hmp_nmi(Monitor *mon, const QDict *qdict);
void hmp_set_link(Monitor *mon, const QDict *qdict);
+#if defined(CONFIG_MARU)
void hmp_get_link(Monitor *mon, const QDict *qdict);
+#endif
void hmp_block_passwd(Monitor *mon, const QDict *qdict);
void hmp_balloon(Monitor *mon, const QDict *qdict);
void hmp_block_resize(Monitor *mon, const QDict *qdict);
}
}
-bool qmp_get_link(const char *name, Error **errp)
+#if defined(CONFIG_MARU)
+LinkInfo *qmp_get_link(const char *name, Error **errp)
{
NetClientState *ncs[MAX_QUEUE_NUM];
int queues, i;
- bool down = false;
+ LinkInfo *info;
+ info = g_malloc0(sizeof (struct LinkInfo));
queues = qemu_find_net_clients_except(name, ncs,
NET_CLIENT_OPTIONS_KIND_MAX,
if (queues == 0) {
error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", name);
- return false;
+ return info;
}
for (i = 0; i < queues; i++) {
- down = ncs[i]->link_down;
+ info->is_up = !(ncs[i]->link_down);
}
- return !down;
+ return info;
}
+#endif
void net_cleanup(void)
{
# will succeed even if the network adapter does not support link status
# notification.
##
-{ 'command': 'get_link', 'data': {'name': 'str'}, 'returns': 'bool' }
+
+{ 'struct': 'LinkInfo', 'data': {'is_up': 'bool'} }
+{ 'command': 'get_link', 'data': {'name': 'str'}, 'returns': 'LinkInfo' }
##
# @balloon:
##
{ 'command': 'query-target', 'returns': 'TargetInfo' }
-## Eric 2013.3.7 ##
-
-##
-# @AccelInfo:
-#
-# Information describing the acceleration sensor value
-#
-# @Xaxis: x axis value of the acceleration sensor
-# @Yaxis: y axis value of the acceleration sensor
-# @Zaxis: z axis value of the acceleration sensor
-#
-# Since: 1.2.0
-##
-{ 'type': 'AccelInfo',
- 'data': { 'Xaxis': 'int', 'Yaxis': 'int', 'Zaxis' : 'int'} }
-
##
# @QKeyCode:
#