提交 5e89db76 编写于 作者: C Chunyan Liu 提交者: Stefan Hajnoczi

QemuOpts: move find_desc_by_name ahead for later calling

Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NChunyan Liu <cyliu@suse.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 a2c0fe2f
......@@ -173,6 +173,20 @@ static void parse_option_number(const char *name, const char *value,
}
}
static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc,
const char *name)
{
int i;
for (i = 0; desc[i].name != NULL; i++) {
if (strcmp(desc[i].name, name) == 0) {
return &desc[i];
}
}
return NULL;
}
void parse_option_size(const char *name, const char *value,
uint64_t *ret, Error **errp)
{
......@@ -637,20 +651,6 @@ static bool opts_accepts_any(const QemuOpts *opts)
return opts->list->desc[0].name == NULL;
}
static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc,
const char *name)
{
int i;
for (i = 0; desc[i].name != NULL; i++) {
if (strcmp(desc[i].name, name) == 0) {
return &desc[i];
}
}
return NULL;
}
int qemu_opt_unset(QemuOpts *opts, const char *name)
{
QemuOpt *opt = qemu_opt_find(opts, name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册