Skip to content
  • Laszlo Ersek's avatar
    d9570434
    OptsVisitor: introduce basic list modes · d9570434
    Laszlo Ersek authored
    
    
    We're going to need more state while processing a list of repeated
    options. This change eliminates "repeated_opts_first" and adds a new state
    variable:
    
      list_mode       repeated_opts  repeated_opts_first
      --------------  -------------  -------------------
      LM_NONE         NULL           false
      LM_STARTED      non-NULL       true
      LM_IN_PROGRESS  non-NULL       false
    
    Additionally, it is documented that lookup_scalar() and processed(), both
    called by opts_type_XXX(), are invalid in LM_STARTED -- generated qapi
    code calls opts_next_list() to allocate the very first link before trying
    to parse a scalar into it. List mode restrictions are expressed in
    positive / inclusive form.
    
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Tested-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
    Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
    d9570434
    OptsVisitor: introduce basic list modes
    Laszlo Ersek authored
    
    
    We're going to need more state while processing a list of repeated
    options. This change eliminates "repeated_opts_first" and adds a new state
    variable:
    
      list_mode       repeated_opts  repeated_opts_first
      --------------  -------------  -------------------
      LM_NONE         NULL           false
      LM_STARTED      non-NULL       true
      LM_IN_PROGRESS  non-NULL       false
    
    Additionally, it is documented that lookup_scalar() and processed(), both
    called by opts_type_XXX(), are invalid in LM_STARTED -- generated qapi
    code calls opts_next_list() to allocate the very first link before trying
    to parse a scalar into it. List mode restrictions are expressed in
    positive / inclusive form.
    
    Signed-off-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Tested-by: default avatarWanlong Gao <gaowanlong@cn.fujitsu.com>
    Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
Loading