Skip to content
  • Igor Mammedov's avatar
    cc001888
    numa: fixup parsed NumaNodeOptions earlier · cc001888
    Igor Mammedov authored
    
    
    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: default avatarIgor Mammedov <imammedo@redhat.com>
    Message-Id: <1507801198-98182-1-git-send-email-imammedo@redhat.com>
    Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
    cc001888
    numa: fixup parsed NumaNodeOptions earlier
    Igor Mammedov authored
    
    
    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: default avatarIgor Mammedov <imammedo@redhat.com>
    Message-Id: <1507801198-98182-1-git-send-email-imammedo@redhat.com>
    Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Loading