]> git.proxmox.com Git - qemu.git/blobdiff - net.c
monitor: Convert do_set_link() to QObject, QError
[qemu.git] / net.c
diff --git a/net.c b/net.c
index cdba8f3571ce47b6158a3204a5ee6828141c241e..378edfccd0f2d5607e87a1e1cfa370cc87005dd3 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1271,7 +1271,7 @@ void do_info_network(Monitor *mon)
     }
 }
 
-void do_set_link(Monitor *mon, const QDict *qdict)
+int do_set_link(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     VLANState *vlan;
     VLANClientState *vc = NULL;
@@ -1289,8 +1289,8 @@ void do_set_link(Monitor *mon, const QDict *qdict)
 done:
 
     if (!vc) {
-        monitor_printf(mon, "could not find network device '%s'\n", name);
-        return;
+        qerror_report(QERR_DEVICE_NOT_FOUND, name);
+        return -1;
     }
 
     vc->link_down = !up;
@@ -1298,6 +1298,7 @@ done:
     if (vc->info->link_status_changed) {
         vc->info->link_status_changed(vc);
     }
+    return 0;
 }
 
 void net_cleanup(void)