@@ -1291,7 +1291,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;
@@ -1309,8 +1309,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;
@@ -1318,6 +1318,7 @@ done:
if (vc->info->link_status_changed) {
vc->info->link_status_changed(vc);
}
+ return 0;
}
void net_cleanup(void)
@@ -118,7 +118,7 @@ int qemu_find_nic_model(NICInfo *nd, const char * const *models,
const char *default_model);
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);
/* NIC info */
@@ -989,7 +989,8 @@ ETEXI
.args_type = "name:s,up:b",
.params = "name on|off",
.help = "change the link status of a network adapter",
- .mhandler.cmd = do_set_link,
+ .user_print = monitor_user_noop,
+ .mhandler.cmd_new = do_set_link,
},
STEXI