]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vl: Tighten parsing of -machine option phandle_start
authorMarkus Armbruster <armbru@redhat.com>
Thu, 4 Jul 2013 13:09:23 +0000 (15:09 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 9 Jul 2013 18:38:58 +0000 (13:38 -0500)
Make it QEMU_OPT_NUMBER, so it gets parsed by generic code, which
actually bothers to check for errors, rather than its user, which
doesn't.

Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Message-id: 1372943363-24081-8-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
device_tree.c
vl.c

index 0e7fe2dda66accff47890bf4a0abd63d1f17db78..10cf3d0b60c2f9e9d0f82417d4a64c8933cc39f7 100644 (file)
@@ -240,11 +240,8 @@ uint32_t qemu_devtree_alloc_phandle(void *fdt)
      * which phandle id to start allocting phandles.
      */
     if (!phandle) {
-        const char *phandle_start = qemu_opt_get(qemu_get_machine_opts(),
-                                                 "phandle_start");
-        if (phandle_start) {
-            phandle = strtoul(phandle_start, NULL, 0);
-        }
+        phandle = qemu_opt_get_number(qemu_get_machine_opts(),
+                                      "phandle_start", 0);
     }
 
     if (!phandle) {
diff --git a/vl.c b/vl.c
index fb69f226e13e7aa0fda2d878d0badce59b390bf1..bea1a10cc6fce653c6e4c7213a4accdcd824817e 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -409,7 +409,7 @@ static QemuOptsList qemu_machine_opts = {
             .help = "Dump current dtb to a file and quit",
         }, {
             .name = "phandle_start",
-            .type = QEMU_OPT_STRING,
+            .type = QEMU_OPT_NUMBER,
             .help = "The first phandle ID we may generate dynamically",
         }, {
             .name = "dt_compatible",