numa: fixup parsed NumaNodeOptions earlier
commitcc001888b78090ed08d05453b5574b3253a143c0
authorIgor Mammedov <imammedo@redhat.com>
Thu, 12 Oct 2017 09:39:58 +0000 (12 11:39 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 27 Oct 2017 14:04:28 +0000 (27 16:04 +0200)
treee4fdf9a8cf57c74f8523ec470bdd5acd2dd27fec
parent5daab28e0477e9eed0fb8d454276c35853f3e1a2
numa: fixup parsed NumaNodeOptions earlier

numa 'mem' option with suffix or without one is possible
only on CLI/HMP. Instead of fixing up special suffix less
CLI case deep in parse_numa_node() do it earlier right
after option is parsed into NumaNodeOptions with OptVisistor
so that the rest of the code would use valid values in
NumaNodeOptions and won't have to reparse QemuOpts.

It will help to isolate CLI/HMP parts in parse_numa() and
split out parsed NumaNodeOptions processing into separate
function that could be reused by QMP handler where we have
only NumaNodeOptions and don't need any fixups.

While at it reuse qemu_strtosz_MiB() instead of manually
checking for suffixes.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1507801198-98182-1-git-send-email-imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
numa.c