summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-11-23 13:11:55 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-12-06 11:40:01 -0200
commit4b37156c40c3d7d63ac332e3bb9f85a66c3f5e5e (patch)
tree3d59990fcc421645abe215132327c9b9ad76e9b8 /net.c
parentab49ab5c488237f3656689c4a3cab29e29884ca6 (diff)
qapi: Convert set_link
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net.c b/net.c
index cb52050bfd..f7bebf8cc4 100644
--- a/net.c
+++ b/net.c
@@ -34,6 +34,7 @@
#include "monitor.h"
#include "qemu-common.h"
#include "qemu_socket.h"
+#include "qmp-commands.h"
#include "hw/qdev.h"
#include "iov.h"
@@ -1258,12 +1259,10 @@ void do_info_network(Monitor *mon)
}
}
-int do_set_link(Monitor *mon, const QDict *qdict, QObject **ret_data)
+void qmp_set_link(const char *name, bool up, Error **errp)
{
VLANState *vlan;
VLANClientState *vc = NULL;
- const char *name = qdict_get_str(qdict, "name");
- int up = qdict_get_bool(qdict, "up");
QTAILQ_FOREACH(vlan, &vlans, next) {
QTAILQ_FOREACH(vc, &vlan->clients, next) {
@@ -1280,8 +1279,8 @@ int do_set_link(Monitor *mon, const QDict *qdict, QObject **ret_data)
done:
if (!vc) {
- qerror_report(QERR_DEVICE_NOT_FOUND, name);
- return -1;
+ error_set(errp, QERR_DEVICE_NOT_FOUND, name);
+ return;
}
vc->link_down = !up;
@@ -1300,7 +1299,6 @@ done:
if (vc->peer && vc->peer->info->link_status_changed) {
vc->peer->info->link_status_changed(vc->peer);
}
- return 0;
}
void net_cleanup(void)