static void monitor_data_destroy(Monitor *mon)
{
+ if (mon->chr) {
+ qemu_chr_add_handlers(mon->chr, NULL, NULL, NULL, NULL);
+ }
+ if (monitor_is_qmp(mon)) {
+ json_message_parser_destroy(&mon->qmp.parser);
+ }
+ g_free(mon->rs);
QDECREF(mon->outbuf);
qemu_mutex_destroy(&mon->out_lock);
}
}
len = strlen(str);
readline_set_completion_index(rs, len);
- for (i = 0; NetClientOptionsKind_lookup[i]; i++) {
- add_completion_option(rs, str, NetClientOptionsKind_lookup[i]);
+ for (i = 0; NetClientDriver_lookup[i]; i++) {
+ add_completion_option(rs, str, NetClientDriver_lookup[i]);
}
}
NetClientState *ncs[MAX_QUEUE_NUM];
int count, i;
count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NONE,
+ NET_CLIENT_DRIVER_NONE,
MAX_QUEUE_NUM);
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
const char *name = ncs[i]->name;
len = strlen(str);
readline_set_completion_index(rs, len);
- count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC,
+ count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_DRIVER_NIC,
MAX_QUEUE_NUM);
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
QemuOpts *opts;
readline_set_completion_index(rs, len);
if (nb_args == 2) {
count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NONE,
+ NET_CLIENT_DRIVER_NONE,
MAX_QUEUE_NUM);
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
int id;
return;
} else if (nb_args == 3) {
count = qemu_find_net_clients_except(NULL, ncs,
- NET_CLIENT_OPTIONS_KIND_NIC,
+ NET_CLIENT_DRIVER_NIC,
MAX_QUEUE_NUM);
for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
int id;
const char *name;
- if (ncs[i]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT ||
+ if (ncs[i]->info->type == NET_CLIENT_DRIVER_HUBPORT ||
net_hub_id_for_client(ncs[i], &id)) {
continue;
}
qemu_mutex_unlock(&monitor_lock);
}
+void monitor_cleanup(void)
+{
+ Monitor *mon, *next;
+
+ qemu_mutex_lock(&monitor_lock);
+ QLIST_FOREACH_SAFE(mon, &mon_list, entry, next) {
+ QLIST_REMOVE(mon, entry);
+ monitor_data_destroy(mon);
+ g_free(mon);
+ }
+ qemu_mutex_unlock(&monitor_lock);
+}
+
static void bdrv_password_cb(void *opaque, const char *password,
void *readline_opaque)
{