Lines Matching refs:desc

111 static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc,  in find_desc_by_name()  argument
116 for (i = 0; desc[i].name != NULL; i++) { in find_desc_by_name()
117 if (strcmp(desc[i].name, name) == 0) { in find_desc_by_name()
118 return &desc[i]; in find_desc_by_name()
127 const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name); in find_default_by_name() local
129 return desc ? desc->def_value_str : NULL; in find_default_by_name()
181 QemuOptDesc *desc; in qemu_opts_print_help() local
186 desc = list->desc; in qemu_opts_print_help()
187 while (desc && desc->name) { in qemu_opts_print_help()
189 g_string_append_printf(str, " %s=<%s>", desc->name, in qemu_opts_print_help()
190 opt_type_to_string(desc->type)); in qemu_opts_print_help()
191 if (desc->help) { in qemu_opts_print_help()
195 g_string_append_printf(str, " - %s", desc->help); in qemu_opts_print_help()
198 desc++; in qemu_opts_print_help()
347 assert(opt->desc && opt->desc->type == QEMU_OPT_BOOL); in qemu_opt_get_bool_helper()
384 assert(opt->desc && opt->desc->type == QEMU_OPT_NUMBER); in qemu_opt_get_number_helper()
422 assert(opt->desc && opt->desc->type == QEMU_OPT_SIZE); in qemu_opt_get_size_helper()
443 if (opt->desc == NULL) in qemu_opt_parse()
446 switch (opt->desc->type) { in qemu_opt_parse()
465 return list->desc[0].name == NULL; in opts_accepts_any()
496 const QemuOptDesc *desc; in opt_validate() local
499 desc = find_desc_by_name(list->desc, opt->name); in opt_validate()
500 if (!desc && !opts_accepts_any(list)) { in opt_validate()
505 opt->desc = desc; in opt_validate()
529 const QemuOptDesc *desc; in qemu_opt_set_bool() local
532 desc = find_desc_by_name(list->desc, name); in qemu_opt_set_bool()
533 if (!desc && !opts_accepts_any(list)) { in qemu_opt_set_bool()
541 opt->desc = desc; in qemu_opt_set_bool()
552 const QemuOptDesc *desc; in qemu_opt_set_number() local
555 desc = find_desc_by_name(list->desc, name); in qemu_opt_set_number()
556 if (!desc && !opts_accepts_any(list)) { in qemu_opt_set_number()
564 opt->desc = desc; in qemu_opt_set_number()
706 QemuOptDesc *desc = opts->list->desc; in qemu_opts_print() local
714 if (desc[0].name == NULL) { in qemu_opts_print()
722 for (; desc && desc->name; desc++) { in qemu_opts_print()
724 opt = qemu_opt_find(opts, desc->name); in qemu_opts_print()
726 value = opt ? opt->str : desc->def_value_str; in qemu_opts_print()
730 if (desc->type == QEMU_OPT_STRING) { in qemu_opts_print()
731 printf("%s%s=", sep, desc->name); in qemu_opts_print()
733 } else if ((desc->type == QEMU_OPT_SIZE || in qemu_opts_print()
734 desc->type == QEMU_OPT_NUMBER) && opt) { in qemu_opts_print()
735 printf("%s%s=%" PRId64, sep, desc->name, opt->value.uint); in qemu_opts_print()
737 printf("%s%s=%s", sep, desc->name, value); in qemu_opts_print()
1027 find_desc_by_name(opts->list->desc, entry->key)) { in qemu_opts_absorb_qdict()
1067 QemuOptDesc *desc; in qemu_opts_to_qdict_filtered() local
1069 for (desc = list->desc; desc->name; desc++) { in qemu_opts_to_qdict_filtered()
1070 if (!strcmp(desc->name, opt->name)) { in qemu_opts_to_qdict_filtered()
1097 bool qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc, Error **errp) in qemu_opts_validate() argument
1104 opt->desc = find_desc_by_name(desc, opt->name); in qemu_opts_validate()
1105 if (!opt->desc) { in qemu_opts_validate()
1147 QemuOptDesc *desc = NULL; in count_opts_list() local
1154 desc = list->desc; in count_opts_list()
1155 while (desc && desc->name) { in count_opts_list()
1157 desc++; in count_opts_list()
1177 QemuOptDesc *desc; in qemu_opts_append() local
1211 dst->desc[num_dst_opts].name = NULL; in qemu_opts_append()
1215 desc = list->desc; in qemu_opts_append()
1216 while (desc && desc->name) { in qemu_opts_append()
1217 if (find_desc_by_name(dst->desc, desc->name) == NULL) { in qemu_opts_append()
1218 dst->desc[num_dst_opts++] = *desc; in qemu_opts_append()
1219 dst->desc[num_dst_opts].name = NULL; in qemu_opts_append()
1221 desc++; in qemu_opts_append()