mirror of https://github.com/xemu-project/xemu.git
vl: Tighten parsing of -machine option phandle_start
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>
This commit is contained in:
parent
2ff3de685a
commit
c1b71b0c03
|
@ -240,11 +240,8 @@ uint32_t qemu_devtree_alloc_phandle(void *fdt)
|
||||||
* which phandle id to start allocting phandles.
|
* which phandle id to start allocting phandles.
|
||||||
*/
|
*/
|
||||||
if (!phandle) {
|
if (!phandle) {
|
||||||
const char *phandle_start = qemu_opt_get(qemu_get_machine_opts(),
|
phandle = qemu_opt_get_number(qemu_get_machine_opts(),
|
||||||
"phandle_start");
|
"phandle_start", 0);
|
||||||
if (phandle_start) {
|
|
||||||
phandle = strtoul(phandle_start, NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!phandle) {
|
if (!phandle) {
|
||||||
|
|
2
vl.c
2
vl.c
|
@ -409,7 +409,7 @@ static QemuOptsList qemu_machine_opts = {
|
||||||
.help = "Dump current dtb to a file and quit",
|
.help = "Dump current dtb to a file and quit",
|
||||||
}, {
|
}, {
|
||||||
.name = "phandle_start",
|
.name = "phandle_start",
|
||||||
.type = QEMU_OPT_STRING,
|
.type = QEMU_OPT_NUMBER,
|
||||||
.help = "The first phandle ID we may generate dynamically",
|
.help = "The first phandle ID we may generate dynamically",
|
||||||
}, {
|
}, {
|
||||||
.name = "dt_compatible",
|
.name = "dt_compatible",
|
||||||
|
|
Loading…
Reference in New Issue