You need to sign in or sign up before continuing.
  • E
    maint: fix awkward typing of virDomainChrGetDomainPtrs · f8fa2b3e
    Eric Blake 提交于
    virDomainChrGetDomainPtrs() required 4 levels of pointers (taking
    a parameter that will be used as an output variable to return the
    address of another variable that contains an array of pointers).
    This is rather complex to reason about, especially when outside
    of the domain_conf file, no other caller should be modifying
    the resulting array of pointers directly.  Changing the public
    signature gives something is easier to reason with, and actually
    make const-correct; which is important as it was the only function
    that was blocking virDomainDeviceDefCopy from treating its source
    as const.
    
    * src/conf/domain_conf.h (virDomainChrGetDomainPtrs): Use simpler
    types, and make const-correct for external users.
    * src/conf/domain_conf.c (virDomainChrGetDomainPtrs): Split...
    (virDomainChrGetDomainPtrsInternal): ...into an internal version
    that lets us modify terms, vs. external form that is read-only.
    (virDomainDeviceDefPostParseInternal, virDomainChrFind)
    (virDomainChrInsert): Adjust callers.
    * src/qemu/qemu_command.c (qemuGetNextChrDevIndex): Adjust caller.
    (qemuDomainDeviceAliasIndex): Make const-correct.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    f8fa2b3e
qemu_command.c 417.4 KB