提交 e8f1f9db 编写于 作者: A aliguori

net: Check device passed to host_net_remove (Jan Kiszka)

Make sure that we do not delete guest NICs via host_net_remove.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7195 c046a42c-6fe2-441c-8c8c-71466251a162
上级 0b1bcb00
......@@ -1858,14 +1858,20 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
vlan = qemu_find_vlan(vlan_id);
for(vc = vlan->first_client; vc != NULL; vc = vc->next)
if (!strcmp(vc->name, device))
for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
if (!strcmp(vc->name, device)) {
break;
}
}
if (!vc) {
monitor_printf(mon, "can't find device %s\n", device);
return;
}
if (!net_host_check_device(vc->model)) {
monitor_printf(mon, "invalid host network device %s\n", device);
return;
}
qemu_del_vlan_client(vc);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册