Skip to content

Commit

Permalink
vl: Tighten parsing of -machine option phandle_start
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Message-id: [email protected]
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
Markus Armbruster authored and Anthony Liguori committed Jul 9, 2013
1 parent 2ff3de6 commit c1b71b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions device_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c1b71b0

Please sign in to comment.