]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
QemuOpts: move find_desc_by_name ahead for later calling
authorChunyan Liu <cyliu@suse.com>
Thu, 5 Jun 2014 09:20:40 +0000 (17:20 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Jun 2014 09:23:19 +0000 (17:23 +0800)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
util/qemu-option.c

index 324e4c59f704974ca732252cc72b8049dfe4f1bc..c188c5ce6c0e0bd583a45242240b3bce4f1353e4 100644 (file)
@@ -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);