• L
    conf: eliminate hardcoded indent from domain xml · ca6dc7b5
    Laine Stump 提交于
    Many of the domain xml format functions (including all of the device
    format functions) had hard-coded spaces, which made for incorrect
    indentation when those functions were called in a different context
    (for example, commit 2122cf39 added <interface> XML into the document
    provided to a network hook script, and in this case it should have
    been indented by 2 spaces, but was instead indented by 6 spaces).
    
    To make it possible to insert a properly indented device anywhere into
    an XML document, this patch removes hardcoded spaces from the
    formatting functions, and calls virBufferAdjustIndent() at appropriate
    places instead. (a regex search of domain_conf.c was done to assure
    that all occurrences of hardcoded spaces were removed).
    
    virDomainDiskSourceDefFormatInternal() is also called from
    snapshot_conf.c, so two virBufferAdjustIndent() calls were temporarily
    added around that call - those functions will have hardcoded spaces
    removed in a separate patch.
    
    This could cause some conflicts when backporting future changes to the
    formatting functions to older branches, but fortunately the changes
    are almost all trivial, so conflict resolution will be obvious.
    ca6dc7b5
snapshot_conf.c 42.7 KB