1. 14 12月, 2018 2 次提交
    • D
      Enforce a standard header file guard symbol name · 568a4172
      Daniel P. Berrangé 提交于
      Require that all headers are guarded by a symbol named
      
        LIBVIRT_$FILENAME
      
      where $FILENAME is the uppercased filename, with all characters
      outside a-z changed into '_'.
      
      Note we do not use a leading __ because that is technically a
      namespace reserved for the toolchain.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      568a4172
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  2. 07 12月, 2018 1 次提交
  3. 05 12月, 2018 1 次提交
  4. 27 11月, 2018 2 次提交
  5. 21 9月, 2018 6 次提交
  6. 17 9月, 2018 2 次提交
  7. 23 7月, 2018 3 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
    • A
      src: Don't rely on strncpy()-like behavior · 583bdfa6
      Andrea Bolognani 提交于
      The strncpy() function has this quirk where it will copy
      *up* to the requested number of bytes, that is, it will
      stop early if it encounters a NULL byte in the source
      string.
      
      This makes it legal to pass the size of the destination
      buffer (minus one byte needed for the string terminator)
      as the number of bytes to copy and still get something
      somewhat reasonable out of the operation; unfortunately,
      it also makes the function difficult to reason about
      and way too easy to misuse.
      
      We want to move away from the way strncpy() behaves and
      towards better defined semantics, where virStrncpy()
      will always copy *exactly* the number of bytes it's
      been asked to copy; before we can do that, though, we
      have to change a few of the callers.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      583bdfa6
    • A
      src: Use virStrcpyStatic() wherever possible · bfb8ab1b
      Andrea Bolognani 提交于
      This convenience macro was created for the simple cases
      where the length of the source string and the size of the
      destination buffer can be figued out with strlen() and
      sizeof() respectively, so we should use it wherever
      possible instead of open-coding parts of it.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      bfb8ab1b
  8. 14 6月, 2018 1 次提交
  9. 11 6月, 2018 3 次提交
  10. 15 5月, 2018 1 次提交
  11. 08 5月, 2018 1 次提交
  12. 04 5月, 2018 1 次提交
  13. 24 4月, 2018 1 次提交
  14. 18 4月, 2018 3 次提交
  15. 23 2月, 2018 1 次提交
  16. 22 2月, 2018 1 次提交
  17. 14 12月, 2017 2 次提交
  18. 12 12月, 2017 2 次提交
    • M
      xenMakeIPList: Don't leak @address_array · 34fb67ef
      Michal Privoznik 提交于
      ==32171== 32 bytes in 1 blocks are definitely lost in loss record 44 of 107
      ==32171==    at 0x4C2DEF6: calloc (vg_replace_malloc.c:711)
      ==32171==    by 0x55744A9: virAllocN (viralloc.c:191)
      ==32171==    by 0x12CED2: xenMakeIPList (xen_common.c:1186)
      ==32171==    by 0x12D0BE: xenFormatNet (xen_common.c:1221)
      ==32171==    by 0x12F0D2: xenFormatVif (xen_common.c:1889)
      ==32171==    by 0x12F2B4: xenFormatConfigCommon (xen_common.c:1944)
      ==32171==    by 0x13BA32: xenFormatXL (xen_xl.c:1971)
      ==32171==    by 0x1186CA: testCompareParseXML (xlconfigtest.c:105)
      ==32171==    by 0x118A64: testCompareHelper (xlconfigtest.c:205)
      ==32171==    by 0x119E36: virTestRun (testutils.c:180)
      ==32171==    by 0x11970E: mymain (xlconfigtest.c:301)
      ==32171==    by 0x11BEE3: virTestMain (testutils.c:1119)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      34fb67ef
    • M
      xenParseXLVnuma: Don't leak @tmp and @token · 747faf11
      Michal Privoznik 提交于
      ==30399== 180 (144 direct, 36 indirect) bytes in 3 blocks are definitely lost in loss record 91 of 111
      ==30399==    at 0x4C2E0FF: realloc (vg_replace_malloc.c:785)
      ==30399==    by 0x5574572: virReallocN (viralloc.c:245)
      ==30399==    by 0x5574668: virExpandN (viralloc.c:294)
      ==30399==    by 0x55747AB: virResizeN (viralloc.c:352)
      ==30399==    by 0x560074D: virStringSplitCount (virstring.c:115)
      ==30399==    by 0x137A59: xenParseXLVnuma (xen_xl.c:442)
      ==30399==    by 0x13952B: xenParseXL (xen_xl.c:1064)
      ==30399==    by 0x11884D: testCompareFormatXML (xlconfigtest.c:152)
      ==30399==    by 0x118A87: testCompareHelper (xlconfigtest.c:207)
      ==30399==    by 0x119E36: virTestRun (testutils.c:180)
      ==30399==    by 0x119186: mymain (xlconfigtest.c:274)
      ==30399==    by 0x11BEE3: virTestMain (testutils.c:1119)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      747faf11
  19. 09 12月, 2017 2 次提交
  20. 25 11月, 2017 1 次提交
  21. 18 11月, 2017 1 次提交
  22. 13 11月, 2017 1 次提交
    • W
      xenconfig: add domxml conversions for xen-xl · 03d0959a
      Wim ten Have 提交于
      This patch converts NUMA configurations between the Xen libxl
      configuration file format and libvirt's XML format.
      
      XML HVM domain on a 4 node (2 cores/socket) configuration:
      
        <cpu>
          <numa>
            <cell id='0' cpus='0-1' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='10'/>
                <sibling id='1' value='21'/>
                <sibling id='2' value='31'/>
                <sibling id='3' value='21'/>
              </distances>
            </cell>
            <cell id='1' cpus='2-3' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='21'/>
                <sibling id='1' value='10'/>
                <sibling id='2' value='21'/>
                <sibling id='3' value='31'/>
              </distances>
            </cell>
            <cell id='2' cpus='3-4' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='31'/>
                <sibling id='1' value='21'/>
                <sibling id='2' value='10'/>
                <sibling id='3' value='21'/>
              </distances>
            </cell>
            <cell id='3' cpus='5-6' memory='2097152' unit='KiB'>
              <distances>
                <sibling id='0' value='21'/>
                <sibling id='1' value='31'/>
                <sibling id='2' value='21'/>
                <sibling id='3' value='10'/>
              </distances>
            </cell>
          </numa>
        </cpu>
      
      Xen xl.cfg domain configuration:
      
        vnuma = [["pnode=0","size=2048","vcpus=0-1","vdistances=10,21,31,21"],
                 ["pnode=1","size=2048","vcpus=2-3","vdistances=21,10,21,31"],
                 ["pnode=2","size=2048","vcpus=4-5","vdistances=31,21,10,21"],
                 ["pnode=3","size=2048","vcpus=6-7","vdistances=21,31,21,10"]]
      
      If there is no XML <distances> description amongst the <cell> data the
      conversion schema from xml to native will generate 10 for local and 20
      for all remote instances.
      Signed-off-by: NWim ten Have <wim.ten.have@oracle.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      03d0959a
  23. 07 11月, 2017 1 次提交